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

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

Issue 2104353002: Add discard support to Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 5 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 | src/gpu/vk/GrVkCaps.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 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 10
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (tex) { 171 if (tex) {
172 if (!caps->reuseScratchTextures() && !isRT) { 172 if (!caps->reuseScratchTextures() && !isRT) {
173 tex->resourcePriv().removeScratchKey(); 173 tex->resourcePriv().removeScratchKey();
174 } 174 }
175 fStats.incTextureCreates(); 175 fStats.incTextureCreates();
176 if (!texels.empty()) { 176 if (!texels.empty()) {
177 if (texels[0].fPixels) { 177 if (texels[0].fPixels) {
178 fStats.incTextureUploads(); 178 fStats.incTextureUploads();
179 } 179 }
180 } 180 }
181 if (isRT && texels.empty()) {
bsalomon 2016/06/30 13:47:31 I imagine that this is not going to be a long term
182 GrRenderTarget* rt = tex->asRenderTarget();
183 SkASSERT(rt);
184 rt->discard();
185 }
181 } 186 }
182 return tex; 187 return tex;
183 } 188 }
184 189
185 GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwn ership ownership) { 190 GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc, GrWrapOwn ership ownership) {
186 this->handleDirtyContext(); 191 this->handleDirtyContext();
187 if (!this->caps()->isConfigTexturable(desc.fConfig)) { 192 if (!this->caps()->isConfigTexturable(desc.fConfig)) {
188 return nullptr; 193 return nullptr;
189 } 194 }
190 if ((desc.fFlags & kRenderTarget_GrBackendTextureFlag) && 195 if ((desc.fFlags & kRenderTarget_GrBackendTextureFlag) &&
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 fMultisampleSpecsMap.push_back_n(n, (const MultisampleSpecs*) nullptr); 470 fMultisampleSpecsMap.push_back_n(n, (const MultisampleSpecs*) nullptr);
466 } 471 }
467 fMultisampleSpecsMap[effectiveKey] = &specs; 472 fMultisampleSpecsMap[effectiveKey] = &specs;
468 if (effectiveSampleCnt != desc.fSampleCnt) { 473 if (effectiveSampleCnt != desc.fSampleCnt) {
469 SkASSERT(surfDescKey < effectiveKey); 474 SkASSERT(surfDescKey < effectiveKey);
470 fMultisampleSpecsMap[surfDescKey] = &specs; 475 fMultisampleSpecsMap[surfDescKey] = &specs;
471 } 476 }
472 return specs; 477 return specs;
473 } 478 }
474 479
OLDNEW
« no previous file with comments | « no previous file | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698