[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/kmplayer/src
From:       Koos Vriezen <koos.vriezen () gmail ! com>
Date:       2011-10-10 20:45:30
Message-ID: 20111010204530.02BFFAC88A () svn ! kde ! org
[Download RAW message or body]

SVN commit 1258265 by vriezen:

Give SMIL documents a default white bg color when not nested

 M  +7 -1      kmplayer_smil.cpp  
 M  +4 -5      surface.cpp  


--- trunk/extragear/multimedia/kmplayer/src/kmplayer_smil.cpp #1258264:1258265
@@ -2056,10 +2056,16 @@
             SMIL::Smil *s = Smil::findSmilNode (this);
             if (s && s->active ()) {
                 Surface *surface = (Surface *)s->role (RoleChildDisplay, s);
-                if (surface)
+                if (surface) {
                     region_surface = surface->createSurface (this, SRect ());
+                    // FIXME, silly heuristic to allow transparency in nesting
+                    if (!background_color.color
+                            && (!s->parentNode ()
+                                || s->parentNode()->id < id_node_smil))
+                        background_color.color = 0xFFFFFAFA; // snow
             }
         }
+        }
         return region_surface.ptr ();
 
     default:
--- trunk/extragear/multimedia/kmplayer/src/surface.cpp #1258264:1258265
@@ -36,16 +36,15 @@
 KDE_NO_CDTOR_EXPORT Surface::Surface (ViewArea *widget)
   : bounds (SRect (0, 0, widget->width (), widget->height ())),
     xscale (1.0), yscale (1.0),
-    background_color (widget->palette().color (widget->backgroundRole()).rgb()),
+    background_color (0),
 #ifdef KMPLAYER_WITH_CAIRO
     surface (0L),
 #endif
     dirty (false),
     scroll (false),
     has_mouse (false),
-    view_widget (widget) {
-    background_color = widget->palette().color (widget->backgroundRole()).rgb();
-}
+    view_widget (widget)
+{}
 
 Surface::~Surface() {
 #ifdef KMPLAYER_WITH_CAIRO
@@ -68,7 +67,7 @@
 
 void Surface::clear () {
     m_first_child = 0L;
-    background_color = view_widget->palette().color (view_widget->backgroundRole()).rgb();
+    background_color = 0;
 }
 
 void Surface::remove () {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic