OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkPaintImageFilter.h" | 8 #include "SkPaintImageFilter.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 inverse.mapRect(&rect); | 59 inverse.mapRect(&rect); |
60 } | 60 } |
61 canvas->setMatrix(matrix); | 61 canvas->setMatrix(matrix); |
62 canvas->drawRect(rect, fPaint); | 62 canvas->drawRect(rect, fPaint); |
63 | 63 |
64 offset->fX = bounds.fLeft; | 64 offset->fX = bounds.fLeft; |
65 offset->fY = bounds.fTop; | 65 offset->fY = bounds.fTop; |
66 return surf->makeImageSnapshot(); | 66 return surf->makeImageSnapshot(); |
67 } | 67 } |
68 | 68 |
69 bool SkPaintImageFilter::canComputeFastBounds() const { | 69 bool SkPaintImageFilter::affectsTransparentBlack() const { |
70 // http:skbug.com/4627: "make computeFastBounds and onFilterBounds() CropRec
t-aware" | 70 return true; |
71 // computeFastBounds() doesn't currently take the crop rect into account, | |
72 // so we can't compute it. If a full crop rect is set, we should return true
here. | |
73 return false; | |
74 } | 71 } |
75 | 72 |
76 #ifndef SK_IGNORE_TO_STRING | 73 #ifndef SK_IGNORE_TO_STRING |
77 void SkPaintImageFilter::toString(SkString* str) const { | 74 void SkPaintImageFilter::toString(SkString* str) const { |
78 str->appendf("SkPaintImageFilter: ("); | 75 str->appendf("SkPaintImageFilter: ("); |
79 fPaint.toString(str); | 76 fPaint.toString(str); |
80 str->append(")"); | 77 str->append(")"); |
81 } | 78 } |
82 #endif | 79 #endif |
OLD | NEW |