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

Unified Diff: cc/test/test_skcanvas.cc

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: Rebase Created 3 years, 8 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: cc/test/test_skcanvas.cc
diff --git a/cc/test/test_skcanvas.cc b/cc/test/test_skcanvas.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e45f42de45b109888f2f2c959d9546f58a462414
--- /dev/null
+++ b/cc/test/test_skcanvas.cc
@@ -0,0 +1,26 @@
+// Copyright 2017 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 "cc/test/test_skcanvas.h"
+
+namespace cc {
+
+SaveCountingCanvas::SaveCountingCanvas() : SkNoDrawCanvas(100, 100) {}
+
+SkCanvas::SaveLayerStrategy SaveCountingCanvas::getSaveLayerStrategy(
+ const SaveLayerRec& rec) {
+ save_count_++;
+ return SkNoDrawCanvas::getSaveLayerStrategy(rec);
+}
+
+void SaveCountingCanvas::willRestore() {
+ restore_count_++;
+}
+
+void SaveCountingCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+ draw_rect_ = rect;
+ paint_ = paint;
+}
+
+} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698