OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkColorFilterImageFilter.h" | 8 #include "SkColorFilterImageFilter.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf, | 37 SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf, |
38 SkImageFilter* input, | 38 SkImageFilter* input, |
39 const CropRect* cropRect) | 39 const CropRect* cropRect) |
40 : INHERITED(1, &input, cropRect) | 40 : INHERITED(1, &input, cropRect) |
41 , fColorFilter(SkRef(cf)) { | 41 , fColorFilter(SkRef(cf)) { |
42 } | 42 } |
43 | 43 |
44 SkFlattenable* SkColorFilterImageFilter::CreateProc(SkReadBuffer& buffer) { | 44 SkFlattenable* SkColorFilterImageFilter::CreateProc(SkReadBuffer& buffer) { |
45 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 45 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
46 sk_sp<SkColorFilter> cf(buffer.readColorFilter()); | 46 sk_sp<SkColorFilter> cf(buffer.readColorFilter()); |
47 return Create(cf.get(), common.getInput(0), &common.cropRect()); | 47 return Create(cf.get(), common.getInput(0).get(), &common.cropRect()); |
48 } | 48 } |
49 | 49 |
50 void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const { | 50 void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const { |
51 this->INHERITED::flatten(buffer); | 51 this->INHERITED::flatten(buffer); |
52 buffer.writeFlattenable(fColorFilter.get()); | 52 buffer.writeFlattenable(fColorFilter.get()); |
53 } | 53 } |
54 | 54 |
55 sk_sp<SkSpecialImage> SkColorFilterImageFilter::onFilterImage(SkSpecialImage* so
urce, | 55 sk_sp<SkSpecialImage> SkColorFilterImageFilter::onFilterImage(SkSpecialImage* so
urce, |
56 const Context& ctx
, | 56 const Context& ctx
, |
57 SkIPoint* offset)
const { | 57 SkIPoint* offset)
const { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if (this->getInput(0)) { | 122 if (this->getInput(0)) { |
123 this->getInput(0)->toString(str); | 123 this->getInput(0)->toString(str); |
124 } | 124 } |
125 | 125 |
126 str->appendf(") color filter: "); | 126 str->appendf(") color filter: "); |
127 fColorFilter->toString(str); | 127 fColorFilter->toString(str); |
128 | 128 |
129 str->append(")"); | 129 str->append(")"); |
130 } | 130 } |
131 #endif | 131 #endif |
OLD | NEW |