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 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
11 #include "SkColorMatrixFilter.h" | 11 #include "SkColorMatrixFilter.h" |
12 #include "SkDevice.h" | 12 #include "SkDevice.h" |
13 #include "SkColorFilter.h" | 13 #include "SkColorFilter.h" |
14 #include "SkReadBuffer.h" | 14 #include "SkReadBuffer.h" |
15 #include "SkTableColorFilter.h" | 15 #include "SkTableColorFilter.h" |
16 #include "SkWriteBuffer.h" | 16 #include "SkWriteBuffer.h" |
17 | 17 |
18 SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf, | 18 SkImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf, SkImageFilter
* input, |
19 SkImageFilter* input, const CropRect* cropRect) { | 19 const CropRect* cropRect) { |
20 if (nullptr == cf) { | 20 if (nullptr == cf) { |
21 return nullptr; | 21 return nullptr; |
22 } | 22 } |
23 | 23 |
24 SkColorFilter* inputCF; | 24 SkColorFilter* inputCF; |
25 if (input && input->isColorFilterNode(&inputCF)) { | 25 if (input && input->isColorFilterNode(&inputCF)) { |
26 // This is an optimization, as it collapses the hierarchy by just combin
ing the two | 26 // This is an optimization, as it collapses the hierarchy by just combin
ing the two |
27 // colorfilters into a single one, which the new imagefilter will wrap. | 27 // colorfilters into a single one, which the new imagefilter will wrap. |
28 SkAutoUnref autoUnref(inputCF); | 28 SkAutoUnref autoUnref(inputCF); |
29 SkAutoTUnref<SkColorFilter> newCF(SkColorFilter::CreateComposeFilter(cf,
inputCF)); | 29 SkAutoTUnref<SkColorFilter> newCF(SkColorFilter::CreateComposeFilter(cf,
inputCF)); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 if (this->getInput(0)) { | 111 if (this->getInput(0)) { |
112 this->getInput(0)->toString(str); | 112 this->getInput(0)->toString(str); |
113 } | 113 } |
114 | 114 |
115 str->appendf(") color filter: "); | 115 str->appendf(") color filter: "); |
116 fColorFilter->toString(str); | 116 fColorFilter->toString(str); |
117 | 117 |
118 str->append(")"); | 118 str->append(")"); |
119 } | 119 } |
120 #endif | 120 #endif |
OLD | NEW |