| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 drawContext->drawRect(clip, grPaint, inMatrix, rect); | 127 drawContext->drawRect(clip, grPaint, inMatrix, rect); |
| 128 iter.next(); | 128 iter.next(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 return maskTexture; | 131 return maskTexture; |
| 132 } | 132 } |
| 133 #endif | 133 #endif |
| 134 | 134 |
| 135 void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const { | 135 void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const { |
| 136 this->INHERITED::flatten(buffer); | 136 this->INHERITED::flatten(buffer); |
| 137 buffer.writeScalar(fInnerThreshold); | 137 buffer.writeScalar("fInnerThreshold", fInnerThreshold); |
| 138 buffer.writeScalar(fOuterThreshold); | 138 buffer.writeScalar("fOuterThreshold", fOuterThreshold); |
| 139 buffer.writeRegion(fRegion); | 139 buffer.writeRegion("fRegion", fRegion); |
| 140 } | 140 } |
| 141 | 141 |
| 142 sk_sp<SkSpecialImage> SkAlphaThresholdFilterImpl::onFilterImage(SkSpecialImage*
source, | 142 sk_sp<SkSpecialImage> SkAlphaThresholdFilterImpl::onFilterImage(SkSpecialImage*
source, |
| 143 const Context& c
tx, | 143 const Context& c
tx, |
| 144 SkIPoint* offset
) const { | 144 SkIPoint* offset
) const { |
| 145 SkIPoint inputOffset = SkIPoint::Make(0, 0); | 145 SkIPoint inputOffset = SkIPoint::Make(0, 0); |
| 146 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset))
; | 146 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset))
; |
| 147 if (!input) { | 147 if (!input) { |
| 148 return nullptr; | 148 return nullptr; |
| 149 } | 149 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 dst); | 266 dst); |
| 267 } | 267 } |
| 268 | 268 |
| 269 #ifndef SK_IGNORE_TO_STRING | 269 #ifndef SK_IGNORE_TO_STRING |
| 270 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 270 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
| 271 str->appendf("SkAlphaThresholdImageFilter: ("); | 271 str->appendf("SkAlphaThresholdImageFilter: ("); |
| 272 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 272 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
| 273 str->append(")"); | 273 str->append(")"); |
| 274 } | 274 } |
| 275 #endif | 275 #endif |
| OLD | NEW |