Diff
Modified: trunk/Source/WebCore/ChangeLog (112326 => 112327)
--- trunk/Source/WebCore/ChangeLog 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/ChangeLog 2012-03-27 22:46:36 UTC (rev 112327)
@@ -1,3 +1,28 @@
+2012-03-27 Dana Jansens <[email protected]>
+
+ [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 <[email protected]>
Scrollable plugins not registered properly in ScrollingCoordinator
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (112326 => 112327)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-03-27 22:46:36 UTC (rev 112327)
@@ -246,7 +246,7 @@
void notifyAnimationStarted(const CCAnimationStartedEvent&, double wallClockTime);
- virtual Region opaqueContentsRegion() const { return Region(); };
+ virtual Region visibleContentOpaqueRegion() const { return Region(); };
virtual ScrollbarLayerChromium* toScrollbarLayerChromium() { return 0; }
Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp (112326 => 112327)
--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp 2012-03-27 22:46:36 UTC (rev 112327)
@@ -578,7 +578,7 @@
}
}
-Region TiledLayerChromium::opaqueContentsRegion() const
+Region TiledLayerChromium::visibleContentOpaqueRegion() const
{
if (m_skipsDraw)
return Region();
Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h (112326 => 112327)
--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h 2012-03-27 22:46:36 UTC (rev 112327)
@@ -64,7 +64,7 @@
virtual void reserveTextures();
- virtual Region opaqueContentsRegion() const;
+ virtual Region visibleContentOpaqueRegion() const;
protected:
TiledLayerChromium();
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h (112326 => 112327)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h 2012-03-27 22:46:36 UTC (rev 112327)
@@ -231,7 +231,7 @@
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
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp (112326 => 112327)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp 2012-03-27 22:46:36 UTC (rev 112327)
@@ -206,9 +206,9 @@
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]))));
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp (112326 => 112327)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp 2012-03-27 22:46:36 UTC (rev 112327)
@@ -223,7 +223,7 @@
tile->setOpaqueRect(opaqueRect);
}
-Region CCTiledLayerImpl::opaqueContentsRegion() const
+Region CCTiledLayerImpl::visibleContentOpaqueRegion() const
{
if (m_skipsDraw)
return Region();
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h (112326 => 112327)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h 2012-03-27 22:46:36 UTC (rev 112327)
@@ -56,7 +56,7 @@
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.
Modified: trunk/Source/WebKit/chromium/ChangeLog (112326 => 112327)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-03-27 22:46:36 UTC (rev 112327)
@@ -1,5 +1,20 @@
2012-03-27 Dana Jansens <[email protected]>
+ [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 <[email protected]>
+
[chromium] A unit test to verify clipping is honored when moving occlusion to parent surface
https://bugs.webkit.org/show_bug.cgi?id=81783
Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (112326 => 112327)
--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp 2012-03-27 22:46:36 UTC (rev 112327)
@@ -1761,7 +1761,7 @@
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; }
Modified: trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp (112326 => 112327)
--- trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp 2012-03-27 22:46:36 UTC (rev 112327)
@@ -56,7 +56,7 @@
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 @@
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;
Modified: trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp (112326 => 112327)
--- trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-03-27 22:29:21 UTC (rev 112326)
+++ trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-03-27 22:46:36 UTC (rev 112327)
@@ -1380,7 +1380,7 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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 @@
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 @@
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.