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

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

Issue 1727413004: Fix ~,! typo when clearing kRenderTarget flag (Closed) Base URL: https://skia.googlesource.com/skia.git@nollvm
Patch Set: Created 4 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 | « no previous file | no next file » | 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_Gpu.h" 8 #include "SkSurface_Gpu.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 SkImage* SkSurface_Gpu::onNewImageSnapshot(Budgeted budgeted, ForceCopyMode forc eCopyMode) { 79 SkImage* SkSurface_Gpu::onNewImageSnapshot(Budgeted budgeted, ForceCopyMode forc eCopyMode) {
80 GrRenderTarget* rt = fDevice->accessRenderTarget(); 80 GrRenderTarget* rt = fDevice->accessRenderTarget();
81 SkASSERT(rt); 81 SkASSERT(rt);
82 GrTexture* tex = rt->asTexture(); 82 GrTexture* tex = rt->asTexture();
83 SkAutoTUnref<GrTexture> copy; 83 SkAutoTUnref<GrTexture> copy;
84 // TODO: Force a copy when the rt is an external resource. 84 // TODO: Force a copy when the rt is an external resource.
85 if (kYes_ForceCopyMode == forceCopyMode || !tex) { 85 if (kYes_ForceCopyMode == forceCopyMode || !tex) {
86 GrSurfaceDesc desc = fDevice->accessRenderTarget()->desc(); 86 GrSurfaceDesc desc = fDevice->accessRenderTarget()->desc();
87 GrContext* ctx = fDevice->context(); 87 GrContext* ctx = fDevice->context();
88 desc.fFlags = desc.fFlags & !kRenderTarget_GrSurfaceFlag; 88 desc.fFlags = desc.fFlags & ~kRenderTarget_GrSurfaceFlag;
89 copy.reset(ctx->textureProvider()->createTexture(desc, kYes_Budgeted == budgeted)); 89 copy.reset(ctx->textureProvider()->createTexture(desc, kYes_Budgeted == budgeted));
90 if (!copy) { 90 if (!copy) {
91 return nullptr; 91 return nullptr;
92 } 92 }
93 if (!ctx->copySurface(copy, rt)) { 93 if (!ctx->copySurface(copy, rt)) {
94 return nullptr; 94 return nullptr;
95 } 95 }
96 tex = copy; 96 tex = copy;
97 } 97 }
98 const SkImageInfo info = fDevice->imageInfo(); 98 const SkImageInfo info = fDevice->imageInfo();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, 182 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props,
183 SkGpuDevice::kUninit_In itContents)); 183 SkGpuDevice::kUninit_In itContents));
184 if (!device) { 184 if (!device) {
185 return nullptr; 185 return nullptr;
186 } 186 }
187 return new SkSurface_Gpu(device); 187 return new SkSurface_Gpu(device);
188 } 188 }
189 189
190 #endif 190 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698