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

Side by Side Diff: src/image/SkSurface_Gpu.cpp

Issue 778563002: Revert "Change clear() to respect the clip" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDevice.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 2012 Google Inc. 2 * Copyright 2012 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 "SkSurface_Base.h" 8 #include "SkSurface_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 26 matching lines...) Expand all
37 /////////////////////////////////////////////////////////////////////////////// 37 ///////////////////////////////////////////////////////////////////////////////
38 38
39 SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, const SkSurfaceProps* props, 39 SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, const SkSurfaceProps* props,
40 bool doClear) 40 bool doClear)
41 : INHERITED(renderTarget->width(), renderTarget->height(), props) { 41 : INHERITED(renderTarget->width(), renderTarget->height(), props) {
42 int deviceFlags = 0; 42 int deviceFlags = 0;
43 deviceFlags |= this->props().isUseDistanceFieldFonts() ? SkGpuDevice::kDFTex t_Flag : 0; 43 deviceFlags |= this->props().isUseDistanceFieldFonts() ? SkGpuDevice::kDFTex t_Flag : 0;
44 fDevice = SkGpuDevice::Create(renderTarget, this->props(), deviceFlags); 44 fDevice = SkGpuDevice::Create(renderTarget, this->props(), deviceFlags);
45 45
46 if (kRGB_565_GrPixelConfig != renderTarget->config() && doClear) { 46 if (kRGB_565_GrPixelConfig != renderTarget->config() && doClear) {
47 fDevice->clearAll(); 47 fDevice->clear(0x0);
48 } 48 }
49 } 49 }
50 50
51 SkSurface_Gpu::~SkSurface_Gpu() { 51 SkSurface_Gpu::~SkSurface_Gpu() {
52 SkSafeUnref(fDevice); 52 SkSafeUnref(fDevice);
53 } 53 }
54 54
55 SkCanvas* SkSurface_Gpu::onNewCanvas() { 55 SkCanvas* SkSurface_Gpu::onNewCanvas() {
56 SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags; 56 SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags;
57 // When we think this works... 57 // When we think this works...
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 SkAutoTUnref<GrTexture> tex(ctx->refScratchTexture(desc, GrContext::kExact_S cratchTexMatch)); 156 SkAutoTUnref<GrTexture> tex(ctx->refScratchTexture(desc, GrContext::kExact_S cratchTexMatch));
157 157
158 if (NULL == tex) { 158 if (NULL == tex) {
159 return NULL; 159 return NULL;
160 } 160 }
161 161
162 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); 162 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true));
163 } 163 }
164 164
165 #endif 165 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698