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

Unified Diff: cc/test/test_skcanvas.h

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.h
diff --git a/cc/test/test_skcanvas.h b/cc/test/test_skcanvas.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b130a4ccee6e324993400662679781db04d339a
--- /dev/null
+++ b/cc/test/test_skcanvas.h
@@ -0,0 +1,31 @@
+// 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.
+
+#ifndef CC_TEST_TEST_SKCANVAS_H_
+#define CC_TEST_TEST_SKCANVAS_H_
+
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/utils/SkNoDrawCanvas.h"
+
+namespace cc {
+
+class SaveCountingCanvas : public SkNoDrawCanvas {
+ public:
+ SaveCountingCanvas();
+
+ // Note: getSaveLayerStrategy is used as "willSave", as willSave
+ // is not always called.
+ SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec& rec) override;
+ void willRestore() override;
+ void onDrawRect(const SkRect& rect, const SkPaint& paint) override;
+
+ int save_count_ = 0;
+ int restore_count_ = 0;
+ SkRect draw_rect_;
+ SkPaint paint_;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_TEST_SKCANVAS_H_

Powered by Google App Engine
This is Rietveld 408576698