OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkClipStack.h" | 8 #include "SkClipStack.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkDebugCanvas.h" | 10 #include "SkDebugCanvas.h" |
11 #include "SkDrawCommand.h" | 11 #include "SkDrawCommand.h" |
12 #include "SkDevice.h" | 12 #include "SkDevice.h" |
13 #include "SkPaintFilterCanvas.h" | 13 #include "SkPaintFilterCanvas.h" |
14 #include "SkXfermode.h" | 14 #include "SkXfermode.h" |
15 #include "SkValue.h" | |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 class OverdrawXfermode : public SkXfermode { | 19 class OverdrawXfermode : public SkXfermode { |
19 public: | 20 public: |
20 SkPMColor xferColor(SkPMColor src, SkPMColor dst) const override { | 21 SkPMColor xferColor(SkPMColor src, SkPMColor dst) const override { |
21 // This table encodes the color progression of the overdraw visualizatio n | 22 // This table encodes the color progression of the overdraw visualizatio n |
22 static const SkPMColor gTable[] = { | 23 static const SkPMColor gTable[] = { |
23 SkPackARGB32(0x00, 0x00, 0x00, 0x00), | 24 SkPackARGB32(0x00, 0x00, 0x00, 0x00), |
24 SkPackARGB32(0xFF, 128, 158, 255), | 25 SkPackARGB32(0xFF, 128, 158, 255), |
(...skipping 22 matching lines...) Expand all Loading... | |
47 ++idx; | 48 ++idx; |
48 SkASSERT(idx < (int)SK_ARRAY_COUNT(gTable)); | 49 SkASSERT(idx < (int)SK_ARRAY_COUNT(gTable)); |
49 | 50 |
50 return gTable[idx]; | 51 return gTable[idx]; |
51 } | 52 } |
52 | 53 |
53 Factory getFactory() const override { return nullptr; } | 54 Factory getFactory() const override { return nullptr; } |
54 #ifndef SK_IGNORE_TO_STRING | 55 #ifndef SK_IGNORE_TO_STRING |
55 void toString(SkString* str) const override { str->set("OverdrawXfermode"); } | 56 void toString(SkString* str) const override { str->set("OverdrawXfermode"); } |
56 #endif | 57 #endif |
58 // We don't serialize this xfermode. | |
59 SkValue asValue() const override { return SkValue(); } | |
mtklein
2016/01/15 17:26:20
Let's make this the default impl on SkXfermode, at
hal.canary
2016/01/15 19:44:31
done. I'll do this with all of the SkFooPaintEffe
| |
57 }; | 60 }; |
58 | 61 |
59 class DebugPaintFilterCanvas : public SkPaintFilterCanvas { | 62 class DebugPaintFilterCanvas : public SkPaintFilterCanvas { |
60 public: | 63 public: |
61 DebugPaintFilterCanvas(int width, | 64 DebugPaintFilterCanvas(int width, |
62 int height, | 65 int height, |
63 bool overdrawViz, | 66 bool overdrawViz, |
64 bool overrideFilterQuality, | 67 bool overrideFilterQuality, |
65 SkFilterQuality quality) | 68 SkFilterQuality quality) |
66 : INHERITED(width, height) | 69 : INHERITED(width, height) |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
661 } | 664 } |
662 | 665 |
663 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 666 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
664 if (fCalledAddStackData) { | 667 if (fCalledAddStackData) { |
665 fClipStackData.appendf("<br>"); | 668 fClipStackData.appendf("<br>"); |
666 addPathData(devPath, "pathOut"); | 669 addPathData(devPath, "pathOut"); |
667 return true; | 670 return true; |
668 } | 671 } |
669 return false; | 672 return false; |
670 } | 673 } |
OLD | NEW |