[chromium] Remove surface damage client from occlusion tracker
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 16:59:43 +0000 (16:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 16:59:43 +0000 (16:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81242

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

Source/WebCore:

Code was not used yet, so no new tests. Removing tests instead!

* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::::CCOcclusionTrackerBase):
(WebCore::::layerScissorRectInTargetSurface):
(WebCore):
* platform/graphics/chromium/cc/CCOcclusionTracker.h:
(WebCore):
(CCOcclusionTrackerBase):

Source/WebKit/chromium:

* tests/CCOcclusionTrackerTest.cpp:
(WebCore):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.cpp
Source/WebCore/platform/graphics/chromium/cc/CCOcclusionTracker.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp

index ff0b61451d124a8b0d5f5be4a30b1b1e572e178e..ca5b7f233256e7eee57c983e35d6ba9c38fdff94 100644 (file)
@@ -1,3 +1,20 @@
+2012-03-16  Dana Jansens  <danakj@chromium.org>
+
+        [chromium] Remove surface damage client from occlusion tracker
+        https://bugs.webkit.org/show_bug.cgi?id=81242
+
+        Reviewed by Adrienne Walker.
+
+        Code was not used yet, so no new tests. Removing tests instead!
+
+        * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
+        (WebCore::::CCOcclusionTrackerBase):
+        (WebCore::::layerScissorRectInTargetSurface):
+        (WebCore):
+        * platform/graphics/chromium/cc/CCOcclusionTracker.h:
+        (WebCore):
+        (CCOcclusionTrackerBase):
+
 2012-03-16  Tommy Widenflycht  <tommyw@google.com>
 
         MediaStream API (JSEP): Introducing PeerConnection00Handler
index e0a3e4f8eae0e9c09feb1dadba9ea48283e50968..c69a4d9c81d2148ae0ac7d78990612a8febf95b2 100644 (file)
@@ -41,16 +41,6 @@ namespace WebCore {
 template<typename LayerType, typename RenderSurfaceType>
 CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace)
     : m_scissorRectInScreenSpace(scissorRectInScreenSpace)
-    , m_surfaceDamageClient(0)
-    , m_overdrawMetrics(CCOverdrawMetrics::create())
-    , m_usePaintTracking(true) // FIXME: Remove this when paint tracking is on for paint culling.
-{
-}
-
-template<typename LayerType, typename RenderSurfaceType>
-CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace, const DamageClientType* surfaceDamageClient)
-    : m_scissorRectInScreenSpace(scissorRectInScreenSpace)
-    , m_surfaceDamageClient(surfaceDamageClient)
     , m_overdrawMetrics(CCOverdrawMetrics::create())
     , m_usePaintTracking(true) // FIXME: Remove this when paint tracking is on for paint culling.
 {
@@ -333,8 +323,7 @@ IntRect CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::layerScissorRectIn
 {
     const RenderSurfaceType* targetSurface = m_stack.last().surface;
     FloatRect totalScissor = targetSurface->contentRect();
-    if (m_surfaceDamageClient)
-        totalScissor.intersect(m_surfaceDamageClient->damageRect(targetSurface));
+    // FIXME: layer->clipRect() and layer->usesLayerClipping() is changing: https://bugs.webkit.org/show_bug.cgi?id=80622
     if (!layer->clipRect().isEmpty())
         totalScissor.intersect(layer->clipRect());
     return enclosingIntRect(totalScissor);
@@ -357,7 +346,6 @@ const Region& CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::currentOcclu
 
 // Declare the possible functions here for the linker.
 template CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium>::CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace);
-template CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium>::CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace, const CCOcclusionTrackerDamageClient* surfaceDamageClient);
 template void CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium>::enterTargetRenderSurface(const RenderSurfaceChromium* newTarget);
 template void CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium>::finishedTargetRenderSurface(const LayerChromium* owningLayer, const RenderSurfaceChromium* finishedTarget);
 template void CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium>::leaveToTargetRenderSurface(const RenderSurfaceChromium* newTarget);
@@ -369,7 +357,6 @@ template const Region& CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromi
 template IntRect CCOcclusionTrackerBase<LayerChromium, RenderSurfaceChromium>::layerScissorRectInTargetSurface(const LayerChromium*) const;
 
 template CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface>::CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace);
-template CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface>::CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace, const CCOcclusionTrackerDamageClientImpl* surfaceDamageClient);
 template void CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface>::enterTargetRenderSurface(const CCRenderSurface* newTarget);
 template void CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface>::finishedTargetRenderSurface(const CCLayerImpl* owningLayer, const CCRenderSurface* finishedTarget);
 template void CCOcclusionTrackerBase<CCLayerImpl, CCRenderSurface>::leaveToTargetRenderSurface(const CCRenderSurface* newTarget);
index 134d4cc2b82aa33d5ed7ca2ed4b1536e3e214b89..282deffdf2564be3f9013d2e92026e9b8d6e2afd 100644 (file)
@@ -37,15 +37,6 @@ class CCRenderSurface;
 class LayerChromium;
 class RenderSurfaceChromium;
 
-template<typename RenderSurfaceType>
-class CCOcclusionTrackerDamageClientBase {
-public:
-    virtual FloatRect damageRect(const RenderSurfaceType*) const = 0;
-};
-
-typedef CCOcclusionTrackerDamageClientBase<RenderSurfaceChromium> CCOcclusionTrackerDamageClient;
-typedef CCOcclusionTrackerDamageClientBase<CCRenderSurface> CCOcclusionTrackerDamageClientImpl;
-
 // This class is used to track occlusion of layers while traversing them in a front-to-back order. As each layer is visited, one of the
 // methods in this class is called to notify it about the current target surface.
 // Then, occlusion in the content space of the current layer may be queried, via methods such as occluded() and unoccludedContentRect().
@@ -54,10 +45,8 @@ typedef CCOcclusionTrackerDamageClientBase<CCRenderSurface> CCOcclusionTrackerDa
 template<typename LayerType, typename RenderSurfaceType>
 class CCOcclusionTrackerBase {
     WTF_MAKE_NONCOPYABLE(CCOcclusionTrackerBase);
-    typedef CCOcclusionTrackerDamageClientBase<RenderSurfaceType> DamageClientType;
 public:
     CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace);
-    CCOcclusionTrackerBase(IntRect scissorRectInScreenSpace, const DamageClientType*);
 
     // Called when visiting a layer representing itself. If the target was not already current, then this indicates we have entered a new surface subtree.
     void enterTargetRenderSurface(const RenderSurfaceType* newTarget);
@@ -111,7 +100,6 @@ protected:
 
 private:
     IntRect m_scissorRectInScreenSpace;
-    const DamageClientType* m_surfaceDamageClient;
     OwnPtr<CCOverdrawMetrics> m_overdrawMetrics;
     bool m_usePaintTracking; // FIXME: Remove this when paint tracking is on for paint culling.
 };
index cd68b1e236b995bdcdb8a2e0c360b4d8a538edf5..d7c13a68e7ab7af423373da67635d5a779d6b93c 100644 (file)
@@ -1,3 +1,13 @@
+2012-03-16  Dana Jansens  <danakj@chromium.org>
+
+        [chromium] Remove surface damage client from occlusion tracker
+        https://bugs.webkit.org/show_bug.cgi?id=81242
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCOcclusionTrackerTest.cpp:
+        (WebCore):
+
 2012-03-16  Ian Vollick  <vollick@chromium.org>
 
         [chromium] Threaded opacity animation jump to opacity of 0
index deca4acefbe66910ca51cb5e61d34eb8741ae829..f220152430a7119b99a10f56a6acea4e58048828 100644 (file)
@@ -79,12 +79,6 @@ public:
     {
     }
 
-    TestCCOcclusionTrackerBase(IntRect screenScissorRect, const CCOcclusionTrackerDamageClientBase<RenderSurfaceType>* damageClient)
-        : CCOcclusionTrackerBase<LayerType, RenderSurfaceType>(screenScissorRect, damageClient)
-        , m_overrideLayerScissorRect(false)
-    {
-    }
-
     Region occlusionInScreenSpace() const { return CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInScreen; }
     Region occlusionInTargetSurface() const { return CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::m_stack.last().occlusionInTarget; }
 
@@ -102,20 +96,6 @@ private:
     IntRect m_layerScissorRect;
 };
 
-template<typename RenderSurfaceType>
-class TestDamageClient : public CCOcclusionTrackerDamageClientBase<RenderSurfaceType> {
-public:
-    // The interface
-    virtual FloatRect damageRect(const RenderSurfaceType*) const { return m_damageRect; }
-
-    // Testing stuff
-    TestDamageClient(const FloatRect& damageRect) : m_damageRect(damageRect) { }
-    void setDamageRect(const FloatRect& damageRect) { m_damageRect = damageRect; }
-
-private:
-    FloatRect m_damageRect;
-};
-
 struct CCOcclusionTrackerTestMainThreadTypes {
     typedef LayerChromium LayerType;
     typedef RenderSurfaceChromium RenderSurfaceType;
@@ -1254,31 +1234,6 @@ protected:
 
 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestScreenScissorRectOutsideChild);
 
-template<class Types, bool opaqueLayers>
-class CCOcclusionTrackerTestDamageRectOutsideChild : public CCOcclusionTrackerTest<Types, opaqueLayers> {
-protected:
-    void runMyTest()
-    {
-        typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(300, 300));
-        typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
-        this->calcDrawEtc(parent);
-
-        TestDamageClient<typename Types::RenderSurfaceType> damage(FloatRect(200, 100, 100, 100));
-        TestCCOcclusionTrackerBase<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000), &damage);
-
-        occlusion.enterTargetRenderSurface(layer->renderSurface());
-
-        EXPECT_TRUE(occlusion.unoccludedContentRect(layer, IntRect(0, 0, 200, 200)).isEmpty());
-
-        occlusion.markOccludedBehindLayer(layer);
-        occlusion.leaveToTargetRenderSurface(parent->renderSurface());
-
-        EXPECT_EQ_RECT(IntRect(200, 100, 100, 100), occlusion.unoccludedContentRect(parent, IntRect(0, 0, 300, 300)));
-    }
-};
-
-ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestDamageRectOutsideChild);
-
 template<class Types, bool opaqueLayers>
 class CCOcclusionTrackerTestLayerScissorRectOverChild : public CCOcclusionTrackerTest<Types, opaqueLayers> {
 protected:
@@ -1355,31 +1310,6 @@ protected:
 
 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestScreenScissorRectOverChild);
 
-template<class Types, bool opaqueLayers>
-class CCOcclusionTrackerTestDamageRectOverChild : public CCOcclusionTrackerTest<Types, opaqueLayers> {
-protected:
-    void runMyTest()
-    {
-        typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(300, 300));
-        typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
-        this->calcDrawEtc(parent);
-
-        TestDamageClient<typename Types::RenderSurfaceType> damage(FloatRect(100, 100, 100, 100));
-        TestCCOcclusionTrackerBase<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000), &damage);
-
-        occlusion.enterTargetRenderSurface(layer->renderSurface());
-
-        EXPECT_EQ_RECT(IntRect(100, 100, 100, 100), occlusion.unoccludedContentRect(layer, IntRect(0, 0, 200, 200)));
-
-        occlusion.markOccludedBehindLayer(layer);
-        occlusion.leaveToTargetRenderSurface(parent->renderSurface());
-
-        EXPECT_TRUE(occlusion.unoccludedContentRect(parent, IntRect(0, 0, 300, 300)).isEmpty());
-    }
-};
-
-ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestDamageRectOverChild);
-
 template<class Types, bool opaqueLayers>
 class CCOcclusionTrackerTestLayerScissorRectPartlyOverChild : public CCOcclusionTrackerTest<Types, opaqueLayers> {
 protected:
@@ -1464,31 +1394,6 @@ protected:
 
 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestScreenScissorRectPartlyOverChild);
 
-template<class Types, bool opaqueLayers>
-class CCOcclusionTrackerTestDamageRectPartlyOverChild : public CCOcclusionTrackerTest<Types, opaqueLayers> {
-protected:
-    void runMyTest()
-    {
-        typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(300, 300));
-        typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
-        this->calcDrawEtc(parent);
-
-        TestDamageClient<typename Types::RenderSurfaceType> damage(FloatRect(50, 50, 200, 200));
-        TestCCOcclusionTrackerBase<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000), &damage);
-
-        occlusion.enterTargetRenderSurface(layer->renderSurface());
-
-        EXPECT_EQ_RECT(IntRect(50, 50, 150, 150), occlusion.unoccludedContentRect(layer, IntRect(0, 0, 200, 200)));
-
-        occlusion.markOccludedBehindLayer(layer);
-        occlusion.leaveToTargetRenderSurface(parent->renderSurface());
-
-        EXPECT_EQ_RECT(IntRect(50, 50, 200, 200), occlusion.unoccludedContentRect(parent, IntRect(0, 0, 300, 300)));
-    }
-};
-
-ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestDamageRectPartlyOverChild);
-
 template<class Types, bool opaqueLayers>
 class CCOcclusionTrackerTestLayerScissorRectOverNothing : public CCOcclusionTrackerTest<Types, opaqueLayers> {
 protected:
@@ -1573,31 +1478,6 @@ protected:
 
 ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestScreenScissorRectOverNothing);
 
-template<class Types, bool opaqueLayers>
-class CCOcclusionTrackerTestDamageRectOverNothing : public CCOcclusionTrackerTest<Types, opaqueLayers> {
-protected:
-    void runMyTest()
-    {
-        typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(300, 300));
-        typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
-        this->calcDrawEtc(parent);
-
-        TestDamageClient<typename Types::RenderSurfaceType> damage(FloatRect(500, 500, 100, 100));
-        TestCCOcclusionTrackerBase<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000), &damage);
-
-        occlusion.enterTargetRenderSurface(layer->renderSurface());
-
-        EXPECT_TRUE(occlusion.unoccludedContentRect(layer, IntRect(0, 0, 200, 200)).isEmpty());
-
-        occlusion.markOccludedBehindLayer(layer);
-        occlusion.leaveToTargetRenderSurface(parent->renderSurface());
-
-        EXPECT_TRUE(occlusion.unoccludedContentRect(parent, IntRect(0, 0, 300, 300)).isEmpty());
-    }
-};
-
-ALL_CCOCCLUSIONTRACKER_TEST(CCOcclusionTrackerTestDamageRectOverNothing);
-
 template<class Types, bool opaqueLayers>
 class CCOcclusionTrackerTestLayerScissorRectForLayerOffOrigin : public CCOcclusionTrackerTest<Types, opaqueLayers> {
 protected: