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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 680413005: Don't allow renderTarget==NULL to GrContext::clear() and friends. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 6 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
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/gl/GrGpuGL.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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "effects/GrBicubicEffect.h" 10 #include "effects/GrBicubicEffect.h"
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 GrTexture* mask = context->refScratchTexture(desc,GrContext::kApprox_Scratch TexMatch); 651 GrTexture* mask = context->refScratchTexture(desc,GrContext::kApprox_Scratch TexMatch);
652 if (NULL == mask) { 652 if (NULL == mask) {
653 return NULL; 653 return NULL;
654 } 654 }
655 655
656 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); 656 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height());
657 657
658 GrContext::AutoRenderTarget art(context, mask->asRenderTarget()); 658 GrContext::AutoRenderTarget art(context, mask->asRenderTarget());
659 GrContext::AutoClip ac(context, clipRect); 659 GrContext::AutoClip ac(context, clipRect);
660 660
661 context->clear(NULL, 0x0, true); 661 context->clear(NULL, 0x0, true, mask->asRenderTarget());
662 662
663 GrPaint tempPaint; 663 GrPaint tempPaint;
664 if (doAA) { 664 if (doAA) {
665 tempPaint.setAntiAlias(true); 665 tempPaint.setAntiAlias(true);
666 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst 666 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst
667 // blend coeff of zero requires dual source blending support in order 667 // blend coeff of zero requires dual source blending support in order
668 // to properly blend partially covered pixels. This means the AA 668 // to properly blend partially covered pixels. This means the AA
669 // code path may not be taken. So we use a dst blend coeff of ISA. We 669 // code path may not be taken. So we use a dst blend coeff of ISA. We
670 // could special case AA draws to a dst surface with known alpha=0 to 670 // could special case AA draws to a dst surface with known alpha=0 to
671 // use a zero dst coeff when dual source blending isn't available. 671 // use a zero dst coeff when dual source blending isn't available.
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 return true; 1852 return true;
1853 } 1853 }
1854 1854
1855 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1855 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1856 // We always return a transient cache, so it is freed after each 1856 // We always return a transient cache, so it is freed after each
1857 // filter traversal. 1857 // filter traversal.
1858 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1858 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1859 } 1859 }
1860 1860
1861 #endif 1861 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698