[chromium] Move overdraw metrics into a templated class for both paint and draw metrics.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 00:45:26 +0000 (00:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 00:45:26 +0000 (00:45 +0000)
commit081bf36f004824c77c87afcf821ad69f773cb86a
treec4a35b3a98b44c75afec3d6738496bea2a73206f
parentb5625a66c7c6ce89811aefd317a909e4b3eb3c50
[chromium] Move overdraw metrics into a templated class for both paint and draw metrics.
https://bugs.webkit.org/show_bug.cgi?id=81156

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

Source/WebCore:

Creates CCOverdrawMetrics which can be called to inform it about
draws/paints. At the end of the frame, the CCOverdrawMetrics
recordMetrics() method will put its data into histograms, a
TRACE_COUNTER for culling information, and a TRACE_EVENT for details
about the number of opaque/translucent pixels.

Covered by existing tests.

* WebCore.gypi:
* platform/chromium/TraceEvent.h:
(TraceEvent):
(WebCore::TraceEvent::addTraceEvent):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
* platform/graphics/chromium/cc/CCOverdrawMetrics.cpp: Added.
(WebCore):
(WebCore::CCOverdrawMetrics::CCOverdrawMetrics):
(WebCore::wedgeProduct):
(WebCore::quadArea):
(WebCore::CCOverdrawMetrics::didDraw):
(WebCore::CCOverdrawMetrics::recordMetrics):
(WebCore::CCOverdrawMetrics::recordMetricsInternal):
* platform/graphics/chromium/cc/CCOverdrawMetrics.h: Added.
(WebCore):
(CCOverdrawMetrics):
(WebCore::CCOverdrawMetrics::pixelsDrawnOpaque):
(WebCore::CCOverdrawMetrics::pixelsDrawnTranslucent):
(WebCore::CCOverdrawMetrics::pixelsCulled):
* platform/graphics/chromium/cc/CCQuadCuller.cpp:
(WebCore::CCQuadCuller::CCQuadCuller):
(WebCore::CCQuadCuller::append):
* platform/graphics/chromium/cc/CCQuadCuller.h:
(WebCore):
(CCQuadCuller):
* platform/graphics/chromium/cc/CCRenderPass.cpp:
(WebCore::CCRenderPass::appendQuadsForLayer):
* platform/graphics/chromium/cc/CCRenderPass.h:
(WebCore):
(CCRenderPass):

Source/WebKit/chromium:

* tests/CCQuadCullerTest.cpp:
(WebCore::appendQuads):
(WebCore):
(WebCore::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCOverdrawMetrics.h [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h
Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCQuadCullerTest.cpp