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

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

Issue 2502923003: Add IORef capability to GrSurfaceProxy objects - take 2 (Closed)
Patch Set: Fixed bug in transferRefs Created 4 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 | « include/private/GrSurfaceProxy.h ('k') | tests/ProxyRefTest.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 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 "GrSurfaceProxy.h" 8 #include "GrSurfaceProxy.h"
9 9
10 #include "GrGpuResourcePriv.h" 10 #include "GrGpuResourcePriv.h"
(...skipping 25 matching lines...) Expand all
36 36
37 if (SkBackingFit::kApprox == fFit) { 37 if (SkBackingFit::kApprox == fFit) {
38 fTarget = texProvider->createApproxTexture(fDesc); 38 fTarget = texProvider->createApproxTexture(fDesc);
39 } else { 39 } else {
40 fTarget = texProvider->createTexture(fDesc, fBudgeted); 40 fTarget = texProvider->createTexture(fDesc, fBudgeted);
41 } 41 }
42 if (!fTarget) { 42 if (!fTarget) {
43 return nullptr; 43 return nullptr;
44 } 44 }
45 45
46 this->INHERITED::transferRefs();
47
46 #ifdef SK_DEBUG 48 #ifdef SK_DEBUG
47 if (kInvalidGpuMemorySize != this->getRawGpuMemorySize_debugOnly()) { 49 if (kInvalidGpuMemorySize != this->getRawGpuMemorySize_debugOnly()) {
48 SkASSERT(fTarget->gpuMemorySize() <= this->getRawGpuMemorySize_debugOnly ()); 50 SkASSERT(fTarget->gpuMemorySize() <= this->getRawGpuMemorySize_debugOnly ());
49 } 51 }
50 #endif 52 #endif
51 53
52 return fTarget; 54 return fTarget;
53 } 55 }
54 56
55 void GrSurfaceProxy::setLastOpList(GrOpList* opList) { 57 void GrSurfaceProxy::setLastOpList(GrOpList* opList) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 size_t rowBytes) { 102 size_t rowBytes) {
101 if (srcData) { 103 if (srcData) {
102 // If we have srcData, for now, we create a wrapped GrTextureProxy 104 // If we have srcData, for now, we create a wrapped GrTextureProxy
103 sk_sp<GrSurface> surf(texProvider->createTexture(desc, budgeted, srcData , rowBytes)); 105 sk_sp<GrSurface> surf(texProvider->createTexture(desc, budgeted, srcData , rowBytes));
104 return GrSurfaceProxy::MakeWrapped(std::move(surf)); 106 return GrSurfaceProxy::MakeWrapped(std::move(surf));
105 } 107 }
106 108
107 return GrSurfaceProxy::MakeDeferred(caps, desc, SkBackingFit::kExact, budget ed); 109 return GrSurfaceProxy::MakeDeferred(caps, desc, SkBackingFit::kExact, budget ed);
108 } 110 }
109 111
OLDNEW
« no previous file with comments | « include/private/GrSurfaceProxy.h ('k') | tests/ProxyRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698