Title: [88868] branches/safari-534-branch/Source/WebCore

Diff

Modified: branches/safari-534-branch/Source/WebCore/ChangeLog (88867 => 88868)


--- branches/safari-534-branch/Source/WebCore/ChangeLog	2011-06-14 23:06:52 UTC (rev 88867)
+++ branches/safari-534-branch/Source/WebCore/ChangeLog	2011-06-14 23:09:17 UTC (rev 88868)
@@ -1,5 +1,43 @@
 2011-06-14  Lucas Forschler  <[email protected]>
 
+    Merged 88653.
+
+    2011-06-10  Jer Noble  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        Flash of white on left and right edges of screen when showing fullscreen controller when movie doesn't fill the entire screen
+        https://bugs.webkit.org/show_bug.cgi?id=62491
+        <rdar://problem/9584427>
+
+        No new tests; should be covered by existing fullscreen pixel tests.
+
+        On certain displays, when a RenderFullScreen renderer is created, it is large enough to trigger the 
+        creation of a tiled CALayer (instead of a normal CALayer).  Painting in these layers necessarily
+        happens asynchronously, so the flash is occurring because of the async painting of the RenderFullScreen
+        renderer's background color.  Since we know the RenderFullScreen does not otherwise paint its contents,
+        we can add a special case in the RenderLayerBacking to set the GraphicsLayer contents to be the
+        renderer's background color.  Fill in support for creating a contentLayer to contain the background 
+        color inside GraphicsLayerCA.
+
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::setContentsToBackgroundColor): Renamed from setContentsBackgroundColor to match
+            the other setContentsTo... functions.
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setContentsToBackgroundColor): Added. Creates a contentsLayer to host the 
+            background color.
+        (WebCore::GraphicsLayerCA::updateLayerBackgroundColor): Removed a comment only.
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Special case the RenderFullScreen
+            renderer to call updateBackgroundColor.
+        (WebCore::RenderLayerBacking::updateBackgroundColor): Added.
+        (WebCore::RenderLayerBacking::containsPaintedContent): Tell the backing that the RenderFullScreen
+            renderer does not paint its contents.
+        * rendering/RenderLayerBacking.h:
+
+2011-06-14  Lucas Forschler  <[email protected]>
+
     Merged 88629.
 
     2011-06-12  Jer Noble  <[email protected]>

Modified: branches/safari-534-branch/Source/WebCore/platform/graphics/GraphicsLayer.h (88867 => 88868)


--- branches/safari-534-branch/Source/WebCore/platform/graphics/GraphicsLayer.h	2011-06-14 23:06:52 UTC (rev 88867)
+++ branches/safari-534-branch/Source/WebCore/platform/graphics/GraphicsLayer.h	2011-06-14 23:09:17 UTC (rev 88868)
@@ -301,7 +301,7 @@
     // Layer contents
     virtual void setContentsToImage(Image*) { }
     virtual void setContentsToMedia(PlatformLayer*) { } // video or plug-in
-    virtual void setContentsBackgroundColor(const Color&) { }
+    virtual void setContentsToBackgroundColor(const Color&) { }
     virtual void setContentsToCanvas(PlatformLayer*) { }
     virtual bool hasContentsLayer() const { return false; }
 

Modified: branches/safari-534-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (88867 => 88868)


--- branches/safari-534-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-06-14 23:06:52 UTC (rev 88867)
+++ branches/safari-534-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-06-14 23:09:17 UTC (rev 88868)
@@ -661,6 +661,26 @@
         m_client->notifyAnimationStarted(this, startTime);
 }
 
+void GraphicsLayerCA::setContentsToBackgroundColor(const Color& color)
+{
+    setBackgroundColor(color);
+    if (color != Color::transparent) {
+        m_contentsLayerPurpose = ContentsLayerForBackgroundColor;
+        m_contentsLayer = PlatformCALayer::create(PlatformCALayer::LayerTypeLayer, this);
+#ifndef NDEBUG
+        m_contentsLayer->setName("Background Color Layer");
+#endif
+        updateContentsRect();
+        setupContentsLayer(m_contentsLayer.get());
+    } else {
+        m_contentsLayerPurpose = NoContentsLayer;
+        m_contentsLayer = 0;
+    }
+
+    noteSublayersChanged();
+    noteLayerPropertyChanged(BackgroundColorChanged);
+}
+
 void GraphicsLayerCA::setContentsToImage(Image* image)
 {
     if (image) {
@@ -1245,7 +1265,6 @@
     if (!m_contentsLayer)
         return;
 
-    // We never create the contents layer just for background color yet.
     if (m_backgroundColorSet)
         m_contentsLayer->setBackgroundColor(m_backgroundColor);
     else

Modified: branches/safari-534-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (88867 => 88868)


--- branches/safari-534-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2011-06-14 23:06:52 UTC (rev 88867)
+++ branches/safari-534-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2011-06-14 23:09:17 UTC (rev 88868)
@@ -109,6 +109,7 @@
     virtual void setContentsToImage(Image*);
     virtual void setContentsToMedia(PlatformLayer*);
     virtual void setContentsToCanvas(PlatformLayer*);
+    virtual void setContentsToBackgroundColor(const Color&);
 
     virtual bool hasContentsLayer() const { return m_contentsLayer; }
     
@@ -349,7 +350,8 @@
         NoContentsLayer = 0,
         ContentsLayerForImage,
         ContentsLayerForMedia,
-        ContentsLayerForCanvas
+        ContentsLayerForCanvas,
+        ContentsLayerForBackgroundColor
     };
     
     ContentsLayerPurpose m_contentsLayerPurpose;

Modified: branches/safari-534-branch/Source/WebCore/rendering/RenderLayerBacking.cpp (88867 => 88868)


--- branches/safari-534-branch/Source/WebCore/rendering/RenderLayerBacking.cpp	2011-06-14 23:06:52 UTC (rev 88867)
+++ branches/safari-534-branch/Source/WebCore/rendering/RenderLayerBacking.cpp	2011-06-14 23:09:17 UTC (rev 88868)
@@ -306,7 +306,19 @@
         layerConfigChanged = true;
     }
 #endif
-
+#if ENABLE(FULLSCREEN_API)
+    else if (renderer->isRenderFullScreen()) {
+        // RenderFullScreen renderers have no content, and only a solid
+        // background color.  They also can be large enough to trigger the
+        // creation of a tiled-layer, which can cause flashing problems
+        // during repainting.  Special case the RenderFullScreen case because
+        // we know its style does not come from CSS and it is therefore will
+        // not contain paintable content (e.g. background images, gradients,
+        // etc), so safe to set the layer's background color to the renderer's 
+        // style's background color.
+        updateBackgroundColor();
+    }
+#endif
     if (renderer->isRenderPart())
         layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toRenderPart(renderer));
 
@@ -772,6 +784,11 @@
     return renderer()->style()->visitedDependentColor(CSSPropertyBackgroundColor);
 }
 
+void RenderLayerBacking::updateBackgroundColor()
+{
+    m_graphicsLayer->setContentsToBackgroundColor(rendererBackgroundColor());
+}
+
 // A "simple container layer" is a RenderLayer which has no visible content to render.
 // It may have no children, or all its children may be themselves composited.
 // This is a useful optimization, because it allows us to avoid allocating backing store.
@@ -905,6 +922,10 @@
     if (isAcceleratedCanvas(renderer()))
         return hasBoxDecorationsOrBackground(renderer());
 #endif
+#if ENABLE(FULLSCREEN_API)
+    if (renderer()->isRenderFullScreen())
+        return false;
+#endif
 
     return true;
 }

Modified: branches/safari-534-branch/Source/WebCore/rendering/RenderLayerBacking.h (88867 => 88868)


--- branches/safari-534-branch/Source/WebCore/rendering/RenderLayerBacking.h	2011-06-14 23:06:52 UTC (rev 88867)
+++ branches/safari-534-branch/Source/WebCore/rendering/RenderLayerBacking.h	2011-06-14 23:09:17 UTC (rev 88868)
@@ -182,6 +182,7 @@
 
     bool rendererHasBackground() const;
     const Color rendererBackgroundColor() const;
+    void updateBackgroundColor();
 
     bool hasNonCompositingDescendants() const;
     
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to