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 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 262 } |
263 | 263 |
264 #endif | 264 #endif |
265 | 265 |
266 SkFlattenable* SkAlphaThresholdFilterImpl::CreateProc(SkReadBuffer& buffer) { | 266 SkFlattenable* SkAlphaThresholdFilterImpl::CreateProc(SkReadBuffer& buffer) { |
267 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 267 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
268 SkScalar inner = buffer.readScalar(); | 268 SkScalar inner = buffer.readScalar(); |
269 SkScalar outer = buffer.readScalar(); | 269 SkScalar outer = buffer.readScalar(); |
270 SkRegion rgn; | 270 SkRegion rgn; |
271 buffer.readRegion(&rgn); | 271 buffer.readRegion(&rgn); |
272 return SkAlphaThresholdFilter::Create(rgn, inner, outer, common.getInput(0))
; | 272 return SkAlphaThresholdFilter::Create(rgn, inner, outer, common.getInput(0).
get()); |
273 } | 273 } |
274 | 274 |
275 SkAlphaThresholdFilterImpl::SkAlphaThresholdFilterImpl(const SkRegion& region, | 275 SkAlphaThresholdFilterImpl::SkAlphaThresholdFilterImpl(const SkRegion& region, |
276 SkScalar innerThreshold, | 276 SkScalar innerThreshold, |
277 SkScalar outerThreshold, | 277 SkScalar outerThreshold, |
278 SkImageFilter* input) | 278 SkImageFilter* input) |
279 : INHERITED(1, &input) | 279 : INHERITED(1, &input) |
280 , fRegion(region) | 280 , fRegion(region) |
281 , fInnerThreshold(innerThreshold) | 281 , fInnerThreshold(innerThreshold) |
282 , fOuterThreshold(outerThreshold) { | 282 , fOuterThreshold(outerThreshold) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 return true; | 403 return true; |
404 } | 404 } |
405 | 405 |
406 #ifndef SK_IGNORE_TO_STRING | 406 #ifndef SK_IGNORE_TO_STRING |
407 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 407 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
408 str->appendf("SkAlphaThresholdImageFilter: ("); | 408 str->appendf("SkAlphaThresholdImageFilter: ("); |
409 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 409 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
410 str->append(")"); | 410 str->append(")"); |
411 } | 411 } |
412 #endif | 412 #endif |
OLD | NEW |