| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 sk_sp<GrDrawContext> drawContext(context->makeDrawContextWithFallback(SkBack
ingFit::kApprox, | 100 sk_sp<GrDrawContext> drawContext(context->makeDrawContextWithFallback(SkBack
ingFit::kApprox, |
| 101 bounds
.width(), | 101 bounds
.width(), |
| 102 bounds
.height(), | 102 bounds
.height(), |
| 103 kAlpha
_8_GrPixelConfig, | 103 kAlpha
_8_GrPixelConfig, |
| 104 nullpt
r)); | 104 nullpt
r)); |
| 105 if (!drawContext) { | 105 if (!drawContext) { |
| 106 return nullptr; | 106 return nullptr; |
| 107 } | 107 } |
| 108 | 108 |
| 109 GrPaint grPaint; | 109 GrPaint grPaint; |
| 110 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 110 grPaint.setPorterDuffXPFactory(SkBlendMode::kSrc); |
| 111 SkRegion::Iterator iter(fRegion); | 111 SkRegion::Iterator iter(fRegion); |
| 112 drawContext->clear(nullptr, 0x0, true); | 112 drawContext->clear(nullptr, 0x0, true); |
| 113 | 113 |
| 114 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height())); | 114 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height())); |
| 115 while (!iter.done()) { | 115 while (!iter.done()) { |
| 116 SkRect rect = SkRect::Make(iter.rect()); | 116 SkRect rect = SkRect::Make(iter.rect()); |
| 117 drawContext->drawRect(clip, grPaint, inMatrix, rect); | 117 drawContext->drawRect(clip, grPaint, inMatrix, rect); |
| 118 iter.next(); | 118 iter.next(); |
| 119 } | 119 } |
| 120 | 120 |
| (...skipping 138 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 |