[chromium] Record the number of tiles paint-culled instead of the incorrect number...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 20:35:09 +0000 (20:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 20:35:09 +0000 (20:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82423

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

Source/WebCore:

We currently attempt to record the number of pixels we save from uploading,
however the number is wrong in two ways.
1) An early-out if everything is culled results in nothing being reported.
2) With threaded-compositor, the number of pixels uploaded in one tile can be
changed by culling in another tile, making the number far too difficult to
compute to be worthwhile. If a tile was going to be partial-updated, but is
culled, now a new tile gets to be partial-updated instead, which affects the
numbers.

This patch breaks up CCOverdrawMetrics to make the methods/variables less
overloaded and more clear. This way they don't have to mirror each other
so closely on paint/draw sides.

Then we record the number of tiles for which we prevented upload via paint
culling. This will still over-report (a dirty culled tile stays dirty and
will be culled again each commit), but it seems more reasonable as it
clearly does not try to mimic a performance metric in the way that a pixel
count does, but still gives a rough estimation of the amount of paint
culling going on in a page.

Covered by existing tests, modified where needed.

* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::prepareToUpdateTiles):
* platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:
(WebCore::CCOverdrawMetrics::CCOverdrawMetrics):
(WebCore::CCOverdrawMetrics::didCullTileForUpload):
(WebCore):
(WebCore::CCOverdrawMetrics::didUpload):
(WebCore::CCOverdrawMetrics::didCullForDrawing):
(WebCore::CCOverdrawMetrics::recordMetrics):
(WebCore::CCOverdrawMetrics::recordMetricsInternal):
* platform/graphics/chromium/cc/CCOverdrawMetrics.h:
(CCOverdrawMetrics):
(WebCore::CCOverdrawMetrics::pixelsCulledForDrawing):
(WebCore::CCOverdrawMetrics::pixelsUploadedOpaque):
(WebCore::CCOverdrawMetrics::pixelsUploadedTranslucent):
(WebCore::CCOverdrawMetrics::tilesCulledForUpload):
* platform/graphics/chromium/cc/CCQuadCuller.cpp:
(WebCore::CCQuadCuller::append):

Source/WebKit/chromium:

* tests/CCQuadCullerTest.cpp:
(WebCore::TEST):
* tests/TiledLayerChromiumTest.cpp:
(WTF::TEST):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp
Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.h
Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp

index 60081d4..4388ea4 100644 (file)
@@ -1,3 +1,51 @@
+2012-04-05  Dana Jansens  <danakj@chromium.org>
+
+        [chromium] Record the number of tiles paint-culled instead of the incorrect number of pixels
+        https://bugs.webkit.org/show_bug.cgi?id=82423
+
+        Reviewed by Adrienne Walker.
+
+        We currently attempt to record the number of pixels we save from uploading,
+        however the number is wrong in two ways.
+        1) An early-out if everything is culled results in nothing being reported.
+        2) With threaded-compositor, the number of pixels uploaded in one tile can be
+        changed by culling in another tile, making the number far too difficult to
+        compute to be worthwhile. If a tile was going to be partial-updated, but is
+        culled, now a new tile gets to be partial-updated instead, which affects the
+        numbers.
+
+        This patch breaks up CCOverdrawMetrics to make the methods/variables less
+        overloaded and more clear. This way they don't have to mirror each other
+        so closely on paint/draw sides.
+
+        Then we record the number of tiles for which we prevented upload via paint
+        culling. This will still over-report (a dirty culled tile stays dirty and
+        will be culled again each commit), but it seems more reasonable as it
+        clearly does not try to mimic a performance metric in the way that a pixel
+        count does, but still gives a rough estimation of the amount of paint
+        culling going on in a page.
+
+        Covered by existing tests, modified where needed.
+
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::prepareToUpdateTiles):
+        * platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:
+        (WebCore::CCOverdrawMetrics::CCOverdrawMetrics):
+        (WebCore::CCOverdrawMetrics::didCullTileForUpload):
+        (WebCore):
+        (WebCore::CCOverdrawMetrics::didUpload):
+        (WebCore::CCOverdrawMetrics::didCullForDrawing):
+        (WebCore::CCOverdrawMetrics::recordMetrics):
+        (WebCore::CCOverdrawMetrics::recordMetricsInternal):
+        * platform/graphics/chromium/cc/CCOverdrawMetrics.h:
+        (CCOverdrawMetrics):
+        (WebCore::CCOverdrawMetrics::pixelsCulledForDrawing):
+        (WebCore::CCOverdrawMetrics::pixelsUploadedOpaque):
+        (WebCore::CCOverdrawMetrics::pixelsUploadedTranslucent):
+        (WebCore::CCOverdrawMetrics::tilesCulledForUpload):
+        * platform/graphics/chromium/cc/CCQuadCuller.cpp:
+        (WebCore::CCQuadCuller::append):
+
 2012-04-05  Enrica Casucci  <enrica@apple.com>
 
         Provide a separate editing command to cleanup of redundant markup.
index 010a431..12b2c5d 100644 (file)
@@ -433,8 +433,6 @@ void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int
                 IntRect visibleTileRect = intersection(m_tiler->tileBounds(i, j), visibleLayerRect());
                 if (occlusion->occluded(this, visibleTileRect)) {
                     ASSERT(!tile->m_updated);
-                    // Save the area we culled for recording metrics.
-                    tile->m_updateRect = tile->m_dirtyRect;
                     continue;
                 }
             }
@@ -478,6 +476,8 @@ void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int
             UpdatableTile* tile = tileAt(i, j);
             if (tile->m_updated)
                 tile->copyAndClearDirty();
+            else if (!idle && occlusion && tile->isDirty())
+                occlusion->overdrawMetrics().didCullTileForUpload();
         }
     }
 
@@ -510,24 +510,14 @@ void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int
 
             IntRect tileRect = m_tiler->tileBounds(i, j);
 
+            if (!tile->m_updated)
+                continue;
+
             // Use m_updateRect as the above loop copied the dirty rect for this frame to m_updateRect.
             const IntRect& dirtyRect = tile->m_updateRect;
             if (dirtyRect.isEmpty())
                 continue;
 
-            // sourceRect starts as a full-sized tile with border texels included.
-            IntRect sourceRect = m_tiler->tileRect(tile);
-            sourceRect.intersect(dirtyRect);
-            // Paint rect not guaranteed to line up on tile boundaries, so
-            // make sure that sourceRect doesn't extend outside of it.
-            sourceRect.intersect(m_paintRect);
-
-            if (!tile->m_updated) {
-                if (occlusion)
-                    occlusion->overdrawMetrics().didCull(TransformationMatrix(), sourceRect, IntRect());
-                continue;
-            }
-
             // Save what was painted opaque in the tile. Keep the old area if the paint didn't touch it, and didn't paint some
             // other part of the tile opaque.
             IntRect tilePaintedRect = intersection(tileRect, m_paintRect);
@@ -541,13 +531,20 @@ void TiledLayerChromium::prepareToUpdateTiles(bool idle, int left, int top, int
                     tile->setOpaqueRect(tilePaintedOpaqueRect);
             }
 
+            // sourceRect starts as a full-sized tile with border texels included.
+            IntRect sourceRect = m_tiler->tileRect(tile);
+            sourceRect.intersect(dirtyRect);
+            // Paint rect not guaranteed to line up on tile boundaries, so
+            // make sure that sourceRect doesn't extend outside of it.
+            sourceRect.intersect(m_paintRect);
+
             tile->m_updateRect = sourceRect;
             if (sourceRect.isEmpty())
                 continue;
 
             tile->texture()->prepareRect(sourceRect);
             if (occlusion)
-                occlusion->overdrawMetrics().didDraw(TransformationMatrix(), sourceRect, tile->opaqueRect());
+                occlusion->overdrawMetrics().didUpload(TransformationMatrix(), sourceRect, tile->opaqueRect());
         }
     }
 }
index 1931c52..755796d 100644 (file)
@@ -40,10 +40,13 @@ namespace WebCore {
 
 CCOverdrawMetrics::CCOverdrawMetrics(bool recordMetricsForFrame)
     : m_recordMetricsForFrame(recordMetricsForFrame)
+    , m_pixelsPainted(0)
+    , m_pixelsUploadedOpaque(0)
+    , m_pixelsUploadedTranslucent(0)
+    , m_tilesCulledForUpload(0)
     , m_pixelsDrawnOpaque(0)
     , m_pixelsDrawnTranslucent(0)
-    , m_pixelsCulled(0)
-    , m_pixelsPainted(0)
+    , m_pixelsCulledForDrawing(0)
 {
 }
 
@@ -69,7 +72,25 @@ void CCOverdrawMetrics::didPaint(const IntRect& paintedRect)
     m_pixelsPainted += static_cast<float>(paintedRect.width()) * paintedRect.height();
 }
 
-void CCOverdrawMetrics::didCull(const TransformationMatrix& transformToTarget, const IntRect& beforeCullRect, const IntRect& afterCullRect)
+void CCOverdrawMetrics::didCullTileForUpload()
+{
+    if (m_recordMetricsForFrame)
+        ++m_tilesCulledForUpload;
+}
+
+void CCOverdrawMetrics::didUpload(const TransformationMatrix& transformToTarget, const IntRect& uploadRect, const IntRect& opaqueRect)
+{
+    if (!m_recordMetricsForFrame)
+        return;
+
+    float uploadArea = quadArea(transformToTarget.mapQuad(FloatQuad(uploadRect)));
+    float uploadOpaqueArea = quadArea(transformToTarget.mapQuad(FloatQuad(intersection(opaqueRect, uploadRect))));
+
+    m_pixelsUploadedOpaque += uploadOpaqueArea;
+    m_pixelsUploadedTranslucent += uploadArea - uploadOpaqueArea;
+}
+
+void CCOverdrawMetrics::didCullForDrawing(const TransformationMatrix& transformToTarget, const IntRect& beforeCullRect, const IntRect& afterCullRect)
 {
     if (!m_recordMetricsForFrame)
         return;
@@ -77,7 +98,7 @@ void CCOverdrawMetrics::didCull(const TransformationMatrix& transformToTarget, c
     float beforeCullArea = quadArea(transformToTarget.mapQuad(FloatQuad(beforeCullRect)));
     float afterCullArea = quadArea(transformToTarget.mapQuad(FloatQuad(afterCullRect)));
 
-    m_pixelsCulled += beforeCullArea - afterCullArea;
+    m_pixelsCulledForDrawing += beforeCullArea - afterCullArea;
 }
 
 void CCOverdrawMetrics::didDraw(const TransformationMatrix& transformToTarget, const IntRect& afterCullRect, const IntRect& opaqueRect)
@@ -95,61 +116,50 @@ void CCOverdrawMetrics::didDraw(const TransformationMatrix& transformToTarget, c
 void CCOverdrawMetrics::recordMetrics(const CCLayerTreeHost* layerTreeHost) const
 {
     if (m_recordMetricsForFrame)
-        recordMetricsInternal<CCLayerTreeHost>(UPLOADING, layerTreeHost);
+        recordMetricsInternal<CCLayerTreeHost>(UpdateAndCommit, layerTreeHost);
 }
 
 void CCOverdrawMetrics::recordMetrics(const CCLayerTreeHostImpl* layerTreeHost) const
 {
     if (m_recordMetricsForFrame)
-        recordMetricsInternal<CCLayerTreeHostImpl>(DRAWING, layerTreeHost);
+        recordMetricsInternal<CCLayerTreeHostImpl>(DrawingToScreen, layerTreeHost);
 }
 
 template<typename LayerTreeHostType>
 void CCOverdrawMetrics::recordMetricsInternal(MetricsType metricsType, const LayerTreeHostType* layerTreeHost) const
 {
-    const char* histogramOpaqueName = 0;
-    const char* histogramTranslucentName = 0;
-    const char* histogramCulledName = 0;
-    const char* histogramPaintedName = 0;
-    const char* cullCounterName = 0;
-    const char* opaqueCounterName = 0;
-    const char* translucentCounterName = 0;
-    const char *paintedCounterName = 0;
+    // This gives approximately 10x the percentage of pixels to fill the viewport once.
+    float normalization = 1000.f / (layerTreeHost->viewportSize().width() * layerTreeHost->viewportSize().height());
+    // This gives approximately 100x the percentage of tiles to fill the viewport once, if all tiles were 256x256.
+    float tileNormalization = 10000.f / (layerTreeHost->viewportSize().width() / 256.f * layerTreeHost->viewportSize().height() / 256.f);
+
     switch (metricsType) {
-    case DRAWING:
-        histogramOpaqueName = "Renderer4.drawPixelCountOpaque";
-        histogramTranslucentName = "Renderer4.drawPixelCountTranslucent";
-        histogramCulledName = "Renderer4.drawPixelCountCulled";
-        cullCounterName = "DrawPixelsCulled";
-        opaqueCounterName = "PixelsDrawnOpaque";
-        translucentCounterName = "PixelsDrawnTranslucent";
+    case DrawingToScreen:
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.drawPixelCountOpaque", static_cast<int>(normalization * m_pixelsDrawnOpaque), 100, 1000000, 50);
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.drawPixelCountTranslucent", static_cast<int>(normalization * m_pixelsDrawnTranslucent), 100, 1000000, 50);
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.drawPixelCountCulled", static_cast<int>(normalization * m_pixelsCulledForDrawing), 100, 1000000, 50);
+
+        {
+            TRACE_COUNTER_ID1("webkit", "DrawPixelsCulled", layerTreeHost, m_pixelsCulledForDrawing);
+            TRACE_EVENT2("webkit", "CCOverdrawMetrics", "PixelsDrawnOpaque", m_pixelsDrawnOpaque, "PixelsDrawnTranslucent", m_pixelsDrawnTranslucent);
+        }
         break;
-    case UPLOADING:
-        histogramOpaqueName = "Renderer4.uploadPixelCountOpaque";
-        histogramTranslucentName = "Renderer4.uploadPixelCountTranslucent";
-        histogramCulledName = "Renderer4.uploadPixelCountCulled";
-        histogramPaintedName = "Renderer4.pixelCountPainted";
-        cullCounterName = "UploadPixelsCulled";
-        opaqueCounterName = "PixelsUploadedOpaque";
-        translucentCounterName = "PixelsUploadedTranslucent";
-        paintedCounterName = "PixelsPainted";
+    case UpdateAndCommit:
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.pixelCountPainted", static_cast<int>(normalization * m_pixelsPainted), 100, 1000000, 50);
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.uploadPixelCountOpaque", static_cast<int>(normalization * m_pixelsUploadedOpaque), 100, 1000000, 50);
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.uploadPixelCountTranslucent", static_cast<int>(normalization * m_pixelsUploadedTranslucent), 100, 1000000, 50);
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.uploadTileCountCulled", static_cast<int>(tileNormalization * m_tilesCulledForUpload), 100, 10000000, 50);
+
+        {
+            TRACE_COUNTER_ID1("webkit", "UploadTilesCulled", layerTreeHost, m_tilesCulledForUpload);
+            TRACE_EVENT2("webkit", "CCOverdrawMetrics", "PixelsUploadedOpaque", m_pixelsUploadedOpaque, "PixelsUploadedTranslucent", m_pixelsUploadedTranslucent);
+        }
+        {
+            // This must be in a different scope than the TRACE_EVENT2 above.
+            TRACE_EVENT1("webkit", "CCOverdrawPaintMetrics", "PixelsPainted", m_pixelsPainted);
+        }
         break;
     }
-    ASSERT(histogramOpaqueName);
-
-    float normalization = 1000.f / (layerTreeHost->viewportSize().width() * layerTreeHost->viewportSize().height());
-    WebKit::Platform::current()->histogramCustomCounts(histogramOpaqueName, static_cast<int>(normalization * m_pixelsDrawnOpaque), 100, 1000000, 50);
-    WebKit::Platform::current()->histogramCustomCounts(histogramTranslucentName, static_cast<int>(normalization * m_pixelsDrawnTranslucent), 100, 1000000, 50);
-    WebKit::Platform::current()->histogramCustomCounts(histogramCulledName, static_cast<int>(normalization * m_pixelsCulled), 100, 1000000, 50);
-    if (paintedCounterName)
-        WebKit::Platform::current()->histogramCustomCounts(histogramPaintedName, static_cast<int>(normalization * m_pixelsPainted), 100, 1000000, 50);
-
-    TRACE_COUNTER_ID1("webkit", cullCounterName, layerTreeHost, m_pixelsCulled);
-    TRACE_EVENT2("webkit", "CCOverdrawMetrics", opaqueCounterName, m_pixelsDrawnOpaque, translucentCounterName, m_pixelsDrawnTranslucent);
-    if (paintedCounterName) {
-        // This must be in a different scope than the TRACE_EVENT2 above.
-        TRACE_EVENT1("webkit", "CCOverdrawPaintMetrics", paintedCounterName, m_pixelsPainted);
-    }
 }
 
 } // namespace WebCore
index f81d344..5156c3c 100644 (file)
@@ -38,12 +38,20 @@ class CCOverdrawMetrics {
 public:
     static PassOwnPtr<CCOverdrawMetrics> create(bool recordMetricsForFrame) { return adoptPtr(new CCOverdrawMetrics(recordMetricsForFrame)); }
 
+    // These methods are used for saving metrics during update/commit.
+
     // Record pixels painted by WebKit into the texture updater, but does not mean the pixels were rasterized in main memory.
     void didPaint(const IntRect& paintedRect);
+    // Records that an invalid tile was culled and did not need to be painted/uploaded, and did not contribute to other tiles needing to be painted.
+    void didCullTileForUpload();
+    // Records pixels that were uploaded to texture memory.
+    void didUpload(const TransformationMatrix& transformToTarget, const IntRect& uploadRect, const IntRect& opaqueRect);
+
+    // These methods are used for saving metrics during draw.
 
-    // Record pixels that were not uploaded/drawn to screen.
-    void didCull(const TransformationMatrix& transformToTarget, const IntRect& beforeCullRect, const IntRect& afterCullRect);
-    // Record pixels that were uploaded/drawn to screen.
+    // Record pixels that were not drawn to screen.
+    void didCullForDrawing(const TransformationMatrix& transformToTarget, const IntRect& beforeCullRect, const IntRect& afterCullRect);
+    // Record pixels that were drawn to screen.
     void didDraw(const TransformationMatrix& transformToTarget, const IntRect& afterCullRect, const IntRect& opaqueRect);
 
     void recordMetrics(const CCLayerTreeHost*) const;
@@ -52,31 +60,45 @@ public:
     // Accessors for tests.
     float pixelsDrawnOpaque() const { return m_pixelsDrawnOpaque; }
     float pixelsDrawnTranslucent() const { return m_pixelsDrawnTranslucent; }
-    float pixelsCulled() const { return m_pixelsCulled; }
+    float pixelsCulledForDrawing() const { return m_pixelsCulledForDrawing; }
     float pixelsPainted() const { return m_pixelsPainted; }
+    float pixelsUploadedOpaque() const { return m_pixelsUploadedOpaque; }
+    float pixelsUploadedTranslucent() const { return m_pixelsUploadedTranslucent; }
+    int tilesCulledForUpload() const { return m_tilesCulledForUpload; }
 
 private:
-    explicit CCOverdrawMetrics(bool recordMetricsForFrame);
-
     enum MetricsType {
-        DRAWING,
-        UPLOADING
+        UpdateAndCommit,
+        DrawingToScreen
     };
 
+    explicit CCOverdrawMetrics(bool recordMetricsForFrame);
+
     template<typename LayerTreeHostType>
     void recordMetricsInternal(MetricsType, const LayerTreeHostType*) const;
 
     // When false this class is a giant no-op.
     bool m_recordMetricsForFrame;
-    // Count of pixels that are opaque (and thus occlude). Ideally this is no more
-    // than wiewport width x height.
+
+    // These values are used for saving metrics during update/commit.
+
+    // Count of pixels that were painted due to invalidation.
+    float m_pixelsPainted;
+    // Count of pixels uploaded to textures and known to be opaque.
+    float m_pixelsUploadedOpaque;
+    // Count of pixels uploaded to textures and not known to be opaque.
+    float m_pixelsUploadedTranslucent;
+    // Count of tiles that were invalidated but not uploaded.
+    int m_tilesCulledForUpload;
+
+    // These values are used for saving metrics during draw.
+
+    // Count of pixels that are opaque (and thus occlude). Ideally this is no more than wiewport width x height.
     float m_pixelsDrawnOpaque;
     // Count of pixels that are possibly translucent, and cannot occlude.
     float m_pixelsDrawnTranslucent;
     // Count of pixels not drawn as they are occluded by somthing opaque.
-    float m_pixelsCulled;
-    // Count of pixels that were painted due to invalidation.
-    float m_pixelsPainted;
+    float m_pixelsCulledForDrawing;
 };
 
 } // namespace WebCore
index 35d1946..4701080 100644 (file)
@@ -55,7 +55,7 @@ bool CCQuadCuller::append(PassOwnPtr<CCDrawQuad> passDrawQuad)
     if (keepQuad)
         drawQuad->setQuadVisibleRect(culledRect);
 
-    m_occlusionTracker->overdrawMetrics().didCull(drawQuad->quadTransform(), drawQuad->quadRect(), culledRect);
+    m_occlusionTracker->overdrawMetrics().didCullForDrawing(drawQuad->quadTransform(), drawQuad->quadRect(), culledRect);
     m_occlusionTracker->overdrawMetrics().didDraw(drawQuad->quadTransform(), culledRect, drawQuad->opaqueRect());
 
     // Release the quad after we're done using it.
index c9139b9..1e93744 100644 (file)
@@ -1,3 +1,15 @@
+2012-04-05  Dana Jansens  <danakj@chromium.org>
+
+        [chromium] Record the number of tiles paint-culled instead of the incorrect number of pixels
+        https://bugs.webkit.org/show_bug.cgi?id=82423
+
+        Reviewed by Adrienne Walker.
+
+        * tests/CCQuadCullerTest.cpp:
+        (WebCore::TEST):
+        * tests/TiledLayerChromiumTest.cpp:
+        (WTF::TEST):
+
 2012-04-05  Shawn Singh  <shawnsingh@chromium.org>
 
         [chromium] Need to clip to homogeneous w=0 plane when applying transforms.
index aef0d6e..4562a3a 100644 (file)
@@ -110,7 +110,7 @@ TEST(CCQuadCullerTest, verifyNoCulling)
     EXPECT_EQ(quadList.size(), 13u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 130000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullChildLinesUpTopLeft)
@@ -127,7 +127,7 @@ TEST(CCQuadCullerTest, verifyCullChildLinesUpTopLeft)
     EXPECT_EQ(quadList.size(), 9u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 90000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 40000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 40000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullWhenChildOpacityNotOne)
@@ -144,7 +144,7 @@ TEST(CCQuadCullerTest, verifyCullWhenChildOpacityNotOne)
     EXPECT_EQ(quadList.size(), 13u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 90000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 40000, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullWhenChildOpaqueFlagFalse)
@@ -161,7 +161,7 @@ TEST(CCQuadCullerTest, verifyCullWhenChildOpaqueFlagFalse)
     EXPECT_EQ(quadList.size(), 13u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 90000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 40000, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullCenterTileOnly)
@@ -196,7 +196,7 @@ TEST(CCQuadCullerTest, verifyCullCenterTileOnly)
 
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 100000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 30000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 30000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullCenterTileNonIntegralSize1)
@@ -224,7 +224,7 @@ TEST(CCQuadCullerTest, verifyCullCenterTileNonIntegralSize1)
 
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 20363, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullCenterTileNonIntegralSize2)
@@ -252,7 +252,7 @@ TEST(CCQuadCullerTest, verifyCullCenterTileNonIntegralSize2)
 
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 19643, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullChildLinesUpBottomRight)
@@ -271,7 +271,7 @@ TEST(CCQuadCullerTest, verifyCullChildLinesUpBottomRight)
     EXPECT_EQ(quadList.size(), 9u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 90000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 40000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 40000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullSubRegion)
@@ -291,7 +291,7 @@ TEST(CCQuadCullerTest, verifyCullSubRegion)
     EXPECT_EQ(quadList.size(), 12u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 90000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 30000, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 10000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 10000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullSubRegion2)
@@ -311,7 +311,7 @@ TEST(CCQuadCullerTest, verifyCullSubRegion2)
     EXPECT_EQ(quadList.size(), 12u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 90000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 25000, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 15000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 15000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullSubRegionCheckOvercull)
@@ -331,7 +331,7 @@ TEST(CCQuadCullerTest, verifyCullSubRegionCheckOvercull)
     EXPECT_EQ(quadList.size(), 13u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 90000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 30000, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 10000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 10000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsDontOcclude)
@@ -351,7 +351,7 @@ TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsDontOcclude)
     EXPECT_EQ(quadList.size(), 13u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 130000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0, 1);
 }
 
 // This test requires some explanation: here we are rotating the quads to be culled.
@@ -377,7 +377,7 @@ TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsSafelyCulled)
     EXPECT_EQ(quadList.size(), 12u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 100600, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 29400, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 29400, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullOutsideScissorOverTile)
@@ -394,7 +394,7 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverTile)
     EXPECT_EQ(quadList.size(), 1u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 10000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 120000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 120000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullOutsideScissorOverCulledTile)
@@ -411,7 +411,7 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverCulledTile)
     EXPECT_EQ(quadList.size(), 1u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 10000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 120000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 120000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullOutsideScissorOverPartialTiles)
@@ -428,7 +428,7 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverPartialTiles)
     EXPECT_EQ(quadList.size(), 9u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 40000, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 90000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 90000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyCullOutsideScissorOverNoTiles)
@@ -445,7 +445,7 @@ TEST(CCQuadCullerTest, verifyCullOutsideScissorOverNoTiles)
     EXPECT_EQ(quadList.size(), 0u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 130000, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 130000, 1);
 }
 
 TEST(CCQuadCullerTest, verifyWithoutMetrics)
@@ -462,7 +462,7 @@ TEST(CCQuadCullerTest, verifyWithoutMetrics)
     EXPECT_EQ(quadList.size(), 9u);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
     EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0, 1);
-    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0, 1);
 }
 
 
index 150d65d..7604a04 100644 (file)
@@ -118,9 +118,9 @@ TEST(TiledLayerChromiumTest, pushOccludedDirtyTiles)
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     // We should have both tiles on the impl side.
     EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
@@ -136,9 +136,9 @@ TEST(TiledLayerChromiumTest, pushOccludedDirtyTiles)
     layer->updateCompositorResources(0, updater);
     layer->pushPropertiesTo(layerImpl.get());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000 + 2500, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000 + 2500, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     // We should still have both tiles, as part of the top tile is still unoccluded.
     EXPECT_TRUE(layerImpl->hasTileAt(0, 0));
@@ -994,9 +994,9 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusion)
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 330000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
+    EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
@@ -1005,9 +1005,9 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusion)
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(36-2, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 330000 + 340000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000 + 20000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000 + 340000, 1);
+    EXPECT_EQ(3 + 2, occluded.overdrawMetrics().tilesCulledForUpload());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
@@ -1016,9 +1016,9 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusion)
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(36, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 330000 + 340000 + 360000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000 + 20000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000 + 340000 + 360000, 1);
+    EXPECT_EQ(3 + 2, occluded.overdrawMetrics().tilesCulledForUpload());
 }
 
 TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
@@ -1036,12 +1036,12 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
     occluded.setOcclusion(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);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 360), &occluded);
     EXPECT_EQ(24-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 210000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 210000, 1);
+    EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
@@ -1049,12 +1049,12 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
     occluded.setOcclusion(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);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 350), &occluded);
     EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 210000 + 180000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000 + 60000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 210000 + 180000, 1);
+    EXPECT_EQ(3 + 6, occluded.overdrawMetrics().tilesCulledForUpload());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
@@ -1062,12 +1062,12 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndVisiblityConstraints)
     occluded.setOcclusion(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);
+    layer->prepareToUpdate(IntRect(0, 0, 600, 340), &occluded);
     EXPECT_EQ(24-6, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 210000 + 180000 + 180000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000 + 60000 + 60000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 210000 + 180000 + 180000, 1);
+    EXPECT_EQ(3 + 6 + 6, occluded.overdrawMetrics().tilesCulledForUpload());
 
 }
 
@@ -1088,19 +1088,19 @@ TEST(TiledLayerChromiumTest, tilesNotPaintedWithoutInvalidation)
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 330000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
+    EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
-    // Repaint without marking it dirty.
+    // Repaint without marking it dirty. The culled tiles remained dirty.
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(0, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 330000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
+    EXPECT_EQ(6, occluded.overdrawMetrics().tilesCulledForUpload());
 }
 
 TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms)
@@ -1125,9 +1125,9 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndTransforms)
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(36-3, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 330000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 30000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 330000, 1);
+    EXPECT_EQ(3, occluded.overdrawMetrics().tilesCulledForUpload());
 }
 
 TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
@@ -1154,9 +1154,9 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
     // number of tiles 3x3.
     EXPECT_EQ(9, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 90000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 90000, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
@@ -1169,9 +1169,9 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 90000 + 80000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 10000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 90000 + 80000, 1);
+    EXPECT_EQ(1, occluded.overdrawMetrics().tilesCulledForUpload());
 
     layer->fakeLayerTextureUpdater()->clearPrepareRectCount();
 
@@ -1187,9 +1187,9 @@ TEST(TiledLayerChromiumTest, tilesPaintedWithOcclusionAndScaling)
     layer->prepareToUpdate(IntRect(0, 0, 600, 600), &occluded);
     EXPECT_EQ(9-1, layer->fakeLayerTextureUpdater()->prepareRectCount());
 
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 90000 + 80000 + 80000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 10000 + 10000, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 90000 + 80000 + 80000, 1);
+    EXPECT_EQ(1 + 1, occluded.overdrawMetrics().tilesCulledForUpload());
 }
 
 TEST(TiledLayerChromiumTest, visibleContentOpaqueRegion)
@@ -1219,9 +1219,9 @@ TEST(TiledLayerChromiumTest, visibleContentOpaqueRegion)
     EXPECT_TRUE(opaqueContents.isEmpty());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     // visibleContentOpaqueRegion should match the visible part of what is painted opaque.
     opaquePaintRect = IntRect(10, 10, 90, 190);
@@ -1233,9 +1233,9 @@ TEST(TiledLayerChromiumTest, visibleContentOpaqueRegion)
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000 * 2, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 17100, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000 + 20000 - 17100, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 17100, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000 + 20000 - 17100, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     // If we paint again without invalidating, the same stuff should be opaque.
     layer->fakeLayerTextureUpdater()->setOpaquePaintRect(IntRect());
@@ -1245,9 +1245,9 @@ TEST(TiledLayerChromiumTest, visibleContentOpaqueRegion)
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000 * 2, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 17100, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000 + 20000 - 17100, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 17100, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000 + 20000 - 17100, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     // If we repaint a non-opaque part of the tile, then it shouldn't lose its opaque-ness. And other tiles should
     // not be affected.
@@ -1259,9 +1259,9 @@ TEST(TiledLayerChromiumTest, visibleContentOpaqueRegion)
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000 * 2 + 1, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 17100, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000 + 20000 - 17100 + 1, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 17100, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000 + 20000 - 17100 + 1, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     // If we repaint an opaque part of the tile, then it should lose its opaque-ness. But other tiles should still
     // not be affected.
@@ -1273,9 +1273,16 @@ TEST(TiledLayerChromiumTest, visibleContentOpaqueRegion)
     EXPECT_EQ(1u, opaqueContents.rects().size());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000 * 2 + 1  + 1, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 17100, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 20000 + 20000 - 17100 + 1 + 1, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 17100, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000 + 20000 - 17100 + 1 + 1, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
+
+    // No metrics are recorded in prepaint, so the values should not change from above.
+    layer->prepareToUpdateIdle(contentBounds, &occluded);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 20000 * 2 + 1  + 1, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 17100, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 20000 + 20000 - 17100 + 1 + 1, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 }
 
 TEST(TiledLayerChromiumTest, pixelsPaintedMetrics)
@@ -1305,9 +1312,9 @@ TEST(TiledLayerChromiumTest, pixelsPaintedMetrics)
     EXPECT_TRUE(opaqueContents.isEmpty());
 
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 30000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 30000, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 30000, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 
     // Invalidates an area on the top and bottom tile, which will cause us to paint the tile in the middle,
     // even though it is not dirty and will not be uploaded.
@@ -1321,9 +1328,9 @@ TEST(TiledLayerChromiumTest, pixelsPaintedMetrics)
     // The middle tile was painted even though not invalidated.
     EXPECT_NEAR(occluded.overdrawMetrics().pixelsPainted(), 30000 + 60 * 210, 1);
     // The pixels uploaded will not include the non-invalidated tile in the middle.
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnOpaque(), 0, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsDrawnTranslucent(), 30000 + 1 + 100, 1);
-    EXPECT_NEAR(occluded.overdrawMetrics().pixelsCulled(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedOpaque(), 0, 1);
+    EXPECT_NEAR(occluded.overdrawMetrics().pixelsUploadedTranslucent(), 30000 + 1 + 100, 1);
+    EXPECT_EQ(0, occluded.overdrawMetrics().tilesCulledForUpload());
 }
 
 } // namespace