- fixes to use moving infobar non non-accel hardware.
authorFelix Domke <tmbinc@elitedvb.net>
Wed, 31 Aug 2005 03:40:23 +0000 (03:40 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Wed, 31 Aug 2005 03:40:23 +0000 (03:40 +0000)
lib/gdi/gfbdc.cpp
lib/gdi/gpixmap.cpp
lib/gui/ewidgetanimation.cpp
lib/gui/ewidgetdesktop.cpp
lib/python/Screens/InfoBar.py
main/enigma.cpp

index 08b4586..a1f4c98 100644 (file)
@@ -149,13 +149,20 @@ void gFBDC::exec(gOpcode *o)
        case gOpcode::waitVSync:
        {
                static timeval l;
+               static int t;
                timeval now;
-               gettimeofday(&now, 0);
                
-               int diff = (now.tv_sec - l.tv_sec) * 1000 + (now.tv_usec - l.tv_usec) / 1000;
-               eDebug("%d ms latency (%d fps)", diff, 1000 / diff ?: 1);
+               if (t == 1000)
+               {
+                       gettimeofday(&now, 0);
                
-               l = now;
+                       int diff = (now.tv_sec - l.tv_sec) * 1000 + (now.tv_usec - l.tv_usec) / 1000;
+                       eDebug("%d ms latency (%d fps)", diff, t * 1000 / (diff ? diff : 1));
+                       l = now;
+                       t = 0;
+               }
+               
+               ++t;
                
                fb->waitVSync();
                break;
index a551984..dbf5383 100644 (file)
@@ -191,6 +191,7 @@ void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag
                if ((surface->data_phys && src.surface->data_phys) && (gAccel::getInstance()))
                        if (!gAccel::getInstance()->blit(surface, src.surface, area.topLeft(), srcarea, flag))
                                continue;
+               flag &= ~ blitAlphaBlend;
                
                if ((surface->bpp == 8) && (src.surface->bpp==8))
                {
index 3912d59..a31f2ed 100644 (file)
@@ -19,16 +19,24 @@ void eWidgetAnimation::tick(int inc)
                        m_active = 0;
                        m_move_current_tick = m_move_length;
                }
-               int xdiff = m_move_end.x() - m_move_start.x();
-               int ydiff = m_move_end.y() - m_move_start.y();
                
+               m_move_start = m_widget->position();
+               
+               int xdiff = m_move_start.x() - m_move_end.x();
+               int ydiff = m_move_start.y() - m_move_end.y();
+               
+               xdiff *= 31; xdiff /= 32;
+               ydiff *= 31; ydiff /= 32;
+               
+               #if 0
                xdiff *= m_move_current_tick;
                xdiff /= m_move_length;
 
                ydiff *= m_move_current_tick;
                ydiff /= m_move_length;
+               #endif
                
-               ePoint res(m_move_start.x() + xdiff, m_move_start.y() + ydiff);
+               ePoint res(m_move_end.x() + xdiff, m_move_end.y() + ydiff);
                
                m_move_current_tick += inc;
                
index 1c65d5d..dcc2ef6 100644 (file)
@@ -36,7 +36,7 @@ int eWidgetDesktop::movedWidget(eWidget *root)
        if ((m_comp_mode == cmBuffered) && (root->m_comp_buffer))
        {
                root->m_comp_buffer->m_position = root->position();
-               redrawComposition(0);
+//             redrawComposition(0);
                return 0;
        }
        
@@ -96,6 +96,11 @@ void eWidgetDesktop::recalcClipRegions(eWidget *root)
                invalidate(redraw);
        } else
        {
+               if (!root->m_vis & eWidget::wVisShow)
+               {
+                       removeBufferForWidget(root);
+                       return;
+               }
                if ((!root->m_comp_buffer) || (root->size() != root->m_comp_buffer->m_screen_size))
                        createBufferForWidget(root);
 
@@ -203,7 +208,6 @@ void eWidgetDesktop::paintBackground(eWidgetDesktopCompBuffer *comp)
 
 void eWidgetDesktop::paint()
 {
-       eDebug("paint");
        m_require_redraw = 0;
        
                /* walk all root windows. */
@@ -230,8 +234,7 @@ void eWidgetDesktop::paint()
        
        if (m_comp_mode == cmBuffered)
        {
-               eDebug("redraw composition");
-               redrawComposition(0);
+//             redrawComposition(0);
        }
 }
 
index da2509e..ed193f3 100644 (file)
@@ -30,6 +30,8 @@ class InfoBar(Screen):
                #instantiate forever
                self.servicelist = self.session.instantiateDialog(ChannelSelection)
                self.volumeBar = VolumeBar()            
+               
+               self.state = self.STATE_HIDDEN
 
                self["actions"] = ActionMap( [ "InfobarActions" ], 
                        {
@@ -84,7 +86,7 @@ class InfoBar(Screen):
                self.instance.hide()
 
        def toggleShow(self):
-               if self.instance.isVisible():
+               if self.state == self.STATE_SHOWN:
 #                      self.instance.hide()
                        self.startHide()
                else:
@@ -108,10 +110,12 @@ class InfoBar(Screen):
                self.volumeBar.setValue(eDVBVolumecontrol.getInstance().getVolume())
                
        def startShow(self):
-               self.instance.m_animation.startMoveAnimation(ePoint(0, 500), ePoint(0, 380), 100)
+               self.instance.m_animation.startMoveAnimation(ePoint(0, 600), ePoint(0, 380), 100)
+               self.state = self.STATE_SHOWN
        
        def startHide(self):
-               self.instance.m_animation.startMoveAnimation(ePoint(0, 380), ePoint(0, 500), 100)
+               self.instance.m_animation.startMoveAnimation(ePoint(0, 380), ePoint(0, 600), 100)
+               self.state = self.STATE_HIDDEN
 
        def     volMute(self):
                eDVBVolumecontrol.getInstance().volumeToggleMute()
index a798b72..16bbcbc 100644 (file)
@@ -162,7 +162,7 @@ int main(int argc, char **argv)
 
        eWidgetDesktop dsk(eSize(720, 576));
        
-//     dsk.setCompositionMode(eWidgetDesktop::cmBuffered);
+       dsk.setCompositionMode(eWidgetDesktop::cmBuffered);
        
        wdsk = &dsk;