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

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

Issue 719253002: rename filterTextFlags to disableLCD (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rename disableLCD to shouldDisableLCD 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/SkGpuDevice.cpp ('k') | src/utils/SkDeferredCanvas.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 "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // device into it. Note that this flushes the SkGpuDevice but 78 // device into it. Note that this flushes the SkGpuDevice but
79 // doesn't force an OpenGL flush. 79 // doesn't force an OpenGL flush.
80 void SkSurface_Gpu::onCopyOnWrite(ContentChangeMode mode) { 80 void SkSurface_Gpu::onCopyOnWrite(ContentChangeMode mode) {
81 GrRenderTarget* rt = fDevice->accessRenderTarget(); 81 GrRenderTarget* rt = fDevice->accessRenderTarget();
82 // are we sharing our render target with the image? 82 // are we sharing our render target with the image?
83 SkASSERT(this->getCachedImage()); 83 SkASSERT(this->getCachedImage());
84 if (rt->asTexture() == SkTextureImageGetTexture(this->getCachedImage())) { 84 if (rt->asTexture() == SkTextureImageGetTexture(this->getCachedImage())) {
85 // We call createCompatibleDevice because it uses the texture cache. Thi s isn't 85 // We call createCompatibleDevice because it uses the texture cache. Thi s isn't
86 // necessarily correct (http://skbug.com/2252), but never using the cach e causes 86 // necessarily correct (http://skbug.com/2252), but never using the cach e causes
87 // a Chromium regression. (http://crbug.com/344020) 87 // a Chromium regression. (http://crbug.com/344020)
88 SkGpuDevice* newDevice = static_cast<SkGpuDevice*>( 88 SkGpuDevice* newDevice = fDevice->cloneDevice(this->props());
89 fDevice->createCompatibleDevice(fDevice->imageInfo()));
90 SkAutoTUnref<SkGpuDevice> aurd(newDevice); 89 SkAutoTUnref<SkGpuDevice> aurd(newDevice);
91 if (kRetain_ContentChangeMode == mode) { 90 if (kRetain_ContentChangeMode == mode) {
92 fDevice->context()->copySurface(newDevice->accessRenderTarget(), rt- >asTexture()); 91 fDevice->context()->copySurface(newDevice->accessRenderTarget(), rt- >asTexture());
93 } 92 }
94 SkASSERT(this->getCachedCanvas()); 93 SkASSERT(this->getCachedCanvas());
95 SkASSERT(this->getCachedCanvas()->getDevice() == fDevice); 94 SkASSERT(this->getCachedCanvas()->getDevice() == fDevice);
96 95
97 this->getCachedCanvas()->setRootDevice(newDevice); 96 this->getCachedCanvas()->setRootDevice(newDevice);
98 SkRefCnt_SafeAssign(fDevice, newDevice); 97 SkRefCnt_SafeAssign(fDevice, newDevice);
99 } else if (kDiscard_ContentChangeMode == mode) { 98 } else if (kDiscard_ContentChangeMode == mode) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 SkAutoTUnref<GrTexture> tex(ctx->refScratchTexture(desc, GrContext::kExact_S cratchTexMatch)); 150 SkAutoTUnref<GrTexture> tex(ctx->refScratchTexture(desc, GrContext::kExact_S cratchTexMatch));
152 151
153 if (NULL == tex) { 152 if (NULL == tex) {
154 return NULL; 153 return NULL;
155 } 154 }
156 155
157 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); 156 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true));
158 } 157 }
159 158
160 #endif 159 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698