Index: cc/paint/test_skcanvas.h |
diff --git a/cc/paint/test_skcanvas.h b/cc/paint/test_skcanvas.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6047691e6527ee2bbfa8dc219d707333e0a6e3a3 |
--- /dev/null |
+++ b/cc/paint/test_skcanvas.h |
@@ -0,0 +1,29 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
vmpstr
2017/04/12 21:47:12
nit: Should this be in cc/test?
enne (OOO)
2017/04/12 22:41:30
If anything outside of cc/paint uses it, sure? Do
danakj
2017/04/13 15:56:27
Ya test-only files should be in cc/test, the cc_te
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_PAINT_TEST_SKCANVAS_H_ |
+#define CC_PAINT_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: willSave() does not appear to be called from SkCanvas on a |
vmpstr
2017/04/12 21:47:12
There's a getSaveLayerStrategy() that gets called
mtklein_C
2017/04/12 22:32:00
Right. save() != saveLayer(). The virtual hook f
enne (OOO)
2017/04/12 22:41:30
Ah thanks, I didn't quite see that. I added this
|
+ // saveLayer, but willRestore is, so track that. |
+ void willRestore() override; |
+ void onDrawRect(const SkRect& rect, const SkPaint& paint) override; |
+ |
+ int restore_count_ = 0; |
+ SkRect draw_rect_; |
+ SkPaint paint_; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_PAINT_TEST_SKCANVAS_H_ |