Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: src/effects/SkAlphaThresholdFilter.cpp

Issue 938383004: Dynamically create stencil buffer when needed. (Closed) Base URL: https://skia.googlesource.com/skia.git@bigstencil
Patch Set: Actually save file before uploading Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698