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(), GrClip::WideOpe
n(), grPaint, | 295 context->drawRect(maskTexture->asRenderTarget(), grPaint, in_mat
rix, rect); |
296 in_matrix, rect); | |
297 iter.next(); | 296 iter.next(); |
298 } | 297 } |
299 } | 298 } |
300 | 299 |
301 *fp = AlphaThresholdEffect::Create(texture, | 300 *fp = AlphaThresholdEffect::Create(texture, |
302 maskTexture, | 301 maskTexture, |
303 fInnerThreshold, | 302 fInnerThreshold, |
304 fOuterThreshold); | 303 fOuterThreshold); |
305 } | 304 } |
306 return true; | 305 return true; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 } | 376 } |
378 | 377 |
379 #ifndef SK_IGNORE_TO_STRING | 378 #ifndef SK_IGNORE_TO_STRING |
380 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 379 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
381 str->appendf("SkAlphaThresholdImageFilter: ("); | 380 str->appendf("SkAlphaThresholdImageFilter: ("); |
382 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 381 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
383 str->append(")"); | 382 str->append(")"); |
384 } | 383 } |
385 #endif | 384 #endif |
386 | 385 |
OLD | NEW |