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

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

Issue 53823003: Add can-ignore-rect hint to clear call (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleaned up Created 7 years, 1 month 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 | Annotate | Revision Log
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 "SkBitmapAlphaThresholdShader.h" 8 #include "SkBitmapAlphaThresholdShader.h"
9 9
10 class BATShader : public SkShader { 10 class BATShader : public SkShader {
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 GrAutoScratchTexture ast(context, maskDesc, GrContext::kApprox_ScratchTexMat ch); 234 GrAutoScratchTexture ast(context, maskDesc, GrContext::kApprox_ScratchTexMat ch);
235 GrTexture* maskTexture = ast.texture(); 235 GrTexture* maskTexture = ast.texture();
236 if (NULL == maskTexture) { 236 if (NULL == maskTexture) {
237 return NULL; 237 return NULL;
238 } 238 }
239 239
240 GrPaint grPaint; 240 GrPaint grPaint;
241 grPaint.setBlendFunc(kOne_GrBlendCoeff, kZero_GrBlendCoeff); 241 grPaint.setBlendFunc(kOne_GrBlendCoeff, kZero_GrBlendCoeff);
242 SkRegion::Iterator iter(fRegion); 242 SkRegion::Iterator iter(fRegion);
243 context->setRenderTarget(maskTexture->asRenderTarget()); 243 context->setRenderTarget(maskTexture->asRenderTarget());
244 context->clear(NULL, 0x0); 244 context->clear(NULL, 0x0, true);
245 245
246 // offset to ensure border is zero on top/left 246 // offset to ensure border is zero on top/left
247 SkMatrix matrix; 247 SkMatrix matrix;
248 matrix.setTranslate(SK_Scalar1, SK_Scalar1); 248 matrix.setTranslate(SK_Scalar1, SK_Scalar1);
249 context->setMatrix(matrix); 249 context->setMatrix(matrix);
250 250
251 while (!iter.done()) { 251 while (!iter.done()) {
252 SkRect rect = SkRect::MakeFromIRect(iter.rect()); 252 SkRect rect = SkRect::MakeFromIRect(iter.rect());
253 context->drawRect(grPaint, rect); 253 context->drawRect(grPaint, rect);
254 iter.next(); 254 iter.next();
(...skipping 15 matching lines...) Expand all
270 GrEffectRef* effect = ThresholdEffect::Create(bmpTexture, bmpMatrix, 270 GrEffectRef* effect = ThresholdEffect::Create(bmpTexture, bmpMatrix,
271 maskTexture, maskMatrix, 271 maskTexture, maskMatrix,
272 fThreshold); 272 fThreshold);
273 273
274 GrUnlockAndUnrefCachedBitmapTexture(bmpTexture); 274 GrUnlockAndUnrefCachedBitmapTexture(bmpTexture);
275 275
276 return effect; 276 return effect;
277 } 277 }
278 278
279 #endif 279 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | src/gpu/GrDrawTarget.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698