| 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" |
| 11 #include "SkSpecialImage.h" | 11 #include "SkSpecialImage.h" |
| 12 #include "SkSpecialSurface.h" | 12 #include "SkSpecialSurface.h" |
| 13 #include "SkWriteBuffer.h" | 13 #include "SkWriteBuffer.h" |
| 14 | 14 |
| 15 SkPaintImageFilter::SkPaintImageFilter(const SkPaint& paint, const CropRect* cro
pRect) | 15 SkPaintImageFilter::SkPaintImageFilter(const SkPaint& paint, const CropRect* cro
pRect) |
| 16 : INHERITED(nullptr, 0, cropRect) | 16 : INHERITED(nullptr, 0, cropRect) |
| 17 , fPaint(paint) { | 17 , fPaint(paint) { |
| 18 } | 18 } |
| 19 | 19 |
| 20 SkFlattenable* SkPaintImageFilter::CreateProc(SkReadBuffer& buffer) { | 20 sk_sp<SkFlattenable> SkPaintImageFilter::CreateProc(SkReadBuffer& buffer) { |
| 21 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); | 21 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); |
| 22 SkPaint paint; | 22 SkPaint paint; |
| 23 buffer.readPaint(&paint); | 23 buffer.readPaint(&paint); |
| 24 return SkPaintImageFilter::Make(paint, &common.cropRect()).release(); | 24 return SkPaintImageFilter::Make(paint, &common.cropRect()); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const { | 27 void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const { |
| 28 this->INHERITED::flatten(buffer); | 28 this->INHERITED::flatten(buffer); |
| 29 buffer.writePaint(fPaint); | 29 buffer.writePaint(fPaint); |
| 30 } | 30 } |
| 31 | 31 |
| 32 sk_sp<SkSpecialImage> SkPaintImageFilter::onFilterImage(SkSpecialImage* source, | 32 sk_sp<SkSpecialImage> SkPaintImageFilter::onFilterImage(SkSpecialImage* source, |
| 33 const Context& ctx, | 33 const Context& ctx, |
| 34 SkIPoint* offset) const
{ | 34 SkIPoint* offset) const
{ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return true; | 70 return true; |
| 71 } | 71 } |
| 72 | 72 |
| 73 #ifndef SK_IGNORE_TO_STRING | 73 #ifndef SK_IGNORE_TO_STRING |
| 74 void SkPaintImageFilter::toString(SkString* str) const { | 74 void SkPaintImageFilter::toString(SkString* str) const { |
| 75 str->appendf("SkPaintImageFilter: ("); | 75 str->appendf("SkPaintImageFilter: ("); |
| 76 fPaint.toString(str); | 76 fPaint.toString(str); |
| 77 str->append(")"); | 77 str->append(")"); |
| 78 } | 78 } |
| 79 #endif | 79 #endif |
| OLD | NEW |