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

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

Issue 1187523005: Add support for creating texture backed images where Skia will delete the texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add default param to support Chrome's current callers Created 5 years, 6 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/GrTexture.cpp ('k') | src/gpu/gl/GrGLAssembleInterface.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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrTextureProvider.h" 9 #include "GrTextureProvider.h"
10 #include "GrTexturePriv.h" 10 #include "GrTexturePriv.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 } 101 }
102 102
103 if (!(kNoCreate_ScratchTextureFlag & flags)) { 103 if (!(kNoCreate_ScratchTextureFlag & flags)) {
104 return fGpu->createTexture(*desc, true, NULL, 0); 104 return fGpu->createTexture(*desc, true, NULL, 0);
105 } 105 }
106 106
107 return NULL; 107 return NULL;
108 } 108 }
109 109
110 GrTexture* GrTextureProvider::wrapBackendTexture(const GrBackendTextureDesc& des c) { 110 GrTexture* GrTextureProvider::wrapBackendTexture(const GrBackendTextureDesc& des c,
111 GrWrapOwnership ownership) {
111 if (this->isAbandoned()) { 112 if (this->isAbandoned()) {
112 return NULL; 113 return NULL;
113 } 114 }
114 return fGpu->wrapBackendTexture(desc); 115 return fGpu->wrapBackendTexture(desc, ownership);
115 } 116 }
116 117
117 GrRenderTarget* GrTextureProvider::wrapBackendRenderTarget(const GrBackendRender TargetDesc& desc) { 118 GrRenderTarget* GrTextureProvider::wrapBackendRenderTarget(const GrBackendRender TargetDesc& desc) {
118 return this->isAbandoned() ? NULL : fGpu->wrapBackendRenderTarget(desc); 119 return this->isAbandoned() ? NULL : fGpu->wrapBackendRenderTarget(desc,
120 kBorrow_Gr WrapOwnership);
119 } 121 }
120 122
121 void GrTextureProvider::assignUniqueKeyToResource(const GrUniqueKey& key, GrGpuR esource* resource) { 123 void GrTextureProvider::assignUniqueKeyToResource(const GrUniqueKey& key, GrGpuR esource* resource) {
122 if (this->isAbandoned() || !resource) { 124 if (this->isAbandoned() || !resource) {
123 return; 125 return;
124 } 126 }
125 resource->resourcePriv().setUniqueKey(key); 127 resource->resourcePriv().setUniqueKey(key);
126 } 128 }
127 129
128 bool GrTextureProvider::existsResourceWithUniqueKey(const GrUniqueKey& key) cons t { 130 bool GrTextureProvider::existsResourceWithUniqueKey(const GrUniqueKey& key) cons t {
129 return this->isAbandoned() ? false : fCache->hasUniqueKey(key); 131 return this->isAbandoned() ? false : fCache->hasUniqueKey(key);
130 } 132 }
131 133
132 GrGpuResource* GrTextureProvider::findAndRefResourceByUniqueKey(const GrUniqueKe y& key) { 134 GrGpuResource* GrTextureProvider::findAndRefResourceByUniqueKey(const GrUniqueKe y& key) {
133 return this->isAbandoned() ? NULL : fCache->findAndRefUniqueResource(key); 135 return this->isAbandoned() ? NULL : fCache->findAndRefUniqueResource(key);
134 } 136 }
OLDNEW
« no previous file with comments | « src/gpu/GrTexture.cpp ('k') | src/gpu/gl/GrGLAssembleInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698