Unreviewed, rolling out r93329.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 21:00:56 +0000 (21:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 21:00:56 +0000 (21:00 +0000)
http://trac.webkit.org/changeset/93329
https://bugs.webkit.org/show_bug.cgi?id=66497

Turned text on chromium win blue (Requested by jamesr_ on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-08-18

Source/WebCore:

* WebCore.gypi:
* platform/graphics/chromium/ContentLayerChromium.cpp:
* platform/graphics/chromium/ContentLayerChromium.h:
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerTextureUpdater::prepareToUpdate):
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::pushPropertiesTo):
(WebCore::LayerChromium::dumpLayerProperties):
* platform/graphics/chromium/LayerChromium.h:
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::initialize):
(WebCore::LayerRendererChromium::releaseTextures):
(WebCore::LayerRendererChromium::updateRootLayerContents):
(WebCore::LayerRendererChromium::drawRootLayer):
(WebCore::LayerRendererChromium::invalidateRootLayerRect):
(WebCore::LayerRendererChromium::rootLayerChanged):
(WebCore::LayerRendererChromium::viewportChanged):
(WebCore::LayerRendererChromium::updateLayers):
(WebCore::LayerRendererChromium::drawLayers):
(WebCore::LayerRendererChromium::paintLayerContents):
(WebCore::LayerRendererChromium::drawLayersInternal):
(WebCore::LayerRendererChromium::getFramebufferPixels):
(WebCore::LayerRendererChromium::cleanupSharedObjects):
(WebCore::LayerRendererChromium::layerTreeAsText):
(WebCore::LayerRendererChromium::dumpRenderSurfaces):
* platform/graphics/chromium/LayerRendererChromium.h:
(WebCore::LayerRendererChromium::rootLayer):
* platform/graphics/chromium/NonCompositedContentHost.cpp: Removed.
* platform/graphics/chromium/NonCompositedContentHost.h: Removed.
* platform/graphics/chromium/RenderSurfaceChromium.cpp:
(WebCore::RenderSurfaceChromium::dumpSurface):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::createTilerIfNeeded):
(WebCore::TiledLayerChromium::tilingTransform):
* platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
(WebCore::CCHeadsUpDisplay::draw):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerImpl.h:
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::initialize):
(WebCore::CCLayerTreeHost::createRootLayerPainter):
(WebCore::CCLayerTreeHost::invalidateRootLayerRect):
(WebCore::CCLayerTreeHost::setRootLayer):
(WebCore::CCLayerTreeHost::setViewport):
(WebCore::CCLayerTreeHost::reallocateRenderer):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCLayerTreeHost::rootLayer):
(WebCore::CCLayerTreeHost::viewportContentRect):
(WebCore::CCLayerTreeHost::viewportScrollPosition):
(WebCore::CCLayerTreeHost::viewportVisibleRect):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(WebCore::CCTiledLayerImpl::draw):

Source/WebKit/chromium:

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::paint):
(WebKit::WebViewImpl::setRootGraphicsLayer):
(WebKit::WebViewImpl::setRootPlatformLayer):
(WebKit::WebViewImpl::didRecreateGraphicsContext):
(WebKit::WebViewImpl::updateLayerTreeViewport):
* src/WebViewImpl.h:

LayoutTests:

* platform/chromium-gpu-linux/compositing/direct-image-compositing-expected.png:
* platform/chromium-gpu-linux/compositing/geometry/ancestor-overflow-change-expected.png:
* platform/chromium-gpu-linux/compositing/geometry/fixed-in-composited-expected.png:
* platform/chromium-gpu-linux/compositing/geometry/horizontal-scroll-composited-expected.png:
* platform/chromium-gpu-linux/compositing/geometry/tall-page-composited-expected.png:
* platform/chromium-gpu-linux/compositing/geometry/video-fixed-scrolling-expected.png:
* platform/chromium-gpu-linux/compositing/images/direct-image-background-color-expected.png:
* platform/chromium-gpu-linux/compositing/layers-inside-overflow-scroll-expected.png:
* platform/chromium-gpu-linux/compositing/masks/masked-ancestor-expected.png:
* platform/chromium-gpu-linux/compositing/masks/simple-composited-mask-expected.png:
* platform/chromium-gpu-linux/compositing/overflow/overflow-scroll-expected.png:
* platform/chromium-gpu-linux/compositing/self-painting-layers-expected.png:
* platform/chromium-gpu-linux/compositing/webgl/webgl-background-color-expected.png:
* platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png:
* platform/chromium-gpu-linux/fast/canvas/image-object-in-canvas-expected.png:
* platform/chromium-gpu-linux/media/video-zoom-expected.png:
* platform/chromium-gpu-linux/platform/chromium/compositing/layout-width-change-expected.png:

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

40 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium-gpu-linux/compositing/direct-image-compositing-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/geometry/ancestor-overflow-change-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/geometry/fixed-in-composited-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/geometry/horizontal-scroll-composited-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/geometry/tall-page-composited-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/geometry/video-fixed-scrolling-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/images/direct-image-background-color-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/layers-inside-overflow-scroll-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/masks/masked-ancestor-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/masks/simple-composited-mask-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/overflow/overflow-scroll-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/self-painting-layers-expected.png
LayoutTests/platform/chromium-gpu-linux/compositing/webgl/webgl-background-color-expected.png
LayoutTests/platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png
LayoutTests/platform/chromium-gpu-linux/fast/canvas/image-object-in-canvas-expected.png
LayoutTests/platform/chromium-gpu-linux/media/video-zoom-expected.png
LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/layout-width-change-expected.png
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h
Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.cpp [deleted file]
Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.h [deleted file]
Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h

index e9d01eb..073043f 100644 (file)
@@ -1,3 +1,30 @@
+2011-08-18  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r93329.
+        http://trac.webkit.org/changeset/93329
+        https://bugs.webkit.org/show_bug.cgi?id=66497
+
+        Turned text on chromium win blue (Requested by jamesr_ on
+        #webkit).
+
+        * platform/chromium-gpu-linux/compositing/direct-image-compositing-expected.png:
+        * platform/chromium-gpu-linux/compositing/geometry/ancestor-overflow-change-expected.png:
+        * platform/chromium-gpu-linux/compositing/geometry/fixed-in-composited-expected.png:
+        * platform/chromium-gpu-linux/compositing/geometry/horizontal-scroll-composited-expected.png:
+        * platform/chromium-gpu-linux/compositing/geometry/tall-page-composited-expected.png:
+        * platform/chromium-gpu-linux/compositing/geometry/video-fixed-scrolling-expected.png:
+        * platform/chromium-gpu-linux/compositing/images/direct-image-background-color-expected.png:
+        * platform/chromium-gpu-linux/compositing/layers-inside-overflow-scroll-expected.png:
+        * platform/chromium-gpu-linux/compositing/masks/masked-ancestor-expected.png:
+        * platform/chromium-gpu-linux/compositing/masks/simple-composited-mask-expected.png:
+        * platform/chromium-gpu-linux/compositing/overflow/overflow-scroll-expected.png:
+        * platform/chromium-gpu-linux/compositing/self-painting-layers-expected.png:
+        * platform/chromium-gpu-linux/compositing/webgl/webgl-background-color-expected.png:
+        * platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png:
+        * platform/chromium-gpu-linux/fast/canvas/image-object-in-canvas-expected.png:
+        * platform/chromium-gpu-linux/media/video-zoom-expected.png:
+        * platform/chromium-gpu-linux/platform/chromium/compositing/layout-width-change-expected.png:
+
 2011-08-18  Ryosuke Niwa  <rniwa@webkit.org>
 
         Skip tests added by r93291 on GTK because GTK's DRT doesn't support textInputController.doCommand yet,
index 8ab7880..f502cc3 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/direct-image-compositing-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/direct-image-compositing-expected.png differ
index 0457f46..8907b24 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/ancestor-overflow-change-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/ancestor-overflow-change-expected.png differ
index a9901e1..395333f 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/fixed-in-composited-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/fixed-in-composited-expected.png differ
index a2c20ae..249ebd4 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/horizontal-scroll-composited-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/horizontal-scroll-composited-expected.png differ
index 8613751..cc6cd41 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/tall-page-composited-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/tall-page-composited-expected.png differ
index c2741fc..3006790 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/video-fixed-scrolling-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/geometry/video-fixed-scrolling-expected.png differ
index 9f4e377..18840d0 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/images/direct-image-background-color-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/images/direct-image-background-color-expected.png differ
index 6c9317a..055807a 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/layers-inside-overflow-scroll-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/layers-inside-overflow-scroll-expected.png differ
index 811faa5..3517d49 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/masks/masked-ancestor-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/masks/masked-ancestor-expected.png differ
index 3e65645..dda4932 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/masks/simple-composited-mask-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/masks/simple-composited-mask-expected.png differ
index 638e919..a9d281c 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/overflow/overflow-scroll-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/overflow/overflow-scroll-expected.png differ
index 796326d..e6dfe6d 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/self-painting-layers-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/self-painting-layers-expected.png differ
index 308a0f6..8016f36 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/compositing/webgl/webgl-background-color-expected.png and b/LayoutTests/platform/chromium-gpu-linux/compositing/webgl/webgl-background-color-expected.png differ
index 7198f12..854a99a 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png and b/LayoutTests/platform/chromium-gpu-linux/fast/canvas/canvas-text-alignment-expected.png differ
index f4ad86e..10f7d41 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/fast/canvas/image-object-in-canvas-expected.png and b/LayoutTests/platform/chromium-gpu-linux/fast/canvas/image-object-in-canvas-expected.png differ
index 6d771f0..fe8cc80 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/media/video-zoom-expected.png and b/LayoutTests/platform/chromium-gpu-linux/media/video-zoom-expected.png differ
index d3c0f6f..91492e1 100644 (file)
Binary files a/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/layout-width-change-expected.png and b/LayoutTests/platform/chromium-gpu-linux/platform/chromium/compositing/layout-width-change-expected.png differ
index 598db8d..b9f54d3 100644 (file)
@@ -1,3 +1,68 @@
+2011-08-18  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r93329.
+        http://trac.webkit.org/changeset/93329
+        https://bugs.webkit.org/show_bug.cgi?id=66497
+
+        Turned text on chromium win blue (Requested by jamesr_ on
+        #webkit).
+
+        * WebCore.gypi:
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        * platform/graphics/chromium/ContentLayerChromium.h:
+        * platform/graphics/chromium/ImageLayerChromium.cpp:
+        (WebCore::ImageLayerTextureUpdater::prepareToUpdate):
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::LayerChromium::LayerChromium):
+        (WebCore::LayerChromium::pushPropertiesTo):
+        (WebCore::LayerChromium::dumpLayerProperties):
+        * platform/graphics/chromium/LayerChromium.h:
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::initialize):
+        (WebCore::LayerRendererChromium::releaseTextures):
+        (WebCore::LayerRendererChromium::updateRootLayerContents):
+        (WebCore::LayerRendererChromium::drawRootLayer):
+        (WebCore::LayerRendererChromium::invalidateRootLayerRect):
+        (WebCore::LayerRendererChromium::rootLayerChanged):
+        (WebCore::LayerRendererChromium::viewportChanged):
+        (WebCore::LayerRendererChromium::updateLayers):
+        (WebCore::LayerRendererChromium::drawLayers):
+        (WebCore::LayerRendererChromium::paintLayerContents):
+        (WebCore::LayerRendererChromium::drawLayersInternal):
+        (WebCore::LayerRendererChromium::getFramebufferPixels):
+        (WebCore::LayerRendererChromium::cleanupSharedObjects):
+        (WebCore::LayerRendererChromium::layerTreeAsText):
+        (WebCore::LayerRendererChromium::dumpRenderSurfaces):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        (WebCore::LayerRendererChromium::rootLayer):
+        * platform/graphics/chromium/NonCompositedContentHost.cpp: Removed.
+        * platform/graphics/chromium/NonCompositedContentHost.h: Removed.
+        * platform/graphics/chromium/RenderSurfaceChromium.cpp:
+        (WebCore::RenderSurfaceChromium::dumpSurface):
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::createTilerIfNeeded):
+        (WebCore::TiledLayerChromium::tilingTransform):
+        * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
+        (WebCore::CCHeadsUpDisplay::draw):
+        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+        (WebCore::CCLayerImpl::CCLayerImpl):
+        * platform/graphics/chromium/cc/CCLayerImpl.h:
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::CCLayerTreeHost):
+        (WebCore::CCLayerTreeHost::initialize):
+        (WebCore::CCLayerTreeHost::createRootLayerPainter):
+        (WebCore::CCLayerTreeHost::invalidateRootLayerRect):
+        (WebCore::CCLayerTreeHost::setRootLayer):
+        (WebCore::CCLayerTreeHost::setViewport):
+        (WebCore::CCLayerTreeHost::reallocateRenderer):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (WebCore::CCLayerTreeHost::rootLayer):
+        (WebCore::CCLayerTreeHost::viewportContentRect):
+        (WebCore::CCLayerTreeHost::viewportScrollPosition):
+        (WebCore::CCLayerTreeHost::viewportVisibleRect):
+        * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
+        (WebCore::CCTiledLayerImpl::draw):
+
 2011-08-18  Ryosuke Niwa  <rniwa@webkit.org>
 
         SimplifiedBackwardsTextIterator returns incorrect offset with first-letter rule
index 00fc3a9..5201d59 100644 (file)
             'platform/graphics/chromium/LayerTextureUpdaterCanvas.h',
             'platform/graphics/chromium/LayerTilerChromium.cpp',
             'platform/graphics/chromium/LayerTilerChromium.h',
-            'platform/graphics/chromium/NonCompositedContentHost.cpp',
-            'platform/graphics/chromium/NonCompositedContentHost.h',
             'platform/graphics/chromium/MediaPlayerPrivateChromium.h',
             'platform/graphics/chromium/PlatformCanvas.cpp',
             'platform/graphics/chromium/PlatformCanvas.h',
index d63ea14..b067971 100644 (file)
@@ -131,10 +131,5 @@ void ContentLayerChromium::createTextureUpdaterIfNeeded()
     m_textureUpdater = LayerTextureUpdaterBitmap::create(layerRendererContext(), ContentLayerPainter::create(m_owner), layerRenderer()->contextSupportsMapSub());
 }
 
-void ContentLayerChromium::protectVisibleTileTextures()
-{
-    m_tiler->protectTileTextures(IntRect(IntPoint::zero(), contentBounds()));
-}
-
 }
 #endif // USE(ACCELERATED_COMPOSITING)
index c9fd0d8..a0e96c3 100644 (file)
@@ -60,7 +60,6 @@ private:
     virtual bool drawsContent() const;
     virtual void createTextureUpdaterIfNeeded();
     virtual LayerTextureUpdater* textureUpdater() const { return m_textureUpdater.get(); }
-    virtual void protectVisibleTileTextures();
 
     OwnPtr<LayerTextureUpdater> m_textureUpdater;
 };
index 6e7a93c..2a7715e 100644 (file)
@@ -62,7 +62,7 @@ public:
                 LayerTextureUpdater::SampledTexelFormatRGBA : LayerTextureUpdater::SampledTexelFormatBGRA;
     }
 
-    virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, int /* borderTexels */)
+    virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tileSize, int borderTexels)
     {
         m_texSubImage.setSubImageSize(tileSize);
     }
index 8e3e178..ba713eb 100644 (file)
@@ -75,7 +75,6 @@ LayerChromium::LayerChromium(GraphicsLayerChromium* owner)
     , m_needsDisplayOnBoundsChange(false)
     , m_doubleSided(true)
     , m_usesLayerScissor(false)
-    , m_isRootLayer(false)
     , m_replicaLayer(0)
     , m_drawOpacity(0)
     , m_targetRenderSurface(0)
@@ -297,14 +296,12 @@ void LayerChromium::pushPropertiesTo(CCLayerImpl* layer)
     layer->setDebugBorderWidth(m_debugBorderWidth);
     layer->setDoubleSided(m_doubleSided);
     layer->setDrawsContent(drawsContent());
-    layer->setIsRootLayer(m_isRootLayer);
     layer->setLayerRenderer(m_layerRenderer.get());
     layer->setMasksToBounds(m_masksToBounds);
     layer->setName(m_name);
     layer->setOpacity(m_opacity);
     layer->setPosition(m_position);
     layer->setPreserves3D(preserves3D());
-    layer->setScrollPosition(m_scrollPosition);
     layer->setSublayerTransform(m_sublayerTransform);
     layer->setTransform(m_transform);
     layer->setVisibleLayerRect(m_visibleLayerRect);
@@ -378,10 +375,7 @@ void LayerChromium::dumpLayer(TextStream& ts, int indent) const
 void LayerChromium::dumpLayerProperties(TextStream& ts, int indent) const
 {
     writeIndent(ts, indent);
-    ts << "id: " << id() << " drawsContent: " << drawsContent() << " bounds " << m_bounds.width() << "x" << m_bounds.height() << " usesLayerScissor: " << usesLayerScissor()
-        << " scissorRect: (" << m_scissorRect.x() << ", " << m_scissorRect.y() << ", " << m_scissorRect.width() << ", " << m_scissorRect.height() << ")"
-        << " visibleLayerRect: (" << m_visibleLayerRect.x() << ", " << m_visibleLayerRect.y() << ", " << m_visibleLayerRect.width() << ", " << m_visibleLayerRect.height() << ")"
-        << "\n";
+    ts << "id: " << id() << " drawsContent: " << drawsContent() << " bounds " << m_bounds.width() << "x" << m_bounds.height() << "\n";
 
 }
 
index 2525eed..ca2b641 100644 (file)
@@ -135,9 +135,6 @@ public:
     const IntRect& visibleLayerRect() const { return m_visibleLayerRect; }
     void setVisibleLayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }
 
-    const IntPoint& scrollPosition() const { return m_scrollPosition; }
-    void setScrollPosition(const IntPoint& scrollPosition) { m_scrollPosition = scrollPosition; }
-
     bool doubleSided() const { return m_doubleSided; }
     void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }
 
@@ -150,9 +147,6 @@ public:
     void setUsesLayerScissor(bool usesLayerScissor) { m_usesLayerScissor = usesLayerScissor; }
     bool usesLayerScissor() const { return m_usesLayerScissor; }
 
-    void setIsRootLayer(bool isRootLayer) { m_isRootLayer = isRootLayer; }
-    bool isRootLayer() const { return m_isRootLayer; }
-
     // Derived types must override this method if they need to react to a change
     // in the LayerRendererChromium.
     // FIXME, replace with CCLayerTreeHost.
@@ -170,7 +164,6 @@ public:
     virtual void setIsMask(bool) {}
     virtual void unreserveContentsTexture() { }
     virtual void bindContentsTexture() { }
-    virtual void protectVisibleTileTextures() { }
 
     // These exists just for debugging (via drawDebugBorder()).
     void setBorderColor(const Color&);
@@ -265,7 +258,6 @@ private:
     // Layer properties.
     IntSize m_bounds;
     IntRect m_visibleLayerRect;
-    IntPoint m_scrollPosition;
     FloatPoint m_position;
     FloatPoint m_anchorPoint;
     Color m_backgroundColor;
@@ -282,7 +274,6 @@ private:
     bool m_needsDisplayOnBoundsChange;
     bool m_doubleSided;
     bool m_usesLayerScissor;
-    bool m_isRootLayer;
 
     TransformationMatrix m_transform;
     TransformationMatrix m_sublayerTransform;
index 9044997..b7c52bc 100644 (file)
@@ -43,7 +43,6 @@
 #include "LayerPainterChromium.h"
 #include "ManagedTexture.h"
 #include "LayerTextureUpdaterCanvas.h"
-#include "NonCompositedContentHost.h"
 #include "NotImplemented.h"
 #include "RenderSurfaceChromium.h"
 #include "TextStream.h"
@@ -463,6 +462,14 @@ LayerRendererChromium::LayerRendererChromium(CCLayerTreeHost* owner,
 
 bool LayerRendererChromium::initialize()
 {
+    WebCore::Extensions3D* extensions = m_context->getExtensions();
+    m_contextSupportsMapSub = extensions->supports("GL_CHROMIUM_map_sub");
+    if (m_contextSupportsMapSub)
+        extensions->ensureEnabled("GL_CHROMIUM_map_sub");
+
+    if (!initializeSharedObjects())
+        return false;
+
 #if USE(SKIA)
     if (settings().acceleratePainting) {
         m_context->makeContextCurrent();
@@ -472,16 +479,14 @@ bool LayerRendererChromium::initialize()
         // Limit the bytes allocated toward textures in the bitmap->texture cache.
         static const size_t maxTextureCacheBytes = 50 * 1024 * 1024;
         m_skiaContext->setTextureCacheLimits(maxTextureCacheCount, maxTextureCacheBytes);
+        m_rootLayerTextureUpdater = LayerTextureUpdaterSkPicture::create(m_context.get(), m_owner->createRootLayerPainter(), skiaContext());
     }
+    else
 #endif
+        m_rootLayerTextureUpdater = LayerTextureUpdaterBitmap::create(m_context.get(), m_owner->createRootLayerPainter(), m_contextSupportsMapSub);
 
-    WebCore::Extensions3D* extensions = m_context->getExtensions();
-    m_contextSupportsMapSub = extensions->supports("GL_CHROMIUM_map_sub");
-    if (m_contextSupportsMapSub)
-        extensions->ensureEnabled("GL_CHROMIUM_map_sub");
-
-    if (!initializeSharedObjects())
-        return false;
+    m_rootLayerContentTiler = LayerTilerChromium::create(this, IntSize(256, 256), LayerTilerChromium::NoBorderTexels);
+    ASSERT(m_rootLayerContentTiler);
 
     m_headsUpDisplay = CCHeadsUpDisplay::create(this);
 
@@ -512,7 +517,7 @@ void LayerRendererChromium::releaseTextures()
 {
     // Reduces texture memory usage to textureMemoryLowLimitBytes by deleting non root layer
     // textures.
-    m_owner->nonCompositedContentHost()->protectVisibleTileTextures();
+    m_rootLayerContentTiler->protectTileTextures(m_owner->viewportVisibleRect());
     m_contentsTextureManager->reduceMemoryToLimit(textureMemoryLowLimitBytes);
     m_contentsTextureManager->unprotectAllTextures();
     m_contentsTextureManager->deleteEvictedTextures(m_context.get());
@@ -522,10 +527,35 @@ void LayerRendererChromium::releaseTextures()
     m_renderSurfaceTextureManager->deleteEvictedTextures(m_context.get());
 }
 
+void LayerRendererChromium::updateRootLayerContents()
+{
+    TRACE_EVENT("LayerRendererChromium::updateRootLayerContents", this, 0);
+    m_rootLayerContentTiler->prepareToUpdate(m_owner->viewportVisibleRect(), m_rootLayerTextureUpdater.get());
+}
+
+void LayerRendererChromium::drawRootLayer()
+{
+    TransformationMatrix scroll;
+    scroll.translate(-m_owner->viewportVisibleRect().x(), -m_owner->viewportVisibleRect().y());
+
+    m_rootLayerContentTiler->draw(m_owner->viewportVisibleRect(), scroll, 1.0f);
+}
+
+void LayerRendererChromium::invalidateRootLayerRect(const IntRect& dirtyRect)
+{
+    m_rootLayerContentTiler->invalidateRect(dirtyRect);
+}
+
+void LayerRendererChromium::rootLayerChanged()
+{
+    m_rootLayerContentTiler->invalidateEntireLayer();
+}
+
 void LayerRendererChromium::viewportChanged()
 {
     if (m_context)
-        m_context->reshape(std::max(1, viewportWidth()), std::max(1, viewportHeight()));
+        m_context->reshape(std::max(1, m_owner->viewportVisibleRect().width()), std::max(1, m_owner->viewportVisibleRect().height()));
+    m_rootLayerContentTiler->invalidateEntireLayer();
 
     // Reset the current render surface to force an update of the viewport and
     // projection matrix next time useRenderSurface is called.
@@ -534,7 +564,7 @@ void LayerRendererChromium::viewportChanged()
 
 void LayerRendererChromium::updateLayers()
 {
-    if (m_owner->viewportSize().isEmpty())
+    if (m_owner->viewportVisibleRect().isEmpty())
         return;
 
     // FIXME: use the frame begin time from the overall compositor scheduler.
@@ -542,6 +572,11 @@ void LayerRendererChromium::updateLayers()
     // RenderWidget.
     m_headsUpDisplay->onFrameBegin(currentTime());
 
+    if (!rootLayer())
+        return;
+
+    updateRootLayerContents();
+
     // Recheck that we still have a root layer. This may become null if
     // compositing gets turned off during a paint operation.
     if (!rootLayer()) {
@@ -549,7 +584,7 @@ void LayerRendererChromium::updateLayers()
         return;
     }
 
-    updateLayers(rootLayer()->platformLayer());
+    updateLayers(rootLayer());
 }
 
 void LayerRendererChromium::drawLayers()
@@ -565,7 +600,7 @@ void LayerRendererChromium::drawLayers()
 
     {
         TRACE_EVENT("LayerRendererChromium::synchronizeTrees", this, 0);
-        m_rootCCLayerImpl = TreeSynchronizer::synchronizeTrees(rootLayer()->platformLayer(), m_rootCCLayerImpl.get());
+        m_rootCCLayerImpl = TreeSynchronizer::synchronizeTrees(rootLayer(), m_rootCCLayerImpl.get());
     }
 
 
@@ -590,9 +625,11 @@ void LayerRendererChromium::updateLayers(LayerChromium* rootLayer)
 
     if (!rootLayer->renderSurface())
         rootLayer->createRenderSurface();
-    rootLayer->renderSurface()->setContentRect(IntRect(IntPoint(0, 0), viewportSize()));
+    rootLayer->renderSurface()->setContentRect(IntRect(IntPoint(0, 0), m_owner->viewportVisibleRect().size()));
 
-    IntRect rootScissorRect(IntPoint(), viewportSize());
+    IntRect rootScissorRect(m_owner->viewportVisibleRect());
+    // The scissorRect should not include the scroll offset.
+    rootScissorRect.move(-m_owner->viewportScrollPosition().x(), -m_owner->viewportScrollPosition().y());
     rootLayer->setScissorRect(rootScissorRect);
 
     LayerList renderSurfaceLayerList;
@@ -615,6 +652,11 @@ void LayerRendererChromium::updateLayers(LayerChromium* rootLayer)
 #ifndef NDEBUG
     s_inPaintLayerContents = false;
 #endif
+    // Update compositor resources for root layer.
+    {
+        TRACE_EVENT("LayerRendererChromium::updateLayer::updateRoot", this, 0);
+        m_rootLayerContentTiler->updateRect(m_rootLayerTextureUpdater.get());
+    }
 
     m_contentsTextureManager->reduceMemoryToLimit(textureMemoryReclaimLimitBytes);
     m_contentsTextureManager->deleteEvictedTextures(m_context.get());
@@ -695,7 +737,6 @@ void LayerRendererChromium::paintLayerContents(const LayerList& renderSurfaceLay
                 targetSurfaceRect.intersect(layer->scissorRect());
             IntRect visibleLayerRect = calculateVisibleLayerRect(targetSurfaceRect, layer->bounds(), layer->contentBounds(), layer->drawTransform());
 
-            visibleLayerRect.move(toSize(layer->scrollPosition()));
             paintContentsIfDirty(layer, visibleLayerRect);
 
             if (LayerChromium* maskLayer = layer->maskLayer()) {
@@ -715,7 +756,7 @@ void LayerRendererChromium::paintLayerContents(const LayerList& renderSurfaceLay
 
 void LayerRendererChromium::drawLayersInternal()
 {
-    if (viewportSize().isEmpty() || !rootLayer())
+    if (m_owner->viewportVisibleRect().isEmpty() || !rootLayer())
         return;
 
     TRACE_EVENT("LayerRendererChromium::drawLayers", this, 0);
@@ -724,9 +765,12 @@ void LayerRendererChromium::drawLayersInternal()
 
     if (!rootDrawLayer->renderSurface())
         rootDrawLayer->createRenderSurface();
-    rootDrawLayer->renderSurface()->setContentRect(IntRect(IntPoint(), viewportSize()));
+    rootDrawLayer->renderSurface()->setContentRect(IntRect(IntPoint(0, 0), m_owner->viewportVisibleRect().size()));
 
-    rootDrawLayer->setScissorRect(IntRect(IntPoint(), viewportSize()));
+    IntRect rootScissorRect(m_owner->viewportVisibleRect());
+    // The scissorRect should not include the scroll offset.
+    rootScissorRect.move(-m_owner->viewportScrollPosition().x(), -m_owner->viewportScrollPosition().y());
+    rootDrawLayer->setScissorRect(rootScissorRect);
 
     CCLayerList renderSurfaceLayerList;
     renderSurfaceLayerList.append(rootDrawLayer);
@@ -741,8 +785,8 @@ void LayerRendererChromium::drawLayersInternal()
     }
 
     // The GL viewport covers the entire visible area, including the scrollbars.
-    GLC(m_context.get(), m_context->viewport(0, 0, viewportWidth(), viewportHeight()));
-    m_windowMatrix = screenMatrix(0, 0, viewportWidth(), viewportHeight());
+    GLC(m_context.get(), m_context->viewport(0, 0, m_owner->viewportVisibleRect().width(), m_owner->viewportVisibleRect().height()));
+    m_windowMatrix = screenMatrix(0, 0, m_owner->viewportVisibleRect().width(), m_owner->viewportVisibleRect().height());
 
     // Bind the common vertex attributes used for drawing all the layers.
     m_sharedGeometry->prepareForDraw();
@@ -760,6 +804,14 @@ void LayerRendererChromium::drawLayersInternal()
     m_context->clearColor(0, 0, 1, 1);
     m_context->colorMask(true, true, true, true);
     m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
+    // Mask out writes to alpha channel: subpixel antialiasing via Skia results in invalid
+    // zero alpha values on text glyphs. The root layer is always opaque.
+    m_context->colorMask(true, true, true, false);
+
+    drawRootLayer();
+
+    // Re-enable color writes to layers, which may be partially transparent.
+    m_context->colorMask(true, true, true, true);
 
     GLC(m_context.get(), m_context->enable(GraphicsContext3D::BLEND));
     GLC(m_context.get(), m_context->blendFunc(GraphicsContext3D::ONE, GraphicsContext3D::ONE_MINUS_SRC_ALPHA));
@@ -846,7 +898,7 @@ void LayerRendererChromium::setLayerRendererRecursive(LayerChromium* layer)
 
 void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& rect)
 {
-    ASSERT(rect.maxX() <= viewportWidth() && rect.maxY() <= viewportHeight());
+    ASSERT(rect.maxX() <= m_owner->viewportVisibleRect().width() && rect.maxY() <= m_owner->viewportVisibleRect().height());
 
     if (!pixels)
         return;
@@ -1272,6 +1324,8 @@ void LayerRendererChromium::cleanupSharedObjects()
         GLC(m_context.get(), m_context->deleteFramebuffer(m_offscreenFramebufferId));
 
     // Clear tilers before the texture manager, as they have references to textures.
+    m_rootLayerContentTiler.clear();
+
     m_contentsTextureManager.clear();
     m_renderSurfaceTextureManager.clear();
 }
@@ -1280,23 +1334,13 @@ String LayerRendererChromium::layerTreeAsText() const
 {
     TextStream ts;
     if (rootLayer()) {
-        ts << rootLayer()->platformLayer()->layerTreeAsText();
+        ts << rootLayer()->layerTreeAsText();
         ts << "RenderSurfaces:\n";
-        dumpRenderSurfaces(ts, 1, rootLayer()->platformLayer());
+        dumpRenderSurfaces(ts, 1, rootLayer());
     }
     return ts.release();
 }
 
-void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, const LayerChromium* layer) const
-{
-    if (layer->renderSurface())
-        layer->renderSurface()->dumpSurface(ts, indent);
-
-    for (size_t i = 0; i < layer->children().size(); ++i)
-        dumpRenderSurfaces(ts, indent, layer->children()[i].get());
-}
-
-
 void LayerRendererChromium::addChildContext(GraphicsContext3D* ctx)
 {
     // This is a ref-counting map, because some contexts are shared by multiple
@@ -1338,6 +1382,15 @@ bool LayerRendererChromium::isCompositorContextLost()
     return (m_context.get()->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR);
 }
 
+void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, const LayerChromium* layer) const
+{
+    if (layer->renderSurface())
+        layer->renderSurface()->dumpSurface(ts, indent);
+
+    for (size_t i = 0; i < layer->children().size(); ++i)
+        dumpRenderSurfaces(ts, indent, layer->children()[i].get());
+}
+
 } // namespace WebCore
 
 #endif // USE(ACCELERATED_COMPOSITING)
index 417f822..fa70cf6 100644 (file)
@@ -68,7 +68,6 @@ class CCLayerTreeHostCommitter;
 class CCLayerTreeHostImpl;
 class GeometryBinding;
 class GraphicsContext3D;
-class NonCompositedContentHost;
 
 // Class that handles drawing of composited render layers using GL.
 class LayerRendererChromium : public RefCounted<LayerRendererChromium> {
@@ -82,8 +81,8 @@ public:
     CCLayerTreeHost* owner() { return m_owner; }
     const CCLayerTreeHost* owner() const { return m_owner; }
 
-    GraphicsLayer* rootLayer() { return m_owner->rootLayer(); }
-    const GraphicsLayer* rootLayer() const { return m_owner->rootLayer(); }
+    LayerChromium* rootLayer() { return m_owner->rootLayer(); }
+    const LayerChromium* rootLayer() const { return m_owner->rootLayer(); }
 
     GraphicsContext3D* context();
     bool contextSupportsMapSub() const { return m_contextSupportsMapSub; }
@@ -92,10 +91,9 @@ public:
     GrContext* skiaContext() { return m_skiaContext.get(); }
 #endif
 
-    const IntSize& viewportSize() { return m_owner->viewportSize(); }
-    int viewportWidth() { return viewportSize().width(); }
-    int viewportHeight() { return viewportSize().height(); }
+    void invalidateRootLayerRect(const IntRect& dirtyRect);
 
+    void rootLayerChanged();
     void viewportChanged();
 
     // updates and draws the current layers onto the backbuffer
@@ -179,6 +177,7 @@ private:
     void drawLayersInternal();
     void drawLayer(CCLayerImpl*, CCRenderSurface*);
 
+    void drawRootLayer();
     ManagedTexture* getOffscreenLayerTexture();
     void copyOffscreenTextureToDisplay();
 
@@ -203,6 +202,11 @@ private:
     TransformationMatrix m_projectionMatrix;
     TransformationMatrix m_windowMatrix;
 
+    // FIXME: split the texture updater and tiler into two parts. Then, keep the
+    // impl here and put the painting-side on the LayerTreeHost.
+    OwnPtr<LayerTextureUpdater> m_rootLayerTextureUpdater;
+    OwnPtr<LayerTilerChromium> m_rootLayerContentTiler;
+
     OwnPtr<LayerList> m_computedRenderSurfaceLayerList;
 
     CCRenderSurface* m_currentRenderSurface;
diff --git a/Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.cpp b/Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.cpp
deleted file mode 100644 (file)
index 777338a..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "NonCompositedContentHost.h"
-
-#include "FloatRect.h"
-#include "GraphicsLayer.h"
-#include "LayerChromium.h"
-#include "LayerPainterChromium.h"
-
-namespace WebCore {
-
-NonCompositedContentHost::NonCompositedContentHost(PassOwnPtr<LayerPainterChromium> contentPaint)
-    : m_contentPaint(contentPaint)
-{
-    m_graphicsLayer = GraphicsLayer::create(this);
-#ifndef NDEBUG
-    m_graphicsLayer->setName("non-composited content");
-#endif
-    m_graphicsLayer->setDrawsContent(true);
-    m_graphicsLayer->platformLayer()->setIsRootLayer(true);
-}
-
-NonCompositedContentHost::~NonCompositedContentHost()
-{
-}
-
-void NonCompositedContentHost::invalidateRect(const IntRect& rect)
-{
-    m_graphicsLayer->setNeedsDisplayInRect(FloatRect(rect));
-}
-
-void NonCompositedContentHost::invalidateEntireLayer()
-{
-    m_graphicsLayer->setNeedsDisplay();
-}
-
-void NonCompositedContentHost::setScrollPosition(const IntPoint& scrollPosition)
-{
-    m_graphicsLayer->platformLayer()->setScrollPosition(scrollPosition);
-}
-
-void NonCompositedContentHost::protectVisibleTileTextures()
-{
-    m_graphicsLayer->platformLayer()->protectVisibleTileTextures();
-}
-
-void NonCompositedContentHost::notifyAnimationStarted(const GraphicsLayer*, double /* time */)
-{
-    // Intentionally left empty since we don't support animations on the non-composited content.
-}
-
-void NonCompositedContentHost::notifySyncRequired(const GraphicsLayer*)
-{
-}
-
-void NonCompositedContentHost::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& clipRect)
-{
-    m_contentPaint->paint(context, clipRect);
-}
-
-bool NonCompositedContentHost::showDebugBorders() const
-{
-    return false;
-}
-
-bool NonCompositedContentHost::showRepaintCounter() const
-{
-    return false;
-}
-
-} // namespace WebCore
-
diff --git a/Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.h b/Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.h
deleted file mode 100644 (file)
index 4673609..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef NonCompositedContentHost_h
-#define NonCompositedContentHost_h
-
-#include "GraphicsLayerClient.h"
-
-#include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-
-namespace WebCore {
-
-class GraphicsLayer;
-class GraphicsContext;
-class IntRect;
-class LayerPainterChromium;
-
-class NonCompositedContentHost : public GraphicsLayerClient {
-WTF_MAKE_NONCOPYABLE(NonCompositedContentHost);
-public:
-    static PassOwnPtr<NonCompositedContentHost> create(PassOwnPtr<LayerPainterChromium> contentPaint)
-    {
-        return adoptPtr(new NonCompositedContentHost(contentPaint));
-    }
-    virtual ~NonCompositedContentHost();
-
-    void invalidateRect(const IntRect&);
-    void invalidateEntireLayer();
-    void setScrollPosition(const IntPoint&);
-    void protectVisibleTileTextures();
-
-    GraphicsLayer* graphicsLayer() const { return m_graphicsLayer.get(); }
-
-private:
-    explicit NonCompositedContentHost(PassOwnPtr<LayerPainterChromium> contentPaint);
-
-    // GraphicsLayerClient
-    virtual void notifyAnimationStarted(const GraphicsLayer*, double time);
-    virtual void notifySyncRequired(const GraphicsLayer*);
-    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clipRect);
-    virtual bool showDebugBorders() const;
-    virtual bool showRepaintCounter() const;
-
-    OwnPtr<GraphicsLayer> m_graphicsLayer;
-    OwnPtr<LayerPainterChromium> m_contentPaint;
-};
-
-} // namespace WebCore
-
-#endif // NonCompositedContentHost_h
-
index 0061433..e9a3dfd 100644 (file)
@@ -82,9 +82,7 @@ void RenderSurfaceChromium::dumpSurface(TextStream& ts, int indent) const
     ts << name() << "\n";
 
     writeIndent(ts, indent+1);
-    ts << "contentRect: (" << m_contentRect.x() << ", " << m_contentRect.y() << ", " << m_contentRect.width() << ", " << m_contentRect.height()
-        << " scissorRect: (" << m_scissorRect.x() << ", " << m_scissorRect.y() << ", " << m_scissorRect.width() << ", " << m_scissorRect.height() << ")"
-        << "\n";
+    ts << "contentRect: (" << m_contentRect.x() << ", " << m_contentRect.y() << ", " << m_contentRect.width() << ", " << m_contentRect.height() << "\n";
 }
 
 }
index 3f4d151..b64d0f4 100644 (file)
@@ -126,7 +126,7 @@ void TiledLayerChromium::createTilerIfNeeded()
     m_tiler = LayerTilerChromium::create(
         layerRenderer(),
         IntSize(defaultTileSize, defaultTileSize),
-        isRootLayer() ? LayerTilerChromium::NoBorderTexels : LayerTilerChromium::HasBorderTexels);
+        LayerTilerChromium::HasBorderTexels);
 }
 
 void TiledLayerChromium::updateCompositorResources()
@@ -158,8 +158,6 @@ TransformationMatrix TiledLayerChromium::tilingTransform() const
     // Tiler draws with a different origin from other layers.
     transform.translate(-contentBounds().width() / 2.0, -contentBounds().height() / 2.0);
 
-    transform.translate(-scrollPosition().x(), -scrollPosition().y());
-
     return transform;
 }
 
index b256c67..a6409e2 100644 (file)
@@ -101,8 +101,8 @@ void CCHeadsUpDisplay::draw()
     // Use a fullscreen texture only if we need to...
     IntSize hudSize;
     if (settings().showPlatformLayerTree) {
-        hudSize.setWidth(min(2048, m_layerRenderer->viewportWidth()));
-        hudSize.setHeight(min(2048, m_layerRenderer->viewportHeight()));
+        hudSize.setWidth(min(2048, m_layerRenderer->owner()->viewportVisibleRect().width()));
+        hudSize.setHeight(min(2048, m_layerRenderer->owner()->viewportVisibleRect().height()));
     } else {
         hudSize.setWidth(512);
         hudSize.setHeight(128);
index 745861a..3cead4c 100644 (file)
@@ -69,7 +69,6 @@ CCLayerImpl::CCLayerImpl(int id)
     , m_opacity(1.0)
     , m_preserves3D(false)
     , m_usesLayerScissor(false)
-    , m_isRootLayer(false)
     , m_drawsContent(false)
     , m_targetRenderSurface(0)
     , m_drawDepth(0)
index f6c1da0..ffd7aa4 100644 (file)
@@ -103,9 +103,6 @@ public:
     void setUsesLayerScissor(bool usesLayerScissor) { m_usesLayerScissor = usesLayerScissor; }
     bool usesLayerScissor() const { return m_usesLayerScissor; }
 
-    void setIsRootLayer(bool isRootLayer) { m_isRootLayer = isRootLayer; }
-    bool isRootLayer() const { return m_isRootLayer; }
-
     void setSublayerTransform(const TransformationMatrix& sublayerTransform) { m_sublayerTransform = sublayerTransform; }
     const TransformationMatrix& sublayerTransform() const { return m_sublayerTransform; }
 
@@ -144,9 +141,6 @@ public:
     const IntSize& contentBounds() const { return m_contentBounds; }
     void setContentBounds(const IntSize& contentBounds) { m_contentBounds = contentBounds; }
 
-    const IntPoint& scrollPosition() const { return m_scrollPosition; }
-    void setScrollPosition(const IntPoint& scrollPosition) { m_scrollPosition = scrollPosition; }
-
     const IntRect& visibleLayerRect() const { return m_visibleLayerRect; }
     void setVisibleLayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }
 
@@ -185,7 +179,6 @@ private:
     float m_anchorPointZ;
     IntSize m_bounds;
     IntSize m_contentBounds;
-    IntPoint m_scrollPosition;
     IntRect m_visibleLayerRect;
 
     // Whether the "back" of this layer should draw.
@@ -198,7 +191,6 @@ private:
     TransformationMatrix m_sublayerTransform;
     TransformationMatrix m_transform;
     bool m_usesLayerScissor;
-    bool m_isRootLayer;
 
     bool m_drawsContent;
 
index 1f3b979..c7b5d17 100644 (file)
@@ -29,7 +29,6 @@
 #include "LayerChromium.h"
 #include "LayerPainterChromium.h"
 #include "LayerRendererChromium.h"
-#include "NonCompositedContentHost.h"
 #include "TraceEvent.h"
 #include "cc/CCLayerTreeHostCommitter.h"
 #include "cc/CCLayerTreeHostImpl.h"
@@ -49,7 +48,6 @@ CCLayerTreeHost::CCLayerTreeHost(CCLayerTreeHostClient* client, const CCSettings
     , m_animating(false)
     , m_client(client)
     , m_frameNumber(0)
-    , m_nonCompositedContentHost(NonCompositedContentHost::create(m_client->createRootLayerPainter()))
     , m_settings(settings)
 {
 }
@@ -60,15 +58,6 @@ bool CCLayerTreeHost::initialize()
     if (!m_layerRenderer)
         return false;
 
-    m_rootLayer = GraphicsLayer::create(0);
-#ifndef NDEBUG
-    m_rootLayer->setName("root layer");
-#endif
-    m_rootLayer->setDrawsContent(false);
-
-    m_rootLayer->addChild(m_nonCompositedContentHost->graphicsLayer());
-
-
 #if USE(THREADED_COMPOSITING)
     m_proxy = CCLayerTreeHostImplProxy::create(this);
     ASSERT(m_proxy->isStarted());
@@ -130,6 +119,11 @@ void CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect)
 #endif
 }
 
+PassOwnPtr<LayerPainterChromium> CCLayerTreeHost::createRootLayerPainter()
+{
+    return m_client->createRootLayerPainter();
+}
+
 void CCLayerTreeHost::finishAllRendering()
 {
 #if USE(THREADED_COMPOSITING)
@@ -141,7 +135,8 @@ void CCLayerTreeHost::finishAllRendering()
 
 void CCLayerTreeHost::invalidateRootLayerRect(const IntRect& dirtyRect)
 {
-    m_nonCompositedContentHost->invalidateRect(dirtyRect);
+    if (m_layerRenderer)
+        m_layerRenderer->invalidateRootLayerRect(dirtyRect);
 }
 
 void CCLayerTreeHost::setNeedsCommitAndRedraw()
@@ -164,30 +159,25 @@ void CCLayerTreeHost::setNeedsRedraw()
 #endif
 }
 
-void CCLayerTreeHost::setRootLayer(GraphicsLayer* layer)
+void CCLayerTreeHost::setRootLayer(LayerChromium* layer)
 {
-    m_nonCompositedContentHost->graphicsLayer()->removeAllChildren();
-    m_nonCompositedContentHost->invalidateEntireLayer();
-    if (layer) {
-        m_nonCompositedContentHost->graphicsLayer()->addChild(layer);
-        layer->platformLayer()->setLayerRenderer(m_layerRenderer.get());
-    }
-
+    m_rootLayer = layer;
+    if (m_rootLayer)
+        m_rootLayer->setLayerRenderer(m_layerRenderer.get());
+    if (m_layerRenderer)
+        m_layerRenderer->rootLayerChanged();
 }
 
-void CCLayerTreeHost::setViewport(const IntSize& viewportSize, const IntSize& contentsSize, const IntPoint& scrollPosition)
+void CCLayerTreeHost::setViewport(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition)
 {
-    bool visibleRectChanged = m_viewportSize != viewportSize;
+    bool visibleRectChanged = m_viewportVisibleRect.size() != visibleRect.size();
 
-    m_viewportSize = viewportSize;
-    m_nonCompositedContentHost->setScrollPosition(scrollPosition);
-    m_nonCompositedContentHost->graphicsLayer()->setSize(contentsSize);
+    m_viewportVisibleRect = visibleRect;
+    m_viewportContentRect = contentRect;
+    m_viewportScrollPosition = scrollPosition;
 
-    if (visibleRectChanged) {
-        m_nonCompositedContentHost->invalidateEntireLayer();
-        if (m_layerRenderer)
-            m_layerRenderer->viewportChanged();
-    }
+    if (visibleRectChanged && m_layerRenderer)
+        m_layerRenderer->viewportChanged();
 
     setNeedsCommitAndRedraw();
 }
@@ -274,7 +264,8 @@ void CCLayerTreeHost::reallocateRenderer()
         return;
     }
 
-    layerRenderer->setLayerRendererRecursive(m_rootLayer->platformLayer());
+    // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive.
+    layerRenderer->setLayerRendererRecursive(m_rootLayer.get());
     m_layerRenderer = layerRenderer;
 
     m_client->didRecreateGraphicsContext(true);
index b07a25f..0dc1478 100644 (file)
@@ -41,8 +41,6 @@ class GraphicsContext3D;
 class LayerChromium;
 class LayerPainterChromium;
 class LayerRendererChromium;
-class GraphicsLayer;
-class NonCompositedContentHost;
 
 class CCLayerTreeHostClient {
 public:
@@ -89,6 +87,8 @@ public:
 
     void compositeAndReadback(void *pixels, const IntRect&);
 
+    PassOwnPtr<LayerPainterChromium> createRootLayerPainter();
+
     void finishAllRendering();
 
     int frameNumber() const { return m_frameNumber; }
@@ -98,15 +98,17 @@ public:
     void setNeedsCommitAndRedraw();
     void setNeedsRedraw();
 
-    void setRootLayer(GraphicsLayer*);
-    GraphicsLayer* rootLayer() { return m_rootLayer.get(); }
-    const GraphicsLayer* rootLayer() const { return m_rootLayer.get(); }
+    void setRootLayer(LayerChromium*);
+    LayerChromium* rootLayer() { return m_rootLayer.get(); }
+    const LayerChromium* rootLayer() const { return m_rootLayer.get(); }
 
     const CCSettings& settings() const { return m_settings; }
 
-    void setViewport(const IntSize& viewportSize, const IntSize& contentsSize, const IntPoint& scrollPosition);
+    void setViewport(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition);
 
-    const IntSize& viewportSize() const { return m_viewportSize; }
+    const IntRect& viewportContentRect() const { return m_viewportContentRect; }
+    const IntPoint& viewportScrollPosition() const { return m_viewportScrollPosition; }
+    const IntRect& viewportVisibleRect() const { return m_viewportVisibleRect; }
 
     void setVisible(bool);
 
@@ -115,7 +117,6 @@ public:
     void composite(bool finish);
 #endif
 
-    NonCompositedContentHost* nonCompositedContentHost() const { return m_nonCompositedContentHost.get(); }
 
 protected:
     CCLayerTreeHost(CCLayerTreeHostClient*, const CCSettings&);
@@ -142,12 +143,12 @@ private:
 
     OwnPtr<CCLayerTreeHostImplProxy> m_proxy;
 
-    OwnPtr<GraphicsLayer> m_rootLayer;
-    OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost;
-
+    RefPtr<LayerChromium> m_rootLayer;
     CCSettings m_settings;
 
-    IntSize m_viewportSize;
+    IntRect m_viewportVisibleRect;
+    IntRect m_viewportContentRect;
+    IntPoint m_viewportScrollPosition;
 };
 
 }
index 637209b..398a1ce 100644 (file)
@@ -51,17 +51,8 @@ void CCTiledLayerImpl::draw()
 {
     ASSERT(CCLayerTreeHostImplProxy::isImplThread());
     const IntRect& layerRect = visibleLayerRect();
-    if (!layerRect.isEmpty()) {
-        GraphicsContext3D* context = layerRenderer()->context();
-        // Mask out writes to the alpha channel for the root layer, subpixel antialiasing
-        // via Skia results in invalid zero alpha values on text glyphs. The root layer
-        // is always opaque so the alpha channel isn't meaningful anyway.
-        if (isRootLayer())
-            context->colorMask(true, true, true, false);
+    if (!layerRect.isEmpty())
         m_tiler->draw(layerRect, m_tilingTransform, drawOpacity());
-        if (isRootLayer())
-            context->colorMask(true, true, true, true);
-    }
 }
 
 void CCTiledLayerImpl::bindContentsTexture()
index ba98c88..4d0052f 100644 (file)
@@ -1,3 +1,20 @@
+2011-08-18  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r93329.
+        http://trac.webkit.org/changeset/93329
+        https://bugs.webkit.org/show_bug.cgi?id=66497
+
+        Turned text on chromium win blue (Requested by jamesr_ on
+        #webkit).
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::paint):
+        (WebKit::WebViewImpl::setRootGraphicsLayer):
+        (WebKit::WebViewImpl::setRootPlatformLayer):
+        (WebKit::WebViewImpl::didRecreateGraphicsContext):
+        (WebKit::WebViewImpl::updateLayerTreeViewport):
+        * src/WebViewImpl.h:
+
 2011-08-18  Dominic Mazzoni  <dmazzoni@google.com>
 
         Add a bunch of accessors to WebAccessibilityObject to expose more of
index ae5ac81..2bfbf47 100644 (file)
@@ -1140,7 +1140,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
         if (canvas) {
             // Clip rect to the confines of the rootLayerTexture.
             IntRect resizeRect(rect);
-            resizeRect.intersect(IntRect(IntPoint(0, 0), m_layerTreeHost->viewportSize()));
+            resizeRect.intersect(IntRect(IntPoint(0, 0), m_layerTreeHost->viewportVisibleRect().size()));
             doPixelReadbackToCanvas(canvas, resizeRect);
         }
 #endif
@@ -2466,10 +2466,14 @@ bool WebViewImpl::pageHasRTLStyle() const
     return (style->direction() == RTL);
 }
 
-void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
+void WebViewImpl::setRootGraphicsLayer(WebCore::GraphicsLayer* layer)
 {
     m_rootGraphicsLayer = layer;
+    setRootPlatformLayer(layer ? layer->platformLayer() : 0);
+}
 
+void WebViewImpl::setRootPlatformLayer(WebCore::PlatformLayer* layer)
+{
     setIsAcceleratedCompositingActive(layer);
     if (m_layerTreeHost)
         m_layerTreeHost->setRootLayer(layer);
@@ -2614,7 +2618,7 @@ void WebViewImpl::animateAndLayout(double frameBeginTime)
 
 void WebViewImpl::didRecreateGraphicsContext(bool success)
 {
-    setRootGraphicsLayer(success ? m_layerTreeHost->rootLayer() : 0);
+    setRootPlatformLayer(success ? m_layerTreeHost->rootLayer() : 0);
 
     if (success) {
       // Forces ViewHostMsg_DidActivateAcceleratedCompositing to be sent so
@@ -2638,10 +2642,11 @@ void WebViewImpl::updateLayerTreeViewport()
         return;
 
     FrameView* view = page()->mainFrame()->view();
-    IntRect visibleRect = view->visibleContentRect(true /* include scrollbars */);
+    IntRect contentRect = view->visibleContentRect(false);
+    IntRect visibleRect = view->visibleContentRect(true);
     IntPoint scroll(view->scrollX(), view->scrollY());
 
-    m_layerTreeHost->setViewport(visibleRect.size(), view->contentsSize(), scroll);
+    m_layerTreeHost->setViewport(visibleRect, contentRect, scroll);
 }
 
 WebGraphicsContext3D* WebViewImpl::graphicsContext3D()
index 4cbe932..c6040c0 100644 (file)
@@ -369,6 +369,7 @@ public:
     bool allowsAcceleratedCompositing();
     bool pageHasRTLStyle() const;
     void setRootGraphicsLayer(WebCore::GraphicsLayer*);
+    void setRootPlatformLayer(WebCore::PlatformLayer*);
     void setRootLayerNeedsDisplay();
     void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect);
     void invalidateRootLayerRect(const WebCore::IntRect&);