| 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 |
| 59 SkValue represent() const override { |
| 60 return SkValue::Object(SkValue::OverdrawXfermode); |
| 61 } |
| 57 }; | 62 }; |
| 58 | 63 |
| 59 class DebugPaintFilterCanvas : public SkPaintFilterCanvas { | 64 class DebugPaintFilterCanvas : public SkPaintFilterCanvas { |
| 60 public: | 65 public: |
| 61 DebugPaintFilterCanvas(int width, | 66 DebugPaintFilterCanvas(int width, |
| 62 int height, | 67 int height, |
| 63 bool overdrawViz, | 68 bool overdrawViz, |
| 64 bool overrideFilterQuality, | 69 bool overrideFilterQuality, |
| 65 SkFilterQuality quality) | 70 SkFilterQuality quality) |
| 66 : INHERITED(width, height) | 71 : INHERITED(width, height) |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 } | 666 } |
| 662 | 667 |
| 663 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 668 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
| 664 if (fCalledAddStackData) { | 669 if (fCalledAddStackData) { |
| 665 fClipStackData.appendf("<br>"); | 670 fClipStackData.appendf("<br>"); |
| 666 addPathData(devPath, "pathOut"); | 671 addPathData(devPath, "pathOut"); |
| 667 return true; | 672 return true; |
| 668 } | 673 } |
| 669 return false; | 674 return false; |
| 670 } | 675 } |
| OLD | NEW |