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

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

Issue 1810323002: Cache render targets that render to wrapped textures Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: moved the refactoring to another patch Created 4 years, 8 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 | « src/gpu/GrResourceProvider.h ('k') | src/gpu/GrTextureProvider.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 2015 Google Inc. 2 * Copyright 2015 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 "GrResourceProvider.h" 8 #include "GrResourceProvider.h"
9 9
10 #include "GrBuffer.h" 10 #include "GrBuffer.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 } 184 }
185 return rt->renderTargetPriv().getStencilAttachment(); 185 return rt->renderTargetPriv().getStencilAttachment();
186 } 186 }
187 187
188 GrRenderTarget* GrResourceProvider::wrapBackendTextureAsRenderTarget( 188 GrRenderTarget* GrResourceProvider::wrapBackendTextureAsRenderTarget(
189 const GrBackendTextureDesc& desc) { 189 const GrBackendTextureDesc& desc) {
190 if (this->isAbandoned()) { 190 if (this->isAbandoned()) {
191 return nullptr; 191 return nullptr;
192 } 192 }
193
194 GrUniqueKey key;
195 this->gpu()->computeBackendTextureKeyForWrapAsRenderTarget(desc, &key);
196 if (key.isValid()) {
197 sk_sp<GrRenderTarget> rt(this->findAndRefRenderTargetByUniqueKey(key));
198 if (rt && this->gpu()->rewrapRenderTargetWithBackendTexture(desc, rt.get ())) {
199 return rt.release();
200 }
201 }
193 return this->gpu()->wrapBackendTextureAsRenderTarget(desc); 202 return this->gpu()->wrapBackendTextureAsRenderTarget(desc);
194 } 203 }
OLDNEW
« no previous file with comments | « src/gpu/GrResourceProvider.h ('k') | src/gpu/GrTextureProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698