Unreviewed, rolling out r133122.
authorsenorblanco@chromium.org <senorblanco@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 04:44:38 +0000 (04:44 +0000)
committersenorblanco@chromium.org <senorblanco@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 04:44:38 +0000 (04:44 +0000)
http://trac.webkit.org/changeset/133122
https://bugs.webkit.org/show_bug.cgi?id=99083

Broke Chromium Win, Android, ChromeOS builds

Source/Platform:

* chromium/public/WebContentLayerClient.h:
(WebContentLayerClient):

Source/WebCore:

* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setContentsOpaque):
(WebCore::GraphicsLayerChromium::paint):
* platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
(WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
* platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.h:
(OpaqueRectTrackingContentLayerDelegate):

Source/WebKit/chromium:

* src/LinkHighlight.cpp:
(WebKit::LinkHighlight::paintContents):
* src/LinkHighlight.h:
(LinkHighlight):
* src/NonCompositedContentHost.cpp:
(WebKit::NonCompositedContentHost::NonCompositedContentHost):
(WebKit::NonCompositedContentHost::setOpaque):
(WebKit::NonCompositedContentHost::paintContents):
* src/NonCompositedContentHost.h:
(NonCompositedContentHost):
* tests/OpaqueRectTrackingContentLayerDelegateTest.cpp:
(WebCore::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/Platform/ChangeLog
Source/Platform/chromium/public/WebContentLayerClient.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp
Source/WebCore/platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/LinkHighlight.cpp
Source/WebKit/chromium/src/LinkHighlight.h
Source/WebKit/chromium/src/NonCompositedContentHost.cpp
Source/WebKit/chromium/src/NonCompositedContentHost.h
Source/WebKit/chromium/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp

index b36f45a..1f7c7bf 100644 (file)
@@ -1,3 +1,14 @@
+2012-10-31  Stephen White  <senorblanco@chromium.org>
+
+        Unreviewed, rolling out r133122.
+        http://trac.webkit.org/changeset/133122
+        https://bugs.webkit.org/show_bug.cgi?id=99083
+
+        Broke Chromium Win, Android, ChromeOS builds
+
+        * chromium/public/WebContentLayerClient.h:
+        (WebContentLayerClient):
+
 2012-10-31  Alok Priyadarshi  <alokp@chromium.org>
 
         [chromium] Pass canPaintLCDText to WebContentLayerClient::paintContents
index 8274d9e..5469bd2 100644 (file)
@@ -43,8 +43,7 @@ public:
     // optimizations.
 #define WEBCONTENTLAYERCLIENT_HAS_OPAQUE 1
 #define WEBCONTENTLAYERCLIENT_FLOAT_OPAQUE_RECT 1
-#define WEBCONTENTLAYERCLIENT_HAS_CANPAINTLCDTEXT 1
-    virtual void paintContents(WebCanvas*, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque) = 0;
+    virtual void paintContents(WebCanvas*, const WebRect& clip, WebFloatRect& opaque) = 0;
 
 protected:
     virtual ~WebContentLayerClient() { }
index 046a2c8..8f637b5 100644 (file)
@@ -1,3 +1,19 @@
+2012-10-31  Stephen White  <senorblanco@chromium.org>
+
+        Unreviewed, rolling out r133122.
+        http://trac.webkit.org/changeset/133122
+        https://bugs.webkit.org/show_bug.cgi?id=99083
+
+        Broke Chromium Win, Android, ChromeOS builds
+
+        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+        (WebCore::GraphicsLayerChromium::setContentsOpaque):
+        (WebCore::GraphicsLayerChromium::paint):
+        * platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
+        (WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
+        * platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.h:
+        (OpaqueRectTrackingContentLayerDelegate):
+
 2012-10-31  Takashi Sakamoto  <tasak@google.com>
 
         [Refactoring] Move initial style setting for ProgressValueElement from attach method to createShadowSubtree method in HTMLProgressElement.
index e486d2f..dc46dc3 100644 (file)
@@ -300,7 +300,6 @@ void GraphicsLayerChromium::setContentsOpaque(bool opaque)
 {
     GraphicsLayer::setContentsOpaque(opaque);
     m_layer->layer()->setOpaque(m_contentsOpaque);
-    m_opaqueRectTrackingContentLayerDelegate->setOpaque(m_contentsOpaque);
 }
 
 static bool copyWebCoreFilterOperationsToWebFilterOperations(const FilterOperations& filters, WebFilterOperations& webFilters)
@@ -865,6 +864,7 @@ bool GraphicsLayerChromium::appliesPageScale() const
 
 void GraphicsLayerChromium::paint(GraphicsContext& context, const IntRect& clip)
 {
+    context.platformContext()->setDrawingToImageBuffer(true);
     paintGraphicsLayerContents(context, clip);
 }
 
index 62edced..a06ac66 100644 (file)
@@ -49,7 +49,7 @@ OpaqueRectTrackingContentLayerDelegate::~OpaqueRectTrackingContentLayerDelegate(
 {
 }
 
-void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque)
+void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, const WebRect& clip, WebFloatRect& opaque)
 {
     PlatformContextSkia platformContext(canvas);
 #if defined(SK_SUPPORT_HINTING_SCALE_FACTOR)
@@ -57,10 +57,6 @@ void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, con
         platformContext.setHintingScaleFactor(canvas->getTotalMatrix().getScaleX());
 #endif
     platformContext.setTrackOpaqueRegion(!m_opaque);
-    // FIXME: Rename PlatformContextSkia::setDrawingToImageBuffer to setCanPaintLCDText.
-    // I also suspect that a function on PlatformContextSkia is not really needed.
-    // GraphicsContext::setAllowsFontSmoothing can be used for this purpose.
-    platformContext.setDrawingToImageBuffer(!(canPaintLCDText && m_opaque));
     GraphicsContext context(&platformContext);
 
     // Record transform prior to painting, as all opaque tracking will be
index 451b647..bb5c2ae 100644 (file)
@@ -55,7 +55,7 @@ public:
     void setOpaque(bool opaque) { m_opaque = opaque; }
 
     // WebKit::WebContentLayerClient implementation.
-    virtual void paintContents(SkCanvas*, const WebKit::WebRect& clip, bool canPaintLCDText, WebKit::WebFloatRect& opaque) OVERRIDE;
+    virtual void paintContents(SkCanvas*, const WebKit::WebRect& clip, WebKit::WebFloatRect& opaque) OVERRIDE;
 
 private:
     GraphicsContextPainter* m_painter;
index ff24b81..b4ba662 100644 (file)
@@ -1,3 +1,24 @@
+2012-10-31  Stephen White  <senorblanco@chromium.org>
+
+        Unreviewed, rolling out r133122.
+        http://trac.webkit.org/changeset/133122
+        https://bugs.webkit.org/show_bug.cgi?id=99083
+
+        Broke Chromium Win, Android, ChromeOS builds
+
+        * src/LinkHighlight.cpp:
+        (WebKit::LinkHighlight::paintContents):
+        * src/LinkHighlight.h:
+        (LinkHighlight):
+        * src/NonCompositedContentHost.cpp:
+        (WebKit::NonCompositedContentHost::NonCompositedContentHost):
+        (WebKit::NonCompositedContentHost::setOpaque):
+        (WebKit::NonCompositedContentHost::paintContents):
+        * src/NonCompositedContentHost.h:
+        (NonCompositedContentHost):
+        * tests/OpaqueRectTrackingContentLayerDelegateTest.cpp:
+        (WebCore::TEST_F):
+
 2012-10-31  Alok Priyadarshi  <alokp@chromium.org>
 
         [chromium] Pass canPaintLCDText to WebContentLayerClient::paintContents
index 57cf6cf..56ca8ab 100644 (file)
@@ -226,7 +226,7 @@ bool LinkHighlight::computeHighlightLayerPathAndPosition(RenderLayer* compositin
     return pathHasChanged;
 }
 
-void LinkHighlight::paintContents(WebCanvas* canvas, const WebRect& webClipRect, bool, WebFloatRect&)
+void LinkHighlight::paintContents(WebCanvas* canvas, const WebRect& webClipRect, WebFloatRect&)
 {
     if (!m_node || !m_node->renderer())
         return;
index 06d8c90..c51f635 100644 (file)
@@ -58,7 +58,7 @@ public:
     void updateGeometry();
 
     // WebContentLayerClient implementation.
-    virtual void paintContents(WebCanvas*, const WebRect& clipRect, bool canPaintLCDText, WebFloatRect& opaque) OVERRIDE;
+    virtual void paintContents(WebCanvas*, const WebRect& clipRect, WebFloatRect& opaque) OVERRIDE;
 
     // WebAnimationDelegate implementation.
     virtual void notifyAnimationStarted(double time) OVERRIDE;
index 6921368..21b9725 100644 (file)
@@ -41,6 +41,7 @@ namespace WebKit {
 
 NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView)
     : m_webView(webView)
+    , m_opaque(true)
     , m_showDebugBorders(false)
 {
     m_graphicsLayer = WebCore::GraphicsLayer::create(0, this);
@@ -49,10 +50,9 @@ NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView)
 #endif
     m_graphicsLayer->setDrawsContent(true);
     m_graphicsLayer->setAppliesPageScale(!m_webView->page()->settings()->applyPageScaleFactorInCompositor());
-    m_graphicsLayer->setContentsOpaque(true);
-    // FIXME: Remove LCD text setting after it is implemented in chromium.
     WebContentLayer* layer = static_cast<WebCore::GraphicsLayerChromium*>(m_graphicsLayer.get())->contentLayer();
     layer->setUseLCDText(true);
+    layer->layer()->setOpaque(true);
 #if !OS(ANDROID)
     layer->setDrawCheckerboardForMissingTiles(true);
 #endif
@@ -69,7 +69,8 @@ void NonCompositedContentHost::setBackgroundColor(const WebCore::Color& color)
 
 void NonCompositedContentHost::setOpaque(bool opaque)
 {
-    m_graphicsLayer->setContentsOpaque(opaque);
+    m_opaque = opaque;
+    m_graphicsLayer->platformLayer()->setOpaque(opaque);
 }
 
 void NonCompositedContentHost::setScrollLayer(WebCore::GraphicsLayer* layer)
@@ -172,11 +173,10 @@ void NonCompositedContentHost::notifyFlushRequired(const WebCore::GraphicsLayer*
 
 void NonCompositedContentHost::paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext& context, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect)
 {
-    // FIXME: Remove LCD text setting after it is implemented in chromium.
     // On non-android platforms, we want to render text with subpixel antialiasing on the root layer
     // so long as the root is opaque. On android all text is grayscale.
 #if !OS(ANDROID)
-    if (m_graphicsLayer->contentsOpaque())
+    if (m_opaque)
         context.platformContext()->setDrawingToImageBuffer(false);
 #endif
     context.translate(-m_layerAdjust);
index bd3a528..08e9c69 100644 (file)
@@ -82,6 +82,7 @@ private:
     WebCore::IntSize m_viewportSize;
     WebCore::IntSize m_layerAdjust;
 
+    bool m_opaque;
     bool m_showDebugBorders;
 };
 
index 39e36a9..0cf8249 100644 (file)
@@ -145,7 +145,7 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testOpaqueRectPresentAfterOpa
     OpaqueRectTrackingContentLayerDelegate delegate(&painter);
 
     WebFloatRect opaqueRect;
-    delegate.paintContents(skCanvas(), canvasRect(), false, opaqueRect);
+    delegate.paintContents(skCanvas(), canvasRect(), opaqueRect);
     EXPECT_EQ_RECT(WebFloatRect(0, 0, 400, 400), opaqueRect);
 }
 
@@ -156,7 +156,7 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testOpaqueRectNotPresentAfter
     OpaqueRectTrackingContentLayerDelegate delegate(&painter);
 
     WebFloatRect opaqueRect;
-    delegate.paintContents(skCanvas(), canvasRect(), false, opaqueRect);
+    delegate.paintContents(skCanvas(), canvasRect(), opaqueRect);
     EXPECT_EQ_RECT(WebFloatRect(0, 0, 0, 0), opaqueRect);
 }
 
@@ -169,7 +169,7 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testOpaqueRectNotPresentForOp
     delegate.setOpaque(true);
 
     WebFloatRect opaqueRect;
-    delegate.paintContents(skCanvas(), canvasRect(), false, opaqueRect);
+    delegate.paintContents(skCanvas(), canvasRect(), opaqueRect);
     EXPECT_EQ_RECT(WebFloatRect(0, 0, 0, 0), opaqueRect);
 }
 
@@ -182,7 +182,7 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testOpaqueRectNotPresentForOp
     delegate.setOpaque(true);
 
     WebFloatRect opaqueRect;
-    delegate.paintContents(skCanvas(), canvasRect(), false, opaqueRect);
+    delegate.paintContents(skCanvas(), canvasRect(), opaqueRect);
     EXPECT_EQ_RECT(WebFloatRect(0, 0, 0, 0), opaqueRect);
 }
 
@@ -194,7 +194,7 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testPartialOpaqueRectNoTransf
     OpaqueRectTrackingContentLayerDelegate delegate(&painter);
 
     WebFloatRect opaqueRect;
-    delegate.paintContents(skCanvas(), canvasRect(), false, opaqueRect);
+    delegate.paintContents(skCanvas(), canvasRect(), opaqueRect);
     EXPECT_EQ_RECT(WebFloatRect(partialRect.x(), partialRect.y(), partialRect.width(), partialRect.height()), opaqueRect);
 }
 
@@ -207,7 +207,7 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testPartialOpaqueRectTranslat
 
     WebFloatRect opaqueRect;
     WebRect contentRect(11, 12, 389, 388);
-    delegate.paintContents(skCanvas(), contentRect, false, opaqueRect);
+    delegate.paintContents(skCanvas(), contentRect, opaqueRect);
     EXPECT_EQ_RECT(WebFloatRect(partialRect.x(), partialRect.y(), partialRect.width(), partialRect.height()), opaqueRect);
 }
 
@@ -225,7 +225,7 @@ TEST_F(OpaqueRectTrackingContentLayerDelegateTest, testHintingScaleFactorSet)
 
     IntRect rectA;
     WebFloatRect rectB;
-    delegate.paintContents(&canvas, rectA, false, rectB);
+    delegate.paintContents(&canvas, rectA, rectB);
     EXPECT_EQ(callback.hintingScale, hintingScale);
 }
 #endif