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

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

Issue 2301523003: Have GrSurfaceProxys and GrGpuResources draw from the same pool of unique ids (Closed)
Patch Set: update to ToT Created 4 years, 3 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/GrSurfaceProxy.cpp ('k') | src/gpu/batches/GrClearBatch.h » ('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 2016 Google Inc. 2 * Copyright 2016 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 "GrTextureProxy.h" 8 #include "GrTextureProxy.h"
9 9
10 #include "GrTextureProvider.h" 10 #include "GrTextureProvider.h"
11 #include "GrGpuResourcePriv.h" 11 #include "GrGpuResourcePriv.h"
12 12
13 GrTextureProxy::GrTextureProxy(const GrSurfaceDesc& srcDesc, SkBackingFit fit, S kBudgeted budgeted,
14 const void* /*srcData*/, size_t /*rowBytes*/)
15 : INHERITED(srcDesc, fit, budgeted) {
16 // TODO: Handle 'srcData' here
17 }
18
13 GrTextureProxy::GrTextureProxy(sk_sp<GrTexture> tex) 19 GrTextureProxy::GrTextureProxy(sk_sp<GrTexture> tex)
14 : INHERITED(tex->desc(), SkBackingFit::kExact, tex->resourcePriv().isBudgete d()) 20 : INHERITED(tex->desc(), SkBackingFit::kExact,
21 tex->resourcePriv().isBudgeted(), tex->uniqueID())
15 , fTexture(std::move(tex)) { 22 , fTexture(std::move(tex)) {
16 } 23 }
17 24
18 GrTexture* GrTextureProxy::instantiate(GrTextureProvider* texProvider) { 25 GrTexture* GrTextureProxy::instantiate(GrTextureProvider* texProvider) {
19 if (fTexture) { 26 if (fTexture) {
20 return fTexture.get(); 27 return fTexture.get();
21 } 28 }
22 29
23 if (SkBackingFit::kApprox == fFit) { 30 if (SkBackingFit::kApprox == fFit) {
24 fTexture.reset(texProvider->createApproxTexture(fDesc)); 31 fTexture.reset(texProvider->createApproxTexture(fDesc));
(...skipping 10 matching lines...) Expand all
35 const void* srcData, 42 const void* srcData,
36 size_t rowBytes) { 43 size_t rowBytes) {
37 // TODO: handle 'srcData' (we could use the wrapped version if there is data ) 44 // TODO: handle 'srcData' (we could use the wrapped version if there is data )
38 SkASSERT(!srcData && !rowBytes); 45 SkASSERT(!srcData && !rowBytes);
39 return sk_sp<GrTextureProxy>(new GrTextureProxy(desc, fit, budgeted, srcData , rowBytes)); 46 return sk_sp<GrTextureProxy>(new GrTextureProxy(desc, fit, budgeted, srcData , rowBytes));
40 } 47 }
41 48
42 sk_sp<GrTextureProxy> GrTextureProxy::Make(sk_sp<GrTexture> tex) { 49 sk_sp<GrTextureProxy> GrTextureProxy::Make(sk_sp<GrTexture> tex) {
43 return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex))); 50 return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex)));
44 } 51 }
OLDNEW
« no previous file with comments | « src/gpu/GrSurfaceProxy.cpp ('k') | src/gpu/batches/GrClearBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698