Unreviewed, rolling out r110929.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 04:07:16 +0000 (04:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 04:07:16 +0000 (04:07 +0000)
http://trac.webkit.org/changeset/110929
https://bugs.webkit.org/show_bug.cgi?id=81306

breaking webkit_unit_tests (Requested by morrita on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-03-15

Source/WebCore:

* platform/graphics/chromium/Canvas2DLayerChromium.cpp:
(WebCore::Canvas2DLayerChromium::paintContentsIfDirty):
* platform/graphics/chromium/Canvas2DLayerChromium.h:
(Canvas2DLayerChromium):
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerChromium::paintContentsIfDirty):
(WebCore::ContentLayerChromium::idlePaintContentsIfDirty):
* platform/graphics/chromium/ContentLayerChromium.h:
(WebCore):
(ContentLayerChromium):
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerChromium::paintContentsIfDirty):
* platform/graphics/chromium/ImageLayerChromium.h:
(WebCore):
(ImageLayerChromium):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::paintContentsIfDirty):
(WebCore::LayerChromium::idlePaintContentsIfDirty):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore):
(WebCore::contentToLayerTransform):
(WebCore::TiledLayerChromium::prepareToUpdateTiles):
(WebCore::TiledLayerChromium::prepareToUpdate):
(WebCore::TiledLayerChromium::prepareToUpdateIdle):
* platform/graphics/chromium/TiledLayerChromium.h:
(WebCore):
(TiledLayerChromium):
* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::paintContentsIfDirty):
* platform/graphics/chromium/WebGLLayerChromium.h:
(WebGLLayerChromium):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::paintContentsIfDirty):
(WebCore::CCLayerTreeHost::paintMaskAndReplicaForRenderSurface):
(WebCore::CCLayerTreeHost::paintLayerContents):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:

Source/WebKit/chromium:

* tests/CCLayerTreeHostTest.cpp:
(WTF::ContentLayerChromiumWithUpdateTracking::paintContentsIfDirty):
(WTF::ContentLayerChromiumWithUpdateTracking::idlePaintContentsIfDirty):
(WTF::TestLayerChromium::paintContentsIfDirty):
* tests/Canvas2DLayerChromiumTest.cpp:
* tests/TiledLayerChromiumTest.cpp:
(WTF::FakeTiledLayerChromium::prepareToUpdate):
(WTF::FakeTiledLayerChromium::prepareToUpdateIdle):
(WTF::FakeTiledLayerChromium::paintContentsIfDirty):
(WTF::TEST):

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

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h
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/ImageLayerChromium.h
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/Canvas2DLayerChromiumTest.cpp
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

index b199659163b3250cac97c7a81d3b36f9dd1c8913..2a20fa20e1ac0123c0a1f01a1a3b3431eeb36275 100644 (file)
@@ -1,3 +1,48 @@
+2012-03-15  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r110929.
+        http://trac.webkit.org/changeset/110929
+        https://bugs.webkit.org/show_bug.cgi?id=81306
+
+        breaking webkit_unit_tests (Requested by morrita on #webkit).
+
+        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
+        (WebCore::Canvas2DLayerChromium::paintContentsIfDirty):
+        * platform/graphics/chromium/Canvas2DLayerChromium.h:
+        (Canvas2DLayerChromium):
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerChromium::paintContentsIfDirty):
+        (WebCore::ContentLayerChromium::idlePaintContentsIfDirty):
+        * platform/graphics/chromium/ContentLayerChromium.h:
+        (WebCore):
+        (ContentLayerChromium):
+        * platform/graphics/chromium/ImageLayerChromium.cpp:
+        (WebCore::ImageLayerChromium::paintContentsIfDirty):
+        * platform/graphics/chromium/ImageLayerChromium.h:
+        (WebCore):
+        (ImageLayerChromium):
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::LayerChromium::paintContentsIfDirty):
+        (WebCore::LayerChromium::idlePaintContentsIfDirty):
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore):
+        (WebCore::contentToLayerTransform):
+        (WebCore::TiledLayerChromium::prepareToUpdateTiles):
+        (WebCore::TiledLayerChromium::prepareToUpdate):
+        (WebCore::TiledLayerChromium::prepareToUpdateIdle):
+        * platform/graphics/chromium/TiledLayerChromium.h:
+        (WebCore):
+        (TiledLayerChromium):
+        * platform/graphics/chromium/WebGLLayerChromium.cpp:
+        (WebCore::WebGLLayerChromium::paintContentsIfDirty):
+        * platform/graphics/chromium/WebGLLayerChromium.h:
+        (WebGLLayerChromium):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::paintContentsIfDirty):
+        (WebCore::CCLayerTreeHost::paintMaskAndReplicaForRenderSurface):
+        (WebCore::CCLayerTreeHost::paintLayerContents):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+
 2012-03-15  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
 
         REGRESSION(r106232): The resize handler is always called after loading.
index 5c0af2cfb93e4d00f7b906d54cbf0bc27b4c5425..3fc6002c8a2209e338447cde4290fe607592a00a 100644 (file)
@@ -97,7 +97,7 @@ void Canvas2DLayerChromium::setCanvas(SkCanvas* canvas)
     m_canvas = canvas;
 }
 
-void Canvas2DLayerChromium::paintContentsIfDirty(const CCOcclusionTracker* /* occlusion */)
+void Canvas2DLayerChromium::paintContentsIfDirty(const Region& /* occludedScreenSpace */)
 {
     TRACE_EVENT("Canvas2DLayerChromium::paintContentsIfDirty", this, 0);
     if (!drawsContent())
index 930224684bbe480ab886454ecd4aaf50fb507761..cbd4adc9b9b5d37844ade8111312faf63f6b3e1a 100644 (file)
@@ -55,7 +55,7 @@ public:
     virtual void setNeedsDisplayRect(const FloatRect&);
 
     virtual bool drawsContent() const;
-    virtual void paintContentsIfDirty(const CCOcclusionTracker*);
+    virtual void paintContentsIfDirty(const Region& occludedScreenSpace);
 
     virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
     virtual void pushPropertiesTo(CCLayerImpl*);
index c0072157979d78b59ab37e0f22db2656229c0499..7a66984bd762b0cd982959b615d7384591eb0d43 100644 (file)
@@ -93,7 +93,7 @@ bool ContentLayerChromium::drawsContent() const
     return TiledLayerChromium::drawsContent() && m_delegate;
 }
 
-void ContentLayerChromium::paintContentsIfDirty(const CCOcclusionTracker* occlusion)
+void ContentLayerChromium::paintContentsIfDirty(const Region& occludedScreenSpace)
 {
     updateTileSizeAndTilingOption();
     createTextureUpdaterIfNeeded();
@@ -105,11 +105,11 @@ void ContentLayerChromium::paintContentsIfDirty(const CCOcclusionTracker* occlus
     if (drawsContent())
         layerRect = visibleLayerRect();
 
-    prepareToUpdate(layerRect, occlusion);
+    prepareToUpdate(layerRect, occludedScreenSpace);
     m_needsDisplay = false;
 }
 
-void ContentLayerChromium::idlePaintContentsIfDirty(const CCOcclusionTracker* occlusion)
+void ContentLayerChromium::idlePaintContentsIfDirty(const Region& occludedScreenSpace)
 {
     if (!drawsContent())
         return;
@@ -118,7 +118,7 @@ void ContentLayerChromium::idlePaintContentsIfDirty(const CCOcclusionTracker* oc
     if (layerRect.isEmpty())
         return;
 
-    prepareToUpdateIdle(layerRect, occlusion);
+    prepareToUpdateIdle(layerRect, occludedScreenSpace);
     if (needsIdlePaint(layerRect))
         setNeedsCommit();
 }
index e6994a21aefac2140887e5bbd8abb203c9ab8179..fa5901e2ad2d95026a62018c8cd61e684e742add 100644 (file)
@@ -41,6 +41,7 @@ namespace WebCore {
 
 class LayerTilerChromium;
 class LayerTextureUpdater;
+class Region;
 
 class ContentLayerDelegate {
 public:
@@ -58,8 +59,8 @@ public:
     void clearDelegate() { m_delegate = 0; }
 
     virtual bool drawsContent() const;
-    virtual void paintContentsIfDirty(const CCOcclusionTracker*);
-    virtual void idlePaintContentsIfDirty(const CCOcclusionTracker*);
+    virtual void paintContentsIfDirty(const Region& occludedScreenSpace);
+    virtual void idlePaintContentsIfDirty(const Region& occludedScreenSpace);
 
     virtual void setOpaque(bool);
 
index 3939158a85b573fb2d4b57fe1a5ef6f2fbf0ff01..611ab2a6a658053956e8b8ed3280dfb1b00db059 100644 (file)
@@ -158,7 +158,7 @@ void ImageLayerChromium::setContents(Image* contents)
     setNeedsDisplay();
 }
 
-void ImageLayerChromium::paintContentsIfDirty(const CCOcclusionTracker* occlusion)
+void ImageLayerChromium::paintContentsIfDirty(const Region& occludedScreenSpace)
 {
     createTextureUpdaterIfNeeded();
     if (m_needsDisplay) {
@@ -168,7 +168,7 @@ void ImageLayerChromium::paintContentsIfDirty(const CCOcclusionTracker* occlusio
         m_needsDisplay = false;
     }
 
-    prepareToUpdate(visibleLayerRect(), occlusion);
+    prepareToUpdate(visibleLayerRect(), occludedScreenSpace);
 }
 
 void ImageLayerChromium::createTextureUpdaterIfNeeded()
index b01ef29da13d0e1115e841ac20f4e60e8ac1643f..deafd37e733ea38bc4dd5bbdf1237e584d4b099e 100644 (file)
@@ -41,6 +41,7 @@ namespace WebCore {
 
 class Image;
 class ImageLayerTextureUpdater;
+class Region;
 
 // A Layer that contains only an Image element.
 class ImageLayerChromium : public TiledLayerChromium {
@@ -49,7 +50,7 @@ public:
     virtual ~ImageLayerChromium();
 
     virtual bool drawsContent() const;
-    virtual void paintContentsIfDirty(const CCOcclusionTracker*);
+    virtual void paintContentsIfDirty(const Region& occludedScreenSpace);
     virtual bool needsContentsScale() const;
 
     void setContents(Image* image);
index e52ec48c7d57c6cafa48faae7d0c365a5e4f9346..86fdf95156889378c3d62d1919a795a2ce12516a 100644 (file)
@@ -43,7 +43,6 @@
 #include "RenderSurfaceChromium.h"
 #include "ShaderChromium.h"
 #include "TransformationMatrix.h"
-#include "cc/CCOcclusionTracker.h"
 
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
@@ -162,8 +161,8 @@ public:
 
     // These methods typically need to be overwritten by derived classes.
     virtual bool drawsContent() const { return m_isDrawable; }
-    virtual void paintContentsIfDirty(const CCOcclusionTracker* /* occlusion */) { }
-    virtual void idlePaintContentsIfDirty(const CCOcclusionTracker* /* occlusion */) { }
+    virtual void paintContentsIfDirty(const Region& /* occludedScreenSpace */) { }
+    virtual void idlePaintContentsIfDirty(const Region& /* occludedScreenSpace */) { }
     virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&) { }
     virtual void setIsMask(bool) { }
     virtual void unreserveContentsTexture() { }
index 853d6754caa59b7be281393289ed7d00cd349256..0259a23d386dd3d1ac8a98bc284e2382c54c63e1 100644 (file)
@@ -397,10 +397,23 @@ bool TiledLayerChromium::tileNeedsBufferedUpdate(UpdatableTile* tile)
     return true;
 }
 
-void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int right, int bottom, const CCOcclusionTracker* occlusion)
+// FIXME: This gets rolled into CCOcclusionTracker when we stop passing around Region objects.
+static inline TransformationMatrix contentToLayerTransform(const IntSize& boundsInLayerSpace, const IntSize& boundsInContentSpace)
+{
+    TransformationMatrix transform;
+    // Scale from content space to layer space
+    transform.scaleNonUniform(boundsInLayerSpace.width() / static_cast<double>(boundsInContentSpace.width()),
+                              boundsInLayerSpace.height() / static_cast<double>(boundsInContentSpace.height()));
+    return transform;
+}
+
+void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int right, int bottom, const Region& occludedScreenSpace)
 {
     createTextureUpdaterIfNeeded();
 
+    // Tiles are in the layer's content space, the occluded region is in screen space.
+    TransformationMatrix contentToScreenSpace = screenSpaceTransform() * contentToLayerTransform(bounds(), contentBounds());
+
     // Create tiles as needed, expanding a dirty rect to contain all
     // the dirty regions currently being drawn. All dirty tiles that are to be painted
     // get their m_updateRect set to m_dirtyRect and m_dirtyRect cleared. This way if
@@ -415,9 +428,9 @@ void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int
             // When not idle painting, if the visible region of the tile is occluded, don't reserve a texture or mark it for update.
             // If any part of the tile is visible, then we need to paint it so the tile is pushed to the impl thread.
             // This will also avoid painting the tile in the next loop, below.
-            if (!idle && occlusion) {
+            if (!idle) {
                 IntRect visibleTileRect = intersection(m_tiler->tileBounds(i, j), visibleLayerRect());
-                if (occlusion->occluded(this, visibleTileRect))
+                if (occludedScreenSpace.contains(contentToScreenSpace.mapRect(visibleTileRect)))
                     continue;
             }
 
@@ -559,7 +572,7 @@ void TiledLayerChromium::resetUpdateState()
     }
 }
 
-void TiledLayerChromium::prepareToUpdate(const IntRect& layerRect, const CCOcclusionTracker* occlusion)
+void TiledLayerChromium::prepareToUpdate(const IntRect& layerRect, const Region& occludedScreenSpace)
 {
     m_skipsDraw = false;
     m_skipsIdlePaint = false;
@@ -576,10 +589,10 @@ void TiledLayerChromium::prepareToUpdate(const IntRect& layerRect, const CCOcclu
     int left, top, right, bottom;
     m_tiler->layerRectToTileIndices(layerRect, left, top, right, bottom);
 
-    prepareToUpdateTiles(false, left, top, right, bottom, occlusion);
+    prepareToUpdateTiles(false, left, top, right, bottom, occludedScreenSpace);
 }
 
-void TiledLayerChromium::prepareToUpdateIdle(const IntRect& layerRect, const CCOcclusionTracker* occlusion)
+void TiledLayerChromium::prepareToUpdateIdle(const IntRect& layerRect, const Region& occludedScreenSpace)
 {
     // Abort if we have already prepared a paint or run out of memory.
     if (m_skipsIdlePaint || !m_paintRect.isEmpty())
@@ -601,7 +614,7 @@ void TiledLayerChromium::prepareToUpdateIdle(const IntRect& layerRect, const CCO
     m_tiler->layerRectToTileIndices(layerRect, left, top, right, bottom);
 
     // Prepaint anything that was occluded but inside the layer's visible region.
-    prepareToUpdateTiles(true, left, top, right, bottom, 0);
+    prepareToUpdateTiles(true, left, top, right, bottom, occludedScreenSpace);
     if (!m_paintRect.isEmpty() || m_skipsIdlePaint)
         return;
 
@@ -611,25 +624,25 @@ void TiledLayerChromium::prepareToUpdateIdle(const IntRect& layerRect, const CCO
     while (!m_skipsIdlePaint && (left > prepaintLeft || top > prepaintTop || right < prepaintRight || bottom < prepaintBottom)) {
         if (bottom < prepaintBottom) {
             ++bottom;
-            prepareToUpdateTiles(true, left, bottom, right, bottom, 0);
+            prepareToUpdateTiles(true, left, bottom, right, bottom, occludedScreenSpace);
             if (!m_paintRect.isEmpty() || m_skipsIdlePaint)
                 break;
         }
         if (top > prepaintTop) {
             --top;
-            prepareToUpdateTiles(true, left, top, right, top, 0);
+            prepareToUpdateTiles(true, left, top, right, top, occludedScreenSpace);
             if (!m_paintRect.isEmpty() || m_skipsIdlePaint)
                 break;
         }
         if (left > prepaintLeft) {
             --left;
-            prepareToUpdateTiles(true, left, top, left, bottom, 0);
+            prepareToUpdateTiles(true, left, top, left, bottom, occludedScreenSpace);
             if (!m_paintRect.isEmpty() || m_skipsIdlePaint)
                 break;
         }
         if (right < prepaintRight) {
             ++right;
-            prepareToUpdateTiles(true, right, top, right, bottom, 0);
+            prepareToUpdateTiles(true, right, top, right, bottom, occludedScreenSpace);
             if (!m_paintRect.isEmpty() || m_skipsIdlePaint)
                 break;
         }
index 643f69640029418a477c6f21433dda7836cd48bb..6ff901dfdbff762f046363b34a48452c04d12100 100644 (file)
@@ -33,7 +33,9 @@
 #include "cc/CCTiledLayerImpl.h"
 
 namespace WebCore {
+
 class LayerTextureUpdater;
+class Region;
 class UpdatableTile;
 
 class TiledLayerChromium : public LayerChromium {
@@ -88,10 +90,10 @@ protected:
     void resetUpdateState();
 
     // Prepare data needed to update textures that intersect with layerRect.
-    void prepareToUpdate(const IntRect& layerRect, const CCOcclusionTracker*);
+    void prepareToUpdate(const IntRect& layerRect, const Region& occludedTargetSpace);
 
     // Same as above, but this will try to paint additional surrounding content if idle.
-    void prepareToUpdateIdle(const IntRect& layerRect, const CCOcclusionTracker*);
+    void prepareToUpdateIdle(const IntRect& layerRect, const Region& occludedTargetSpace);
 
     // After preparing an update, returns true if more pre-painting is needed.
     bool needsIdlePaint(const IntRect& layerRect);
@@ -111,7 +113,7 @@ private:
     bool tileOnlyNeedsPartialUpdate(UpdatableTile*);
     bool tileNeedsBufferedUpdate(UpdatableTile*);
 
-    void prepareToUpdateTiles(bool idle, int left, int top, int right, int bottom, const CCOcclusionTracker*);
+    void prepareToUpdateTiles(bool idle, int left, int top, int right, int bottom, const Region& occludedTargetSpace);
     IntRect idlePaintRect(const IntRect& visibleLayerRect);
 
     UpdatableTile* tileAt(int, int) const;
index 80d23d1a8e190f26debb6afeb445c907f3af3d42..e3e19e258faa604bc7f5bab29272236c2c167d16 100644 (file)
@@ -70,7 +70,7 @@ bool WebGLLayerChromium::drawsContent() const
     return LayerChromium::drawsContent() && !m_contextLost;
 }
 
-void WebGLLayerChromium::paintContentsIfDirty(const CCOcclusionTracker* /* occlusion */)
+void WebGLLayerChromium::paintContentsIfDirty(const Region&)
 {
     if (!drawsContent() || !m_needsDisplay || !m_textureUpdated)
         return;
index 6509fb358d95e9b0df171ac0b1cdfc5d5354163d..af138fa1e0f3c98741dae0e9ab4fc50735a7d079 100644 (file)
@@ -53,7 +53,7 @@ public:
     void setTextureId(unsigned textureId) { m_textureId = textureId; }
 
     virtual bool drawsContent() const;
-    virtual void paintContentsIfDirty(const CCOcclusionTracker*);
+    virtual void paintContentsIfDirty(const Region&);
     virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
     virtual void pushPropertiesTo(CCLayerImpl*);
     virtual void setNeedsDisplayRect(const FloatRect&);
index 065902ce5a31323dffe91c8e5aecf031c75950e0..34bce118100fa5fa38d9352820d5708e9feddca2 100644 (file)
@@ -499,14 +499,14 @@ void CCLayerTreeHost::reserveTextures()
 }
 
 // static
-void CCLayerTreeHost::paintContentsIfDirty(LayerChromium* layer, PaintType paintType, const CCOcclusionTracker* occlusion)
+void CCLayerTreeHost::paintContentsIfDirty(LayerChromium* layer, PaintType paintType, const Region& occludedScreenSpace)
 {
     ASSERT(layer);
     ASSERT(PaintVisible == paintType || PaintIdle == paintType);
     if (PaintVisible == paintType)
-        layer->paintContentsIfDirty(occlusion);
+        layer->paintContentsIfDirty(occludedScreenSpace);
     else
-        layer->idlePaintContentsIfDirty(occlusion);
+        layer->idlePaintContentsIfDirty(occludedScreenSpace);
 }
 
 void CCLayerTreeHost::paintMaskAndReplicaForRenderSurface(LayerChromium* renderSurfaceLayer, PaintType paintType)
@@ -516,19 +516,20 @@ void CCLayerTreeHost::paintMaskAndReplicaForRenderSurface(LayerChromium* renderS
     // mask and replica should be painted.
 
     // FIXME: If the surface has a replica, it should be painted with occlusion that excludes the current target surface subtree.
+    Region noOcclusion;
 
     if (renderSurfaceLayer->maskLayer()) {
         renderSurfaceLayer->maskLayer()->setVisibleLayerRect(IntRect(IntPoint(), renderSurfaceLayer->contentBounds()));
-        paintContentsIfDirty(renderSurfaceLayer->maskLayer(), paintType, 0);
+        paintContentsIfDirty(renderSurfaceLayer->maskLayer(), paintType, noOcclusion);
     }
 
     LayerChromium* replicaLayer = renderSurfaceLayer->replicaLayer();
     if (replicaLayer) {
-        paintContentsIfDirty(replicaLayer, paintType, 0);
+        paintContentsIfDirty(replicaLayer, paintType, noOcclusion);
 
         if (replicaLayer->maskLayer()) {
             replicaLayer->maskLayer()->setVisibleLayerRect(IntRect(IntPoint(), replicaLayer->maskLayer()->contentBounds()));
-            paintContentsIfDirty(replicaLayer->maskLayer(), paintType, 0);
+            paintContentsIfDirty(replicaLayer->maskLayer(), paintType, noOcclusion);
         }
     }
 }
@@ -552,7 +553,7 @@ void CCLayerTreeHost::paintLayerContents(const LayerList& renderSurfaceLayerList
             ASSERT(!it->bounds().isEmpty());
 
             occlusionTracker.enterTargetRenderSurface(it->targetRenderSurface());
-            paintContentsIfDirty(*it, paintType, &occlusionTracker);
+            paintContentsIfDirty(*it, paintType, occlusionTracker.currentOcclusionInScreenSpace());
             occlusionTracker.markOccludedBehindLayer(*it);
         } else
             occlusionTracker.leaveToTargetRenderSurface(it.targetRenderSurfaceLayer()->renderSurface());
index 89f1be307edfc916d609e085a35522677623ec87..d5262262d4f2cca54496cfbba7a550db932ba4ae 100644 (file)
@@ -216,7 +216,7 @@ private:
     void initializeLayerRenderer();
 
     enum PaintType { PaintVisible, PaintIdle };
-    static void paintContentsIfDirty(LayerChromium*, PaintType, const CCOcclusionTracker*);
+    static void paintContentsIfDirty(LayerChromium*, PaintType, const Region& occludedScreenSpace);
     void paintLayerContents(const LayerList&, PaintType);
     void paintMaskAndReplicaForRenderSurface(LayerChromium*, PaintType);
 
index 10f99363a6d401ea214bbb99d15c53ee0c201522..7a83722aac78d681f2f4b4771c80355477ff0454 100644 (file)
@@ -1,3 +1,22 @@
+2012-03-15  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r110929.
+        http://trac.webkit.org/changeset/110929
+        https://bugs.webkit.org/show_bug.cgi?id=81306
+
+        breaking webkit_unit_tests (Requested by morrita on #webkit).
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::ContentLayerChromiumWithUpdateTracking::paintContentsIfDirty):
+        (WTF::ContentLayerChromiumWithUpdateTracking::idlePaintContentsIfDirty):
+        (WTF::TestLayerChromium::paintContentsIfDirty):
+        * tests/Canvas2DLayerChromiumTest.cpp:
+        * tests/TiledLayerChromiumTest.cpp:
+        (WTF::FakeTiledLayerChromium::prepareToUpdate):
+        (WTF::FakeTiledLayerChromium::prepareToUpdateIdle):
+        (WTF::FakeTiledLayerChromium::paintContentsIfDirty):
+        (WTF::TEST):
+
 2012-03-15  Dana Jansens  <danakj@chromium.org>
 
         [chromium] Decide occlusion in paint culling with CCOcclusionTracker
index 706b4d0024067f9c2d7894e8804d225e1c498b31..fe788fbaeee77e793a0038ec7af292655ffc746b 100644 (file)
@@ -32,6 +32,7 @@
 #include "FilterOperations.h"
 #include "GraphicsContext3DPrivate.h"
 #include "LayerChromium.h"
+#include "Region.h"
 #include "TextureManager.h"
 #include "WebCompositor.h"
 #include "WebKit.h"
@@ -1272,15 +1273,15 @@ public:
     int updateCount() { return m_updateCount; }
     void resetUpdateCount() { m_updateCount = 0; }
 
-    virtual void paintContentsIfDirty(const CCOcclusionTracker* occlusion)
+    virtual void paintContentsIfDirty(const Region& occludedScreenSpace)
     {
-        ContentLayerChromium::paintContentsIfDirty(occlusion);
+        ContentLayerChromium::paintContentsIfDirty(occludedScreenSpace);
         m_paintContentsCount++;
     }
 
-    virtual void idlePaintContentsIfDirty(const CCOcclusionTracker* occlusion)
+    virtual void idlePaintContentsIfDirty(const Region& occluded)
     {
-        ContentLayerChromium::idlePaintContentsIfDirty(occlusion);
+        ContentLayerChromium::idlePaintContentsIfDirty(occluded);
         m_idlePaintContentsCount++;
     }
 
@@ -1632,9 +1633,9 @@ class TestLayerChromium : public LayerChromium {
 public:
     static PassRefPtr<TestLayerChromium> create() { return adoptRef(new TestLayerChromium()); }
 
-    virtual void paintContentsIfDirty(const CCOcclusionTracker* occlusion)
+    virtual void paintContentsIfDirty(const Region& occludedScreenSpace)
     {
-        m_occludedScreenSpace = occlusion ? occlusion->currentOcclusionInScreenSpace() : Region();
+        m_occludedScreenSpace = occludedScreenSpace;
     }
 
     virtual bool drawsContent() const { return true; }
index 03adb3c888abff840fa1e60997f6f006514fdae5..6a3db02a7b5bdaafcaedc1ad6be83c20c7470ca5 100644 (file)
@@ -156,7 +156,8 @@ protected:
 
         canvas->setNeedsDisplay();
         EXPECT_TRUE(canvas->needsDisplay());
-        canvas->paintContentsIfDirty(0);
+        Region occludedScreenSpace;
+        canvas->paintContentsIfDirty(occludedScreenSpace);
         EXPECT_FALSE(canvas->needsDisplay());
         {
             DebugScopedSetImplThread scopedImplThread;
index 07ceaae88d75777b6363c7a74c9ba0c8934b80c2..2523230e005cb91e154d919cc7e9c965f0f94103 100644 (file)
@@ -48,25 +48,6 @@ using namespace WTF;
 
 namespace {
 
-class TestCCOcclusionTracker : public CCOcclusionTracker {
-public:
-    TestCCOcclusionTracker()
-        : CCOcclusionTracker(IntRect(0, 0, 1000, 1000))
-        , m_scissorRectInScreen(IntRect(0, 0, 1000, 1000))
-    {
-        // Pretend we have visited a render surface.
-        m_stack.append(StackObject());
-    }
-
-    void setOcclusion(const Region& occlusion) { m_stack.last().occlusionInScreen = occlusion; }
-
-protected:
-    virtual IntRect layerScissorRectInTargetSurface(const LayerChromium* layer) const { return m_scissorRectInScreen; }
-
-private:
-    IntRect m_scissorRectInScreen;
-};
-
 class FakeTextureAllocator : public TextureAllocator {
 public:
     virtual unsigned createTexture(const IntSize&, GC3Denum) { return 0; }
@@ -169,14 +150,14 @@ public:
         TiledLayerChromium::invalidateRect(rect);
     }
 
-    void prepareToUpdate(const IntRect& rect, const CCOcclusionTracker* occlusion)
+    void prepareToUpdate(const IntRect& rect, const Region& occluded)
     {
-        TiledLayerChromium::prepareToUpdate(rect, occlusion);
+        TiledLayerChromium::prepareToUpdate(rect, occluded);
     }
 
-    void prepareToUpdateIdle(const IntRect& rect, const CCOcclusionTracker* occlusion)
+    void prepareToUpdateIdle(const IntRect& rect, const Region& occluded)
     {
-        TiledLayerChromium::prepareToUpdateIdle(rect, occlusion);
+        TiledLayerChromium::prepareToUpdateIdle(rect, occluded);
     }
 
     bool needsIdlePaint(const IntRect& rect)
@@ -201,9 +182,9 @@ public:
 
     virtual TextureManager* textureManager() const { return m_textureManager; }
 
-    virtual void paintContentsIfDirty(const CCOcclusionTracker* occlusion)
+    virtual void paintContentsIfDirty(const Region& occludedScreenSpace)
     {
-        prepareToUpdate(visibleLayerRect(), occlusion);
+        prepareToUpdate(visibleLayerRect(), occludedScreenSpace);
     }
 
 private:
@@ -259,6 +240,7 @@ TEST(TiledLayerChromiumTest, pushDirtyTiles)
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+    Region noOcclusion;
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
@@ -266,7 +248,7 @@ TEST(TiledLayerChromiumTest, pushDirtyTiles)
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
     layer->invalidateRect(IntRect(0, 0, 100, 200));
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
@@ -279,7 +261,7 @@ TEST(TiledLayerChromiumTest, pushDirtyTiles)
     // Invalidates both tiles...
     layer->invalidateRect(IntRect(0, 0, 100, 200));
     // ....but then only update one of them.
-    layer->prepareToUpdate(IntRect(0, 0, 100, 100), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 100), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
@@ -294,17 +276,15 @@ TEST(TiledLayerChromiumTest, pushOccludedDirtyTiles)
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
-    TestCCOcclusionTracker occluded;
+    Region noOcclusion;
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
-    layer->setDrawTransform(TransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
-    layer->setVisibleLayerRect(IntRect(0, 0, 100, 200));
     layer->invalidateRect(IntRect(0, 0, 100, 200));
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
@@ -317,8 +297,8 @@ TEST(TiledLayerChromiumTest, pushOccludedDirtyTiles)
     // Invalidates part of the top tile...
     layer->invalidateRect(IntRect(0, 0, 50, 50));
     // ....but the area is occluded.
-    occluded.setOcclusion(IntRect(0, 0, 50, 50));
-    layer->prepareToUpdate(IntRect(0, 0, 100, 100), &occluded);
+    Region occlusion(IntRect(0, 0, 50, 50));
+    layer->prepareToUpdate(IntRect(0, 0, 100, 100), occlusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
@@ -341,12 +321,13 @@ TEST(TiledLayerChromiumTest, pushIdlePaintTiles)
     IntSize contentBounds(500, 500);
     IntRect contentRect(IntPoint::zero(), contentBounds);
     IntRect visibleRect(200, 200, 100, 100);
+    Region noOcclusion;
 
     // This invalidates 25 tiles and then paints one visible tile.
     layer->setBounds(contentBounds);
     layer->setVisibleLayerRect(visibleRect);
     layer->invalidateRect(contentRect);
-    layer->prepareToUpdate(visibleRect, 0);
+    layer->prepareToUpdate(visibleRect, noOcclusion);
 
     // We should need idle-painting for 3x3 tiles in the center.
     EXPECT_TRUE(layer->needsIdlePaint(visibleRect));
@@ -361,9 +342,9 @@ TEST(TiledLayerChromiumTest, pushIdlePaintTiles)
 
     // For the next four updates, we should detect we still need idle painting.
     for (int i = 0; i < 4; i++) {
-        layer->prepareToUpdate(visibleRect, 0);
+        layer->prepareToUpdate(visibleRect, noOcclusion);
         EXPECT_TRUE(layer->needsIdlePaint(visibleRect));
-        layer->prepareToUpdateIdle(visibleRect, 0);
+        layer->prepareToUpdateIdle(visibleRect, noOcclusion);
         layer->updateCompositorResources(0, updater);
         layer->pushPropertiesTo(layerImpl.get());
         textureManager->unprotectAllTextures();
@@ -393,6 +374,7 @@ TEST(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint)
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
+    Region noOcclusion;
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     // However, during the paint, we invalidate one of the tiles. This should
@@ -400,7 +382,7 @@ TEST(TiledLayerChromiumTest, pushTilesMarkedDirtyDuringPaint)
     layer->setBounds(IntSize(100, 200));
     layer->invalidateRect(IntRect(0, 0, 100, 200));
     layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer.get());
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
@@ -420,17 +402,18 @@ TEST(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnNextLayer)
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
+    Region noOcclusion;
 
     layer1->setBounds(IntSize(100, 200));
     layer1->invalidateRect(IntRect(0, 0, 100, 200));
     layer2->setBounds(IntSize(100, 200));
     layer2->invalidateRect(IntRect(0, 0, 100, 200));
 
-    layer1->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer1->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
 
     // Invalidate a tile on layer1
     layer2->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer1.get());
-    layer2->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer2->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
 
     layer1->updateCompositorResources(0, updater);
     layer2->updateCompositorResources(0, updater);
@@ -456,6 +439,7 @@ TEST(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLayer
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
+    Region noOcclusion;
 
     layer1->setBounds(IntSize(100, 200));
     layer1->invalidateRect(IntRect(0, 0, 100, 200));
@@ -464,9 +448,9 @@ TEST(TiledLayerChromiumTest, pushTilesLayerMarkedDirtyDuringPaintOnPreviousLayer
 
     // Invalidate a tile on layer2
     layer1->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(0, 50, 100, 50), layer2.get());
-    layer1->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer1->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
 
-    layer2->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer2->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
 
     layer1->updateCompositorResources(0, updater);
     layer2->updateCompositorResources(0, updater);
@@ -487,6 +471,7 @@ TEST(TiledLayerChromiumTest, idlePaintOutOfMemory)
     IntSize contentBounds(300, 300);
     IntRect contentRect(IntPoint::zero(), contentBounds);
     IntRect visibleRect(100, 100, 100, 100);
+    Region noOcclusion;
 
     // We have enough memory for only the visible rect, so we will run out of memory in first idle paint.
     int memoryLimit = 4 * 100 * 100; // 2 tiles, 4 bytes per pixel.
@@ -503,7 +488,7 @@ TEST(TiledLayerChromiumTest, idlePaintOutOfMemory)
     layer->setBounds(contentBounds);
     layer->setVisibleLayerRect(visibleRect);
     layer->invalidateRect(contentRect);
-    layer->prepareToUpdate(visibleRect, 0);
+    layer->prepareToUpdate(visibleRect, noOcclusion);
 
     // We should need idle-painting for 3x3 tiles surounding visible tile.
     EXPECT_TRUE(layer->needsIdlePaint(visibleRect));
@@ -515,8 +500,8 @@ TEST(TiledLayerChromiumTest, idlePaintOutOfMemory)
     EXPECT_TRUE(layerImpl->hasTileAt(1, 1));
 
     textureManager->unprotectAllTextures();
-    layer->prepareToUpdate(visibleRect, 0);
-    layer->prepareToUpdateIdle(visibleRect, 0);
+    layer->prepareToUpdate(visibleRect, noOcclusion);
+    layer->prepareToUpdateIdle(visibleRect, noOcclusion);
 
     // We shouldn't signal we need another idle paint after we run out of memory.
     EXPECT_FALSE(layer->needsIdlePaint(visibleRect));
@@ -531,6 +516,7 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare)
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
     DebugScopedSetImplThread implThread;
     OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0)));
+    Region noOcclusion;
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
@@ -538,7 +524,7 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare)
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
     layer->invalidateRect(IntRect(0, 0, 100, 200));
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
@@ -551,18 +537,18 @@ TEST(TiledLayerChromiumTest, invalidateFromPrepare)
     layer->fakeLayerTextureUpdater()->clearPrepareCount();
     // Invoke prepareToUpdate again. As the layer is valid prepareToUpdate shouldn't be invoked on
     // the LayerTextureUpdater.
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
     EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareCount());
 
     layer->invalidateRect(IntRect(0, 0, 50, 50));
     // setRectToInvalidate triggers invalidateRect() being invoked from prepareToUpdate.
     layer->fakeLayerTextureUpdater()->setRectToInvalidate(IntRect(25, 25, 50, 50), layer.get());
     layer->fakeLayerTextureUpdater()->clearPrepareCount();
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
     EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
     layer->fakeLayerTextureUpdater()->clearPrepareCount();
     // The layer should still be invalid as prepareToUpdate invoked invalidate.
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), noOcclusion);
     EXPECT_EQ(1, layer->fakeLayerTextureUpdater()->prepareCount());
 }
 
@@ -573,6 +559,7 @@ TEST(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled)
 
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerWithScaledBounds> layer = adoptRef(new FakeTiledLayerWithScaledBounds(textureManager.get()));
+    Region noOcclusion;
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
@@ -587,20 +574,20 @@ TEST(TiledLayerChromiumTest, verifyUpdateRectWhenContentBoundsAreScaled)
     // On first update, the updateRect includes all tiles, even beyond the boundaries of the layer.
     // However, it should still be in layer space, not content space.
     layer->invalidateRect(contentBounds);
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     layer->updateCompositorResources(0, updater);
     EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 300, 300 * 0.8), layer->updateRect());
 
     // After the tiles are updated once, another invalidate only needs to update the bounds of the layer.
     layer->invalidateRect(contentBounds);
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     layer->updateCompositorResources(0, updater);
     EXPECT_FLOAT_RECT_EQ(FloatRect(layerBounds), layer->updateRect());
 
     // Partial re-paint should also be represented by the updateRect in layer space, not content space.
     IntRect partialDamage(30, 100, 10, 10);
     layer->invalidateRect(partialDamage);
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     layer->updateCompositorResources(0, updater);
     EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect());
 }
@@ -614,6 +601,7 @@ TEST(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
 
     FakeTextureAllocator textureAllocator;
     CCTextureUpdater updater(&textureAllocator);
+    Region noOcclusion;
 
     // Create a layer with one tile.
     layer->setBounds(IntSize(100, 100));
@@ -623,7 +611,7 @@ TEST(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
     EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 100, 100), layer->lastNeedsDisplayRect());
 
     // Push the tiles to the impl side and check that there is exactly one.
-    layer->prepareToUpdate(IntRect(0, 0, 100, 100), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 100), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
     EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
@@ -637,7 +625,7 @@ TEST(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
     EXPECT_FLOAT_RECT_EQ(FloatRect(0, 0, 100, 100), layer->lastNeedsDisplayRect());
 
     // The impl side should get 2x2 tiles now.
-    layer->prepareToUpdate(IntRect(0, 0, 200, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 200, 200), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
     EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
@@ -648,7 +636,7 @@ TEST(TiledLayerChromiumTest, verifyInvalidationWhenContentsScaleChanges)
     // Invalidate the entire layer again, but do not paint. All tiles should be gone now from the
     // impl side.
     layer->setNeedsDisplay();
-    layer->prepareToUpdate(IntRect(1, 0, 0, 1), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 0, 0), noOcclusion);
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
     EXPECT_FALSE(layerImpl->hasTileAt(0, 0));
@@ -714,10 +702,11 @@ TEST(TiledLayerChromiumTest, resizeToSmaller)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(60*1024*1024, 60*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+    Region noOcclusion;
 
     layer->setBounds(IntSize(700, 700));
     layer->invalidateRect(IntRect(0, 0, 700, 700));
-    layer->prepareToUpdate(IntRect(0, 0, 700, 700), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 700, 700), noOcclusion);
 
     layer->setBounds(IntSize(200, 200));
     layer->invalidateRect(IntRect(0, 0, 200, 200));
@@ -798,12 +787,13 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithoutOcclusion)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
+    Region occluded;
 
     // The tile size is 100x100, so this invalidates and then paints two tiles.
     layer->setBounds(IntSize(100, 200));
 
     layer->invalidateRect(IntRect(0, 0, 100, 200));
-    layer->prepareToUpdate(IntRect(0, 0, 100, 200), 0);
+    layer->prepareToUpdate(IntRect(0, 0, 100, 200), occluded);
     EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->prepareRectCount());
 }
 
@@ -811,31 +801,30 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusion)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
-    TestCCOcclusionTracker occluded;
+    Region occluded;
 
     // The tile size is 100x100.
 
     layer->setBounds(IntSize(600, 600));
-    layer->setDrawTransform(TransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
 
-    occluded.setOcclusion(IntRect(200, 200, 300, 100));
+    occluded = IntRect(200, 200, 300, 100);
     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
-    occluded.setOcclusion(IntRect(250, 200, 300, 100));
+    occluded = IntRect(250, 200, 300, 100);
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
-    occluded.setOcclusion(IntRect(250, 250, 300, 100));
+    occluded = IntRect(250, 250, 300, 100);
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount());
 }
 
@@ -843,60 +832,58 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
-    TestCCOcclusionTracker occluded;
+    Region occluded;
 
     // The tile size is 100x100.
 
     layer->setBounds(IntSize(600, 600));
-    layer->setDrawTransform(TransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
 
     // The partially occluded tiles (by the 150 occlusion height) are visible beyond the occlusion, so not culled.
-    occluded.setOcclusion(IntRect(200, 200, 300, 150));
+    occluded = IntRect(200, 200, 300, 150);
     layer->setVisibleLayerRect(IntRect(0, 0, 600, 360));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
-    EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
+    EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
     // Now the visible region stops at the edge of the occlusion so the partly visible tiles become fully occluded.
-    occluded.setOcclusion(IntRect(200, 200, 300, 150));
+    occluded = IntRect(200, 200, 300, 150);
     layer->setVisibleLayerRect(IntRect(0, 0, 600, 350));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
-    EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
+    EXPECT_EQ(36-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
     // Now the visible region is even smaller than the occlusion, it should have the same result.
-    occluded.setOcclusion(IntRect(200, 200, 300, 150));
+    occluded = IntRect(200, 200, 300, 150);
     layer->setVisibleLayerRect(IntRect(0, 0, 600, 340));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
-    EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
+    EXPECT_EQ(36-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
 }
 
 TEST(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
-    TestCCOcclusionTracker occluded;
+    Region occluded;
 
     // The tile size is 100x100.
 
     layer->setBounds(IntSize(600, 600));
-    layer->setDrawTransform(TransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
 
-    occluded.setOcclusion(IntRect(200, 200, 300, 100));
+    occluded = IntRect(200, 200, 300, 100);
     layer->setVisibleLayerRect(IntRect(0, 0, 600, 600));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
     // Repaint without marking it dirty.
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareRectCount());
 }
 
@@ -904,7 +891,7 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
-    TestCCOcclusionTracker occluded;
+    Region occluded;
 
     // The tile size is 100x100.
 
@@ -914,12 +901,11 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms)
     TransformationMatrix screenTransform;
     screenTransform.scale(0.5);
     layer->setScreenSpaceTransform(screenTransform);
-    layer->setDrawTransform(screenTransform * TransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
 
-    occluded.setOcclusion(IntRect(100, 100, 150, 50));
+    occluded = IntRect(100, 100, 150, 50);
     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 }
 
@@ -927,7 +913,7 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
-    TestCCOcclusionTracker occluded;
+    Region occluded;
 
     // The tile size is 100x100.
 
@@ -936,12 +922,11 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
     // pixels, which means none should be occluded.
     layer->setContentsScale(0.5);
     layer->setBounds(IntSize(600, 600));
-    layer->setDrawTransform(TransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
 
-    occluded.setOcclusion(IntRect(200, 200, 300, 100));
+    occluded = IntRect(200, 200, 300, 100);
     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     // The content is half the size of the layer (so the number of tiles is fewer).
     // In this case, the content is 300x300, and since the tile size is 100, the
     // number of tiles 3x3.
@@ -952,10 +937,10 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
     // This makes sure the painting works when the content space is scaled to
     // a different layer space. In this case the occluded region catches the
     // blown up tiles.
-    occluded.setOcclusion(IntRect(200, 200, 300, 200));
+    occluded = IntRect(200, 200, 300, 200);
     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
@@ -964,12 +949,11 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
     TransformationMatrix screenTransform;
     screenTransform.scale(0.5);
     layer->setScreenSpaceTransform(screenTransform);
-    layer->setDrawTransform(screenTransform * TransformationMatrix(1, 0, 0, 1, layer->bounds().width() / 2.0, layer->bounds().height() / 2.0));
 
-    occluded.setOcclusion(IntRect(100, 100, 150, 100));
+    occluded = IntRect(100, 100, 150, 100);
     layer->setVisibleLayerRect(IntRect(IntPoint(), layer->bounds()));
     layer->invalidateRect(IntRect(0, 0, 600, 600));
-    layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 600), occluded);
     EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
 }
 
@@ -982,6 +966,7 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
 
     IntRect opaquePaintRect;
     Region opaqueContents;
+    Region noOcclusion;
 
     IntRect contentBounds = IntRect(0, 0, 100, 200);
     IntRect visibleBounds = IntRect(0, 0, 100, 150);
@@ -993,7 +978,7 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     // If the layer doesn't paint opaque content, then the opaqueContentsRegion should be empty.
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect);
     layer->invalidateRect(contentBounds);
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     opaqueContents = layer->opaqueContentsRegion();
     EXPECT_TRUE(opaqueContents.isEmpty());
 
@@ -1001,14 +986,14 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     opaquePaintRect = IntRect(10, 10, 90, 190);
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect);
     layer->invalidateRect(contentBounds);
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     opaqueContents = layer->opaqueContentsRegion();
     EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
     // If we paint again without invalidating, the same stuff should be opaque.
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     opaqueContents = layer->opaqueContentsRegion();
     EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());
@@ -1017,7 +1002,7 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     // not be affected.
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
     layer->invalidateRect(IntRect(0, 0, 1, 1));
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     opaqueContents = layer->opaqueContentsRegion();
     EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());
@@ -1026,7 +1011,7 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     // not be affected.
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
     layer->invalidateRect(IntRect(10, 10, 1, 1));
-    layer->prepareToUpdate(contentBounds, 0);
+    layer->prepareToUpdate(contentBounds, noOcclusion);
     opaqueContents = layer->opaqueContentsRegion();
     EXPECT_EQ_RECT(intersection(IntRect(10, 100, 90, 100), visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());