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

Unified Diff: Source/platform/graphics/InterceptingCanvas.cpp

Issue 1183863005: Paint Profiler: unroll SkPictures (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/InterceptingCanvas.cpp
diff --git a/Source/platform/graphics/InterceptingCanvas.cpp b/Source/platform/graphics/InterceptingCanvas.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..66907aa665dcbb315e35ba713c1ac9644836c8de
--- /dev/null
+++ b/Source/platform/graphics/InterceptingCanvas.cpp
@@ -0,0 +1,29 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/graphics/InterceptingCanvas.h"
+
+namespace blink {
+
+void InterceptingCanvasBase::unrollDrawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint, SkPicture::AbortCallback* abortCallback)
+{
+ int saveCount = this->getSaveCount();
+ if (paint) {
+ SkRect newBounds = picture->cullRect();
f(malita) 2015/06/17 18:20:56 Nit: the 'bounds' saveLayer arg is optional, so I
caseq 2015/06/17 18:29:47 Would it be the same performance-wise? I was think
f(malita) 2015/06/17 18:41:56 It defaults to using the current clip bounds, but
+ if (matrix)
+ matrix->mapRect(&newBounds);
+ this->saveLayer(&newBounds, paint);
+ } else if (matrix) {
+ this->save();
+ }
+ if (matrix)
+ this->concat(*matrix);
+
+ picture->playback(this, abortCallback);
+
+ this->restoreToCount(saveCount);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698