OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |