Title: [107657] trunk/Source/WebCore
- Revision
- 107657
- Author
- [email protected]
- Date
- 2012-02-13 18:36:00 -0800 (Mon, 13 Feb 2012)
Log Message
The tile cache layer should have its background set to the page background
https://bugs.webkit.org/show_bug.cgi?id=78560
<rdar://problem/10857472>
Reviewed by Sam Weinig.
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
Inform the RenderLayerCompositor that the background color has changed.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateLayerBackgroundColor):
For tile cache layers we don't need a separate contents layer for the background color so
just set the background color on the layer directly.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::documentBackgroundColorDidChange):
If the root render layer is using a tile cache layer, update its background color.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (107656 => 107657)
--- trunk/Source/WebCore/ChangeLog 2012-02-14 02:24:12 UTC (rev 107656)
+++ trunk/Source/WebCore/ChangeLog 2012-02-14 02:36:00 UTC (rev 107657)
@@ -1,3 +1,24 @@
+2012-02-13 Anders Carlsson <[email protected]>
+
+ The tile cache layer should have its background set to the page background
+ https://bugs.webkit.org/show_bug.cgi?id=78560
+ <rdar://problem/10857472>
+
+ Reviewed by Sam Weinig.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::recalculateScrollbarOverlayStyle):
+ Inform the RenderLayerCompositor that the background color has changed.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::updateLayerBackgroundColor):
+ For tile cache layers we don't need a separate contents layer for the background color so
+ just set the background color on the layer directly.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::documentBackgroundColorDidChange):
+ If the root render layer is using a tile cache layer, update its background color.
+
2012-02-13 Raul Hudea <[email protected]>
Implement Element.webkitRegionOverflow
Modified: trunk/Source/WebCore/page/FrameView.cpp (107656 => 107657)
--- trunk/Source/WebCore/page/FrameView.cpp 2012-02-14 02:24:12 UTC (rev 107656)
+++ trunk/Source/WebCore/page/FrameView.cpp 2012-02-14 02:36:00 UTC (rev 107657)
@@ -327,6 +327,13 @@
ScrollbarOverlayStyle overlayStyle = ScrollbarOverlayStyleDefault;
Color backgroundColor = documentBackgroundColor();
+#if USE(ACCELERATED_COMPOSITING)
+ if (RenderView* root = rootRenderer(this)) {
+ RenderLayerCompositor* compositor = root->compositor();
+ compositor->documentBackgroundColorDidChange();
+ }
+#endif
+
if (backgroundColor.isValid()) {
// Reduce the background color from RGB to a lightness value
// and determine which scrollbar style to use based on a lightness
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (107656 => 107657)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2012-02-14 02:24:12 UTC (rev 107656)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2012-02-14 02:36:00 UTC (rev 107657)
@@ -1438,6 +1438,11 @@
void GraphicsLayerCA::updateLayerBackgroundColor()
{
+ if (m_layer->layerType() == PlatformCALayer::LayerTypeTileCacheLayer) {
+ m_layer->setBackgroundColor(m_backgroundColor);
+ return;
+ }
+
if (!m_contentsLayer)
return;
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (107656 => 107657)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-02-14 02:24:12 UTC (rev 107656)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2012-02-14 02:36:00 UTC (rev 107657)
@@ -1644,6 +1644,23 @@
}
}
+void RenderLayerCompositor::documentBackgroundColorDidChange()
+{
+ RenderLayerBacking* backing = rootRenderLayer()->backing();
+ if (!backing)
+ return;
+
+ GraphicsLayer* graphicsLayer = backing->graphicsLayer();
+ if (!graphicsLayer->client()->shouldUseTileCache(graphicsLayer))
+ return;
+
+ Color backgroundColor = m_renderView->frameView()->documentBackgroundColor();
+ if (!backgroundColor.isValid() || backgroundColor.hasAlpha())
+ backgroundColor = Color::white;
+
+ graphicsLayer->setBackgroundColor(backgroundColor);
+}
+
bool RenderLayerCompositor::showDebugBorders(const GraphicsLayer* layer) const
{
if (layer == m_layerForHorizontalScrollbar || layer == m_layerForVerticalScrollbar || layer == m_layerForScrollCorner)
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (107656 => 107657)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2012-02-14 02:24:12 UTC (rev 107656)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2012-02-14 02:36:00 UTC (rev 107657)
@@ -209,6 +209,8 @@
GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }
#endif
+ void documentBackgroundColorDidChange();
+
private:
// GraphicsLayerClient Implementation
virtual void notifyAnimationStarted(const GraphicsLayer*, double) { }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes