| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // the outside. | 266 // the outside. |
| 267 maskDesc.fWidth = texture->width(); | 267 maskDesc.fWidth = texture->width(); |
| 268 maskDesc.fHeight = texture->height(); | 268 maskDesc.fHeight = texture->height(); |
| 269 SkAutoTUnref<GrTexture> maskTexture( | 269 SkAutoTUnref<GrTexture> maskTexture( |
| 270 context->textureProvider()->createApproxTexture(maskDesc)); | 270 context->textureProvider()->createApproxTexture(maskDesc)); |
| 271 if (!maskTexture) { | 271 if (!maskTexture) { |
| 272 return false; | 272 return false; |
| 273 } | 273 } |
| 274 | 274 |
| 275 SkAutoTUnref<GrDrawContext> drawContext( | 275 SkAutoTUnref<GrDrawContext> drawContext( |
| 276 context->drawContext(maskTexture->as
RenderTarget())); | 276 context->drawingMgr().drawContext(maskTexture->as
RenderTarget())); |
| 277 if (drawContext) { | 277 if (drawContext) { |
| 278 GrPaint grPaint; | 278 GrPaint grPaint; |
| 279 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 279 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
| 280 SkRegion::Iterator iter(fRegion); | 280 SkRegion::Iterator iter(fRegion); |
| 281 drawContext->clear(nullptr, 0x0, true); | 281 drawContext->clear(nullptr, 0x0, true); |
| 282 | 282 |
| 283 while (!iter.done()) { | 283 while (!iter.done()) { |
| 284 SkRect rect = SkRect::Make(iter.rect()); | 284 SkRect rect = SkRect::Make(iter.rect()); |
| 285 drawContext->drawRect(GrClip::WideOpen(), grPaint, inMatrix, rec
t); | 285 drawContext->drawRect(GrClip::WideOpen(), grPaint, inMatrix, rec
t); |
| 286 iter.next(); | 286 iter.next(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 } | 366 } |
| 367 | 367 |
| 368 #ifndef SK_IGNORE_TO_STRING | 368 #ifndef SK_IGNORE_TO_STRING |
| 369 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 369 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
| 370 str->appendf("SkAlphaThresholdImageFilter: ("); | 370 str->appendf("SkAlphaThresholdImageFilter: ("); |
| 371 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 371 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
| 372 str->append(")"); | 372 str->append(")"); |
| 373 } | 373 } |
| 374 #endif | 374 #endif |
| 375 | 375 |
| OLD | NEW |