OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkAlphaThresholdFilter.h" | 8 #include "SkAlphaThresholdFilter.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 sk_sp<GrFragmentProcessor> fp(GrAlphaThresholdFragmentProcessor::Make( | 170 sk_sp<GrFragmentProcessor> fp(GrAlphaThresholdFragmentProcessor::Make( |
171 inputTexture.
get(), | 171 inputTexture.
get(), |
172 maskTexture.g
et(), | 172 maskTexture.g
et(), |
173 fInnerThresho
ld, | 173 fInnerThresho
ld, |
174 fOuterThresho
ld, | 174 fOuterThresho
ld, |
175 bounds)); | 175 bounds)); |
176 if (!fp) { | 176 if (!fp) { |
177 return nullptr; | 177 return nullptr; |
178 } | 178 } |
179 | 179 |
180 return DrawWithFP(context, std::move(fp), bounds, sk_ref_sp(input->getCo
lorSpace())); | 180 return DrawWithFP(context, std::move(fp), bounds, ctx.outputProperties()
); |
181 } | 181 } |
182 #endif | 182 #endif |
183 | 183 |
184 SkBitmap inputBM; | 184 SkBitmap inputBM; |
185 | 185 |
186 if (!input->getROPixels(&inputBM)) { | 186 if (!input->getROPixels(&inputBM)) { |
187 return nullptr; | 187 return nullptr; |
188 } | 188 } |
189 | 189 |
190 if (inputBM.colorType() != kN32_SkColorType) { | 190 if (inputBM.colorType() != kN32_SkColorType) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 dst); | 256 dst); |
257 } | 257 } |
258 | 258 |
259 #ifndef SK_IGNORE_TO_STRING | 259 #ifndef SK_IGNORE_TO_STRING |
260 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 260 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
261 str->appendf("SkAlphaThresholdImageFilter: ("); | 261 str->appendf("SkAlphaThresholdImageFilter: ("); |
262 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 262 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
263 str->append(")"); | 263 str->append(")"); |
264 } | 264 } |
265 #endif | 265 #endif |
OLD | NEW |