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 "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 | 286 |
287 { | 287 { |
288 GrPaint grPaint; | 288 GrPaint grPaint; |
289 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 289 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
290 SkRegion::Iterator iter(fRegion); | 290 SkRegion::Iterator iter(fRegion); |
291 context->clear(NULL, 0x0, true, maskTexture->asRenderTarget()); | 291 context->clear(NULL, 0x0, true, maskTexture->asRenderTarget()); |
292 | 292 |
293 while (!iter.done()) { | 293 while (!iter.done()) { |
294 SkRect rect = SkRect::Make(iter.rect()); | 294 SkRect rect = SkRect::Make(iter.rect()); |
295 context->drawRect(maskTexture->asRenderTarget(), grPaint, in_mat
rix, rect); | 295 context->drawRect(maskTexture->asRenderTarget(), GrClip::WideOpe
n(), grPaint, |
| 296 in_matrix, rect); |
296 iter.next(); | 297 iter.next(); |
297 } | 298 } |
298 } | 299 } |
299 | 300 |
300 *fp = AlphaThresholdEffect::Create(texture, | 301 *fp = AlphaThresholdEffect::Create(texture, |
301 maskTexture, | 302 maskTexture, |
302 fInnerThreshold, | 303 fInnerThreshold, |
303 fOuterThreshold); | 304 fOuterThreshold); |
304 } | 305 } |
305 return true; | 306 return true; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 377 } |
377 | 378 |
378 #ifndef SK_IGNORE_TO_STRING | 379 #ifndef SK_IGNORE_TO_STRING |
379 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 380 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
380 str->appendf("SkAlphaThresholdImageFilter: ("); | 381 str->appendf("SkAlphaThresholdImageFilter: ("); |
381 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 382 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
382 str->append(")"); | 383 str->append(")"); |
383 } | 384 } |
384 #endif | 385 #endif |
385 | 386 |
OLD | NEW |