[chromium] Rename opaqueContentsRegion() to visibleContentOpaqueRegion()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 22:46:36 +0000 (22:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 22:46:36 +0000 (22:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81689

Patch by Dana Jansens <danakj@chromium.org> on 2012-03-27
Reviewed by Adrienne Walker.

Source/WebCore:

The return value from this function is a region of opaque pixels in the
layer's content space that intersect with its visible rect. Rather than
adding a comment to this effect, renaming the method to make it clear.

* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::visibleContentOpaqueRegion):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::visibleContentOpaqueRegion):
* platform/graphics/chromium/TiledLayerChromium.h:
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::visibleContentOpaqueRegion):
* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::computeOcclusionBehindLayer):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(WebCore::CCTiledLayerImpl::visibleContentOpaqueRegion):
* platform/graphics/chromium/cc/CCTiledLayerImpl.h:
(CCTiledLayerImpl):

Source/WebKit/chromium:

* tests/CCLayerTreeHostTest.cpp:
(WTF::TestLayerChromium::opaqueVisibleContents):
* tests/CCOcclusionTrackerTest.cpp:
(WebCore::TestContentLayerChromium::opaqueVisibleContents):
(WebCore::TestContentLayerImpl::opaqueVisibleContents):
* tests/TiledLayerChromiumTest.cpp:
(WTF::TEST):

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

12 files changed:
Source/WebCore/ChangeLog
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/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

index c086f24..9a7c853 100644 (file)
@@ -1,3 +1,28 @@
+2012-03-27  Dana Jansens  <danakj@chromium.org>
+
+        [chromium] Rename opaqueContentsRegion() to visibleContentOpaqueRegion()
+        https://bugs.webkit.org/show_bug.cgi?id=81689
+
+        Reviewed by Adrienne Walker.
+
+        The return value from this function is a region of opaque pixels in the
+        layer's content space that intersect with its visible rect. Rather than
+        adding a comment to this effect, renaming the method to make it clear.
+
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::LayerChromium::visibleContentOpaqueRegion):
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::visibleContentOpaqueRegion):
+        * platform/graphics/chromium/TiledLayerChromium.h:
+        * platform/graphics/chromium/cc/CCLayerImpl.h:
+        (WebCore::CCLayerImpl::visibleContentOpaqueRegion):
+        * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
+        (WebCore::computeOcclusionBehindLayer):
+        * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
+        (WebCore::CCTiledLayerImpl::visibleContentOpaqueRegion):
+        * platform/graphics/chromium/cc/CCTiledLayerImpl.h:
+        (CCTiledLayerImpl):
+
 2012-03-27  James Robinson  <jamesr@chromium.org>
 
         Scrollable plugins not registered properly in ScrollingCoordinator
index b476072..b98022b 100644 (file)
@@ -246,7 +246,7 @@ public:
 
     void notifyAnimationStarted(const CCAnimationStartedEvent&, double wallClockTime);
 
-    virtual Region opaqueContentsRegion() const { return Region(); };
+    virtual Region visibleContentOpaqueRegion() const { return Region(); };
 
     virtual ScrollbarLayerChromium* toScrollbarLayerChromium() { return 0; }
 
index 5b0089a..456632c 100644 (file)
@@ -578,7 +578,7 @@ void TiledLayerChromium::reserveTextures()
     }
 }
 
-Region TiledLayerChromium::opaqueContentsRegion() const
+Region TiledLayerChromium::visibleContentOpaqueRegion() const
 {
     if (m_skipsDraw)
         return Region();
index fd478de..81ee248 100644 (file)
@@ -64,7 +64,7 @@ public:
 
     virtual void reserveTextures();
 
-    virtual Region opaqueContentsRegion() const;
+    virtual Region visibleContentOpaqueRegion() const;
 
 protected:
     TiledLayerChromium();
index 74a039e..159d5ac 100644 (file)
@@ -231,7 +231,7 @@ public:
 
     CCLayerAnimationController* layerAnimationController() { return m_layerAnimationController.get(); }
 
-    virtual Region opaqueContentsRegion() const { return Region(); };
+    virtual Region visibleContentOpaqueRegion() const { return Region(); };
 
     // Indicates that the context previously used to render this layer
     // was lost and that a new one has been created. Won't be called
index c4082fe..d71f2a6 100644 (file)
@@ -206,9 +206,9 @@ static inline Region computeOcclusionBehindLayer(const LayerType* layer, const T
     if (layer->opaque())
         opaqueRegion = enclosedIntRect(unoccludedQuad.boundingBox());
     else if (usePaintTracking && transform.isIdentity())
-        opaqueRegion = layer->opaqueContentsRegion();
+        opaqueRegion = layer->visibleContentOpaqueRegion();
     else if (usePaintTracking) {
-        Region contentRegion = layer->opaqueContentsRegion();
+        Region contentRegion = layer->visibleContentOpaqueRegion();
         Vector<IntRect> contentRects = contentRegion.rects();
         for (size_t i = 0; i < contentRects.size(); ++i)
             opaqueRegion.unite(enclosedIntRect(transform.mapRect(FloatRect(contentRects[i]))));
index 0517ef0..da83e65 100644 (file)
@@ -223,7 +223,7 @@ void CCTiledLayerImpl::pushTileProperties(int i, int j, Platform3DObject texture
     tile->setOpaqueRect(opaqueRect);
 }
 
-Region CCTiledLayerImpl::opaqueContentsRegion() const
+Region CCTiledLayerImpl::visibleContentOpaqueRegion() const
 {
     if (m_skipsDraw)
         return Region();
index 68a1db1..3790fae 100644 (file)
@@ -56,7 +56,7 @@ public:
     void setContentsSwizzled(bool contentsSwizzled) { m_contentsSwizzled = contentsSwizzled; }
     bool contentsSwizzled() const { return m_contentsSwizzled; }
 
-    virtual Region opaqueContentsRegion() const;
+    virtual Region visibleContentOpaqueRegion() const;
 
     typedef ProgramBinding<VertexShaderTile, FragmentShaderRGBATexAlpha> Program;
     // Shader program that swaps red and blue components of texture.
index d725986..98fff94 100644 (file)
@@ -1,5 +1,20 @@
 2012-03-27  Dana Jansens  <danakj@chromium.org>
 
+        [chromium] Rename opaqueContentsRegion() to visibleContentOpaqueRegion()
+        https://bugs.webkit.org/show_bug.cgi?id=81689
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::TestLayerChromium::opaqueVisibleContents):
+        * tests/CCOcclusionTrackerTest.cpp:
+        (WebCore::TestContentLayerChromium::opaqueVisibleContents):
+        (WebCore::TestContentLayerImpl::opaqueVisibleContents):
+        * tests/TiledLayerChromiumTest.cpp:
+        (WTF::TEST):
+
+2012-03-27  Dana Jansens  <danakj@chromium.org>
+
         [chromium] A unit test to verify clipping is honored when moving occlusion to parent surface
         https://bugs.webkit.org/show_bug.cgi?id=81783
 
index 2d665db..28b38e3 100644 (file)
@@ -1761,7 +1761,7 @@ public:
 
     virtual bool drawsContent() const { return true; }
 
-    virtual Region opaqueContentsRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
+    virtual Region visibleContentOpaqueRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
     void setOpaqueContentsRect(const IntRect& opaqueContentsRect) { m_opaqueContentsRect = opaqueContentsRect; }
 
     const Region& occludedScreenSpace() const { return m_occludedScreenSpace; }
index 48fcf50..c851fa8 100644 (file)
@@ -56,7 +56,7 @@ public:
     TestContentLayerChromium() : LayerChromium() { }
 
     virtual bool drawsContent() const { return true; }
-    virtual Region opaqueContentsRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
+    virtual Region visibleContentOpaqueRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
     void setOpaqueContentsRect(const IntRect& opaqueContentsRect) { m_opaqueContentsRect = opaqueContentsRect; }
 
 private:
@@ -67,7 +67,7 @@ class TestContentLayerImpl : public CCLayerImpl {
 public:
     TestContentLayerImpl(int id) : CCLayerImpl(id) { setDrawsContent(true); }
 
-    virtual Region opaqueContentsRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
+    virtual Region visibleContentOpaqueRegion() const { return intersection(m_opaqueContentsRect, visibleLayerRect()); }
     void setOpaqueContentsRect(const IntRect& opaqueContentsRect) { m_opaqueContentsRect = opaqueContentsRect; }
 private:
     IntRect m_opaqueContentsRect;
index 47fc870..129c915 100644 (file)
@@ -1380,7 +1380,7 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 10000 + 10000, 1);
 }
 
-TEST(TiledLayerChromiumTest, opaqueContentsRegion)
+TEST(TiledLayerChromiumTest, visibleContentOpaqueRegion)
 {
     OwnPtr<TextureManager> textureManager = TextureManager::create(4*1024*1024, 2*1024*1024, 1024);
     RefPtr<FakeTiledLayerChromium> layer = adoptRef(new FakeTiledLayerChromium(textureManager.get()));
@@ -1399,11 +1399,11 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     layer->setVisibleLayerRect(visibleBounds);
     layer->setDrawOpacity(1);
 
-    // If the layer doesn't paint opaque content, then the opaqueContentsRegion should be empty.
+    // If the layer doesn't paint opaque content, then the visibleContentOpaqueRegion should be empty.
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
     layer->invalidateRect(contentBounds);
     layer->prepareToUpdate(contentBounds, &occluded);
-    opaqueContents = layer->opaqueContentsRegion();
+    opaqueContents = layer->visibleContentOpaqueRegion();
     EXPECT_TRUE(opaqueContents.isEmpty());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000, 1);
@@ -1411,12 +1411,12 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000, 1);
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
 
-    // opaqueContentsRegion should match the visible part of what is painted opaque.
+    // visibleContentOpaqueRegion should match the visible part of what is painted opaque.
     opaquePaintRect = IntRect(10, 10, 90, 190);
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(opaquePaintRect);
     layer->invalidateRect(contentBounds);
     layer->prepareToUpdate(contentBounds, &occluded);
-    opaqueContents = layer->opaqueContentsRegion();
+    opaqueContents = layer->visibleContentOpaqueRegion();
     EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
@@ -1428,7 +1428,7 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     // If we paint again without invalidating, the same stuff should be opaque.
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
     layer->prepareToUpdate(contentBounds, &occluded);
-    opaqueContents = layer->opaqueContentsRegion();
+    opaqueContents = layer->visibleContentOpaqueRegion();
     EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
@@ -1442,7 +1442,7 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
     layer->invalidateRect(IntRect(0, 0, 1, 1));
     layer->prepareToUpdate(contentBounds, &occluded);
-    opaqueContents = layer->opaqueContentsRegion();
+    opaqueContents = layer->visibleContentOpaqueRegion();
     EXPECT_EQ_RECT(intersection(opaquePaintRect, visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
@@ -1456,7 +1456,7 @@ TEST(TiledLayerChromiumTest, opaqueContentsRegion)
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
     layer->invalidateRect(IntRect(10, 10, 1, 1));
     layer->prepareToUpdate(contentBounds, &occluded);
-    opaqueContents = layer->opaqueContentsRegion();
+    opaqueContents = layer->visibleContentOpaqueRegion();
     EXPECT_EQ_RECT(intersection(IntRect(10, 100, 90, 100), visibleBounds), opaqueContents.bounds());
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
@@ -1489,7 +1489,7 @@ TEST(TiledLayerChromiumTest, pixelsPaintedMetrics)
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
     layer->invalidateRect(contentBounds);
     layer->prepareToUpdate(contentBounds, &occluded);
-    opaqueContents = layer->opaqueContentsRegion();
+    opaqueContents = layer->visibleContentOpaqueRegion();
     EXPECT_TRUE(opaqueContents.isEmpty());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 30000, 1);
@@ -1503,7 +1503,7 @@ TEST(TiledLayerChromiumTest, pixelsPaintedMetrics)
     layer->invalidateRect(IntRect(0, 0, 1, 1));
     layer->invalidateRect(IntRect(50, 200, 10, 10));
     layer->prepareToUpdate(contentBounds, &occluded);
-    opaqueContents = layer->opaqueContentsRegion();
+    opaqueContents = layer->visibleContentOpaqueRegion();
     EXPECT_TRUE(opaqueContents.isEmpty());
 
     // The middle tile was painted even though not invalidated.