From 78627eabc83565cf2a6281be255b8b3b826a13e6 Mon Sep 17 00:00:00 2001 From: "enne@google.com" Date: Tue, 13 Mar 2012 22:06:24 +0000 Subject: [PATCH] [chromium] Mark root layer scrollbars as always opaque to disable blending https://bugs.webkit.org/show_bug.cgi?id=79951 Reviewed by James Robinson. Source/WebCore: Now that scrollbar layers exist, mark non-overlay root scrollbars as opaque. This disables blending for correctness and performance. * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp: (WebCore::scrollbarLayerDidChange): (WebCore::ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange): (WebCore::ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange): * platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::drawTileQuad): LayoutTests: Mark canvas-text-alignment.html as failing on Linux in general, not just in debug. I believe that with this change, the same image will pass on both release and debug, but will land that change separately. * platform/chromium/test_expectations.txt: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110620 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 13 ++++++++++ .../platform/chromium/test_expectations.txt | 2 +- Source/WebCore/ChangeLog | 17 +++++++++++++ .../chromium/ScrollingCoordinatorChromium.cpp | 28 ++++++++++++---------- 4 files changed, 47 insertions(+), 13 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 087c836..7f5d162 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,16 @@ +2012-03-13 Adrienne Walker + + [chromium] Mark root layer scrollbars as always opaque to disable blending + https://bugs.webkit.org/show_bug.cgi?id=79951 + + Reviewed by James Robinson. + + Mark canvas-text-alignment.html as failing on Linux in general, not + just in debug. I believe that with this change, the same image will + pass on both release and debug, but will land that change separately. + + * platform/chromium/test_expectations.txt: + 2012-03-13 Thiago Marcos P. Santos [EFL][DRT] Expose window.internals object diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt index 093e5f8..ed80a14 100644 --- a/LayoutTests/platform/chromium/test_expectations.txt +++ b/LayoutTests/platform/chromium/test_expectations.txt @@ -3702,7 +3702,7 @@ BUGWK78422 WIN LINUX : svg/animations/animate-text-nested-transforms.html = TEXT BUGV8_1948 : fast/js/dfg-put-by-id-prototype-check.html = TEXT -BUGWK78529 LINUX DEBUG : platform/chromium/virtual/gpu/fast/canvas/canvas-text-alignment.html = IMAGE +BUGWK78529 LINUX : platform/chromium/virtual/gpu/fast/canvas/canvas-text-alignment.html = IMAGE BUGWK78561 WIN : css3/filters/crash-hw-sw-switch.html = MISSING BUGWK78561 WIN : css3/filters/filter-empty-element-crash.html = MISSING diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 43bf545..bde0293 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,20 @@ +2012-03-13 Adrienne Walker + + [chromium] Mark root layer scrollbars as always opaque to disable blending + https://bugs.webkit.org/show_bug.cgi?id=79951 + + Reviewed by James Robinson. + + Now that scrollbar layers exist, mark non-overlay root scrollbars as + opaque. This disables blending for correctness and performance. + + * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp: + (WebCore::scrollbarLayerDidChange): + (WebCore::ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange): + (WebCore::ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange): + * platform/graphics/chromium/LayerRendererChromium.cpp: + (WebCore::LayerRendererChromium::drawTileQuad): + 2012-03-13 Gavin Peters Remove vestigal abortEvent from image attribute. diff --git a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp index 9504dfa..0174405 100644 --- a/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp +++ b/Source/WebCore/page/scrolling/chromium/ScrollingCoordinatorChromium.cpp @@ -81,12 +81,23 @@ static GraphicsLayer* scrollLayerForFrameView(FrameView* frameView) #endif } -static void scrollbarLayerDidChange(Scrollbar* scrollbar, LayerChromium* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer) +static void scrollbarLayerDidChange(Scrollbar* scrollbar, LayerChromium* scrollLayer, GraphicsLayer* scrollbarGraphicsLayer, FrameView* frameView) { ASSERT(scrollbar); - ASSERT(scrollLayer); ASSERT(scrollbarGraphicsLayer); + if (!scrollLayer) { + // FIXME: sometimes we get called before setScrollLayer, workaround by finding the scroll layout ourselves. + scrollLayer = scrollLayerForFrameView(frameView)->platformLayer(); + ASSERT(scrollLayer); + } + + // Root layer non-overlay scrollbars should be marked opaque to disable + // blending. + bool isOpaqueRootScrollbar = !frameView->parent() && !scrollbar->isOverlayScrollbar(); + if (!scrollbarGraphicsLayer->contentsOpaque()) + scrollbarGraphicsLayer->setContentsOpaque(isOpaqueRootScrollbar); + if (scrollbar->isCustomScrollbar() || !CCProxy::hasImplThread()) { scrollbarGraphicsLayer->setContentsToMedia(0); scrollbarGraphicsLayer->setDrawsContent(true); @@ -96,6 +107,7 @@ static void scrollbarLayerDidChange(Scrollbar* scrollbar, LayerChromium* scrollL RefPtr scrollbarLayer = ScrollbarLayerChromium::create(scrollbar, scrollLayer->id()); scrollbarGraphicsLayer->setContentsToMedia(scrollbarLayer.get()); scrollbarGraphicsLayer->setDrawsContent(false); + scrollbarLayer->setOpaque(scrollbarGraphicsLayer->contentsOpaque()); } void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* horizontalScrollbarLayer) @@ -103,11 +115,7 @@ void ScrollingCoordinator::frameViewHorizontalScrollbarLayerDidChange(FrameView* if (!horizontalScrollbarLayer || !coordinatesScrollingForFrameView(frameView)) return; - LayerChromium* scrollLayer = m_private->scrollLayer(); - if (!scrollLayer) // FIXME: sometimes we get called before setScrollLayer, workaround by finding the scroll layout ourselves. - scrollLayer = scrollLayerForFrameView(frameView)->platformLayer(); - - scrollbarLayerDidChange(frameView->horizontalScrollbar(), scrollLayer, horizontalScrollbarLayer); + scrollbarLayerDidChange(frameView->horizontalScrollbar(), m_private->scrollLayer(), horizontalScrollbarLayer, frameView); } void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* frameView, GraphicsLayer* verticalScrollbarLayer) @@ -115,11 +123,7 @@ void ScrollingCoordinator::frameViewVerticalScrollbarLayerDidChange(FrameView* f if (!verticalScrollbarLayer || !coordinatesScrollingForFrameView(frameView)) return; - LayerChromium* scrollLayer = m_private->scrollLayer(); - if (!scrollLayer) // FIXME: sometimes we get called before setScrollLayer, workaround by finding the scroll layout ourselves. - scrollLayer = scrollLayerForFrameView(frameView)->platformLayer(); - - scrollbarLayerDidChange(frameView->verticalScrollbar(), scrollLayer, verticalScrollbarLayer); + scrollbarLayerDidChange(frameView->verticalScrollbar(), m_private->scrollLayer(), verticalScrollbarLayer, frameView); } void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer) -- 2.7.4