OLD | NEW |
---|---|
(Empty) | |
1 // 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
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_PAINT_TEST_SKCANVAS_H_ | |
6 #define CC_PAINT_TEST_SKCANVAS_H_ | |
7 | |
8 #include "third_party/skia/include/core/SkCanvas.h" | |
9 #include "third_party/skia/include/utils/SkNoDrawCanvas.h" | |
10 | |
11 namespace cc { | |
12 | |
13 class SaveCountingCanvas : public SkNoDrawCanvas { | |
14 public: | |
15 SaveCountingCanvas(); | |
16 | |
17 // 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
| |
18 // saveLayer, but willRestore is, so track that. | |
19 void willRestore() override; | |
20 void onDrawRect(const SkRect& rect, const SkPaint& paint) override; | |
21 | |
22 int restore_count_ = 0; | |
23 SkRect draw_rect_; | |
24 SkPaint paint_; | |
25 }; | |
26 | |
27 } // namespace cc | |
28 | |
29 #endif // CC_PAINT_TEST_SKCANVAS_H_ | |
OLD | NEW |