| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 sk_sp<GrFragmentProcessor> fp(GrAlphaThresholdFragmentProcessor::Make( | 173 sk_sp<GrFragmentProcessor> fp(GrAlphaThresholdFragmentProcessor::Make( |
| 174 inputTexture.
get(), | 174 inputTexture.
get(), |
| 175 maskTexture.g
et(), | 175 maskTexture.g
et(), |
| 176 fInnerThresho
ld, | 176 fInnerThresho
ld, |
| 177 fOuterThresho
ld, | 177 fOuterThresho
ld, |
| 178 bounds)); | 178 bounds)); |
| 179 if (!fp) { | 179 if (!fp) { |
| 180 return nullptr; | 180 return nullptr; |
| 181 } | 181 } |
| 182 | 182 |
| 183 return DrawWithFP(context, std::move(fp), bounds); | 183 return DrawWithFP(context, std::move(fp), bounds, sk_ref_sp(input->getCo
lorSpace())); |
| 184 } | 184 } |
| 185 #endif | 185 #endif |
| 186 | 186 |
| 187 SkBitmap inputBM; | 187 SkBitmap inputBM; |
| 188 | 188 |
| 189 if (!input->getROPixels(&inputBM)) { | 189 if (!input->getROPixels(&inputBM)) { |
| 190 return nullptr; | 190 return nullptr; |
| 191 } | 191 } |
| 192 | 192 |
| 193 if (inputBM.colorType() != kN32_SkColorType) { | 193 if (inputBM.colorType() != kN32_SkColorType) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 dst); | 259 dst); |
| 260 } | 260 } |
| 261 | 261 |
| 262 #ifndef SK_IGNORE_TO_STRING | 262 #ifndef SK_IGNORE_TO_STRING |
| 263 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 263 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
| 264 str->appendf("SkAlphaThresholdImageFilter: ("); | 264 str->appendf("SkAlphaThresholdImageFilter: ("); |
| 265 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 265 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
| 266 str->append(")"); | 266 str->append(")"); |
| 267 } | 267 } |
| 268 #endif | 268 #endif |
| OLD | NEW |