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

Side by Side Diff: include/gpu/GrTextureProvider.h

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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 | « include/gpu/GrTextureAccess.h ('k') | include/gpu/GrXferProcessor.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 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 #ifndef GrTextureProvider_DEFINED 8 #ifndef GrTextureProvider_DEFINED
9 #define GrTextureProvider_DEFINED 9 #define GrTextureProvider_DEFINED
10 10
(...skipping 28 matching lines...) Expand all
39 findTextureByUniqueKey(). If an existing texture has this key, it's key will be removed. */ 39 findTextureByUniqueKey(). If an existing texture has this key, it's key will be removed. */
40 void assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) { 40 void assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) {
41 this->assignUniqueKeyToResource(key, texture); 41 this->assignUniqueKeyToResource(key, texture);
42 } 42 }
43 43
44 /** Finds a texture by unique key. If the texture is found it is ref'ed and returned. */ 44 /** Finds a texture by unique key. If the texture is found it is ref'ed and returned. */
45 GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key) { 45 GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key) {
46 GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key); 46 GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key);
47 if (resource) { 47 if (resource) {
48 GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture(); 48 GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture();
49 SkASSERT(texture->fromRawPixels2() || texture->fException2);
49 SkASSERT(texture); 50 SkASSERT(texture);
50 return texture; 51 return texture;
51 } 52 }
52 return NULL; 53 return NULL;
53 } 54 }
54 55
55 /** 56 /**
56 * Determines whether a texture is associated with the unique key. If the te xture is found it 57 * Determines whether a texture is associated with the unique key. If the te xture is found it
57 * will not be locked or returned. This call does not affect the priority of the resource for 58 * will not be locked or returned. This call does not affect the priority of the resource for
58 * deletion. 59 * deletion.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return kApprox_SizeConstraint; 95 return kApprox_SizeConstraint;
95 } 96 }
96 } 97 }
97 98
98 /** Legacy function that no longer should be used. */ 99 /** Legacy function that no longer should be used. */
99 enum ScratchTexMatch { 100 enum ScratchTexMatch {
100 kExact_ScratchTexMatch, 101 kExact_ScratchTexMatch,
101 kApprox_ScratchTexMatch 102 kApprox_ScratchTexMatch
102 }; 103 };
103 GrTexture* refScratchTexture(const GrSurfaceDesc& desc, ScratchTexMatch matc h) { 104 GrTexture* refScratchTexture(const GrSurfaceDesc& desc, ScratchTexMatch matc h) {
105 GrTexture* texture;
104 if (kApprox_ScratchTexMatch == match) { 106 if (kApprox_ScratchTexMatch == match) {
105 return this->createApproxTexture(desc); 107 texture = this->createApproxTexture(desc);
106 } else { 108 } else {
107 return this->createTexture(desc, true); 109 texture = this->createTexture(desc, true);
108 } 110 }
111 if (texture) {
112 SkASSERT(!texture->fromRawPixels2());
113 }
114 return texture;
109 } 115 }
110 116
111 /////////////////////////////////////////////////////////////////////////// 117 ///////////////////////////////////////////////////////////////////////////
112 // Wrapped Backend Surfaces 118 // Wrapped Backend Surfaces
113 119
114 /** 120 /**
115 * Wraps an existing texture with a GrTexture object. 121 * Wraps an existing texture with a GrTexture object.
116 * 122 *
117 * OpenGL: if the object is a texture Gr may change its GL texture params 123 * OpenGL: if the object is a texture Gr may change its GL texture params
118 * when it is drawn. 124 * when it is drawn.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 SkASSERT(SkToBool(fGpu) == SkToBool(fCache)); 188 SkASSERT(SkToBool(fGpu) == SkToBool(fCache));
183 return !SkToBool(fCache); 189 return !SkToBool(fCache);
184 } 190 }
185 191
186 private: 192 private:
187 GrResourceCache* fCache; 193 GrResourceCache* fCache;
188 GrGpu* fGpu; 194 GrGpu* fGpu;
189 }; 195 };
190 196
191 #endif 197 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTextureAccess.h ('k') | include/gpu/GrXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698