| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 config)); | 107 config)); |
| 108 if (!drawContext) { | 108 if (!drawContext) { |
| 109 return nullptr; | 109 return nullptr; |
| 110 } | 110 } |
| 111 | 111 |
| 112 GrPaint grPaint; | 112 GrPaint grPaint; |
| 113 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 113 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
| 114 SkRegion::Iterator iter(fRegion); | 114 SkRegion::Iterator iter(fRegion); |
| 115 drawContext->clear(nullptr, 0x0, true); | 115 drawContext->clear(nullptr, 0x0, true); |
| 116 | 116 |
| 117 GrClip clip(SkRect::Make(SkIRect::MakeWH(bounds.width(), bounds.height()))); | 117 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height())); |
| 118 while (!iter.done()) { | 118 while (!iter.done()) { |
| 119 SkRect rect = SkRect::Make(iter.rect()); | 119 SkRect rect = SkRect::Make(iter.rect()); |
| 120 drawContext->drawRect(clip, grPaint, inMatrix, rect); | 120 drawContext->drawRect(clip, grPaint, inMatrix, rect); |
| 121 iter.next(); | 121 iter.next(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 return drawContext->asTexture(); | 124 return drawContext->asTexture(); |
| 125 } | 125 } |
| 126 #endif | 126 #endif |
| 127 | 127 |
| (...skipping 131 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 |