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 const SkMatrix& in_matrix, | 266 const SkMatrix& in_matrix, |
267 const SkIRect&) const { | 267 const SkIRect&) const { |
268 if (fp) { | 268 if (fp) { |
269 GrContext* context = texture->getContext(); | 269 GrContext* context = texture->getContext(); |
270 GrSurfaceDesc maskDesc; | 270 GrSurfaceDesc maskDesc; |
271 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { | 271 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { |
272 maskDesc.fConfig = kAlpha_8_GrPixelConfig; | 272 maskDesc.fConfig = kAlpha_8_GrPixelConfig; |
273 } else { | 273 } else { |
274 maskDesc.fConfig = kRGBA_8888_GrPixelConfig; | 274 maskDesc.fConfig = kRGBA_8888_GrPixelConfig; |
275 } | 275 } |
276 maskDesc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag
; | 276 maskDesc.fFlags = kRenderTarget_GrSurfaceFlag; |
277 // Add one pixel of border to ensure that clamp mode will be all zeros | 277 // Add one pixel of border to ensure that clamp mode will be all zeros |
278 // the outside. | 278 // the outside. |
279 maskDesc.fWidth = texture->width(); | 279 maskDesc.fWidth = texture->width(); |
280 maskDesc.fHeight = texture->height(); | 280 maskDesc.fHeight = texture->height(); |
281 SkAutoTUnref<GrTexture> maskTexture( | 281 SkAutoTUnref<GrTexture> maskTexture( |
282 context->refScratchTexture(maskDesc, GrContext::kApprox_ScratchTexMa
tch)); | 282 context->refScratchTexture(maskDesc, GrContext::kApprox_ScratchTexMa
tch)); |
283 if (!maskTexture) { | 283 if (!maskTexture) { |
284 return false; | 284 return false; |
285 } | 285 } |
286 | 286 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 376 } |
377 | 377 |
378 #ifndef SK_IGNORE_TO_STRING | 378 #ifndef SK_IGNORE_TO_STRING |
379 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { | 379 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { |
380 str->appendf("SkAlphaThresholdImageFilter: ("); | 380 str->appendf("SkAlphaThresholdImageFilter: ("); |
381 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); | 381 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); |
382 str->append(")"); | 382 str->append(")"); |
383 } | 383 } |
384 #endif | 384 #endif |
385 | 385 |
OLD | NEW |