Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Side by Side Diff: cc/CanvasLayerTextureUpdater.cpp

Issue 10982078: Adding hooks for gathering total pixels painted and rasterized stats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #include "config.h" 6 #include "config.h"
7 7
8 #if USE(ACCELERATED_COMPOSITING) 8 #if USE(ACCELERATED_COMPOSITING)
9 9
10 #include "CanvasLayerTextureUpdater.h" 10 #include "CanvasLayerTextureUpdater.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 SkRect layerSkRect = SkRect::MakeXYWH(layerRect.x(), layerRect.y(), layerRec t.width(), layerRect.height()); 52 SkRect layerSkRect = SkRect::MakeXYWH(layerRect.x(), layerRect.y(), layerRec t.width(), layerRect.height());
53 canvas->drawRect(layerSkRect, paint); 53 canvas->drawRect(layerSkRect, paint);
54 canvas->clipRect(layerSkRect); 54 canvas->clipRect(layerSkRect);
55 55
56 FloatRect opaqueLayerRect; 56 FloatRect opaqueLayerRect;
57 double paintBeginTime = monotonicallyIncreasingTime(); 57 double paintBeginTime = monotonicallyIncreasingTime();
58 m_painter->paint(canvas, layerRect, opaqueLayerRect); 58 m_painter->paint(canvas, layerRect, opaqueLayerRect);
59 stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginT ime; 59 stats.totalPaintTimeInSeconds += monotonicallyIncreasingTime() - paintBeginT ime;
60 canvas->restore(); 60 canvas->restore();
61 61
62 stats.totalPixelsPainted += contentRect.width() * contentRect.height();
63
62 FloatRect opaqueContentRect = opaqueLayerRect; 64 FloatRect opaqueContentRect = opaqueLayerRect;
63 opaqueContentRect.scale(contentsWidthScale, contentsHeightScale); 65 opaqueContentRect.scale(contentsWidthScale, contentsHeightScale);
64 resultingOpaqueRect = enclosedIntRect(opaqueContentRect); 66 resultingOpaqueRect = enclosedIntRect(opaqueContentRect);
65 67
66 m_contentRect = contentRect; 68 m_contentRect = contentRect;
67 } 69 }
68 70
69 } // namespace cc 71 } // namespace cc
70 #endif // USE(ACCELERATED_COMPOSITING) 72 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698