| 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" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 int height, | 62 int height, |
| 63 bool overdrawViz, | 63 bool overdrawViz, |
| 64 bool overrideFilterQuality, | 64 bool overrideFilterQuality, |
| 65 SkFilterQuality quality) | 65 SkFilterQuality quality) |
| 66 : INHERITED(width, height) | 66 : INHERITED(width, height) |
| 67 , fOverdrawXfermode(overdrawViz ? new OverdrawXfermode : nullptr) | 67 , fOverdrawXfermode(overdrawViz ? new OverdrawXfermode : nullptr) |
| 68 , fOverrideFilterQuality(overrideFilterQuality) | 68 , fOverrideFilterQuality(overrideFilterQuality) |
| 69 , fFilterQuality(quality) {} | 69 , fFilterQuality(quality) {} |
| 70 | 70 |
| 71 protected: | 71 protected: |
| 72 void onFilterPaint(SkPaint* paint, Type) const override { | 72 bool onFilter(SkPaint* paint, Type) const override { |
| 73 if (nullptr != fOverdrawXfermode.get()) { | 73 if (paint) { |
| 74 paint->setAntiAlias(false); | 74 if (nullptr != fOverdrawXfermode.get()) { |
| 75 paint->setXfermode(fOverdrawXfermode.get()); | 75 paint->setAntiAlias(false); |
| 76 paint->setXfermode(fOverdrawXfermode.get()); |
| 77 } |
| 78 |
| 79 if (fOverrideFilterQuality) { |
| 80 paint->setFilterQuality(fFilterQuality); |
| 81 } |
| 76 } | 82 } |
| 77 | 83 return true; |
| 78 if (fOverrideFilterQuality) { | |
| 79 paint->setFilterQuality(fFilterQuality); | |
| 80 } | |
| 81 } | 84 } |
| 82 | 85 |
| 83 void onDrawPicture(const SkPicture* picture, | 86 void onDrawPicture(const SkPicture* picture, |
| 84 const SkMatrix* matrix, | 87 const SkMatrix* matrix, |
| 85 const SkPaint* paint) override { | 88 const SkPaint* paint) override { |
| 86 // We need to replay the picture onto this canvas in order to filter its
internal paints. | 89 // We need to replay the picture onto this canvas in order to filter its
internal paints. |
| 87 this->SkCanvas::onDrawPicture(picture, matrix, paint); | 90 this->SkCanvas::onDrawPicture(picture, matrix, paint); |
| 88 } | 91 } |
| 89 | 92 |
| 90 private: | 93 private: |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 } | 661 } |
| 659 | 662 |
| 660 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 663 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
| 661 if (fCalledAddStackData) { | 664 if (fCalledAddStackData) { |
| 662 fClipStackData.appendf("<br>"); | 665 fClipStackData.appendf("<br>"); |
| 663 addPathData(devPath, "pathOut"); | 666 addPathData(devPath, "pathOut"); |
| 664 return true; | 667 return true; |
| 665 } | 668 } |
| 666 return false; | 669 return false; |
| 667 } | 670 } |
| OLD | NEW |