OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 * | 124 * |
125 * @param params The texture params used to draw a texture may help deter
mine | 125 * @param params The texture params used to draw a texture may help deter
mine |
126 * the cache entry used. (e.g. different versions may exist | 126 * the cache entry used. (e.g. different versions may exist |
127 * for different wrap modes on GPUs with limited NPOT | 127 * for different wrap modes on GPUs with limited NPOT |
128 * texture support). NULL implies clamp wrap modes. | 128 * texture support). NULL implies clamp wrap modes. |
129 * @param desc Description of the texture properties. | 129 * @param desc Description of the texture properties. |
130 * @param cacheID Cache-specific properties (e.g., texture gen ID) | 130 * @param cacheID Cache-specific properties (e.g., texture gen ID) |
131 * @param srcData Pointer to the pixel values. | 131 * @param srcData Pointer to the pixel values. |
132 * @param rowBytes The number of bytes between rows of the texture. Zero | 132 * @param rowBytes The number of bytes between rows of the texture. Zero |
133 * implies tightly packed rows. | 133 * implies tightly packed rows. |
| 134 * @param cacheKey (optional) If non-NULL, we'll write the cache key we use
d to cacheKey. |
134 */ | 135 */ |
135 GrTexture* createTexture(const GrTextureParams* params, | 136 GrTexture* createTexture(const GrTextureParams* params, |
136 const GrTextureDesc& desc, | 137 const GrTextureDesc& desc, |
137 const GrCacheID& cacheID, | 138 const GrCacheID& cacheID, |
138 void* srcData, size_t rowBytes); | 139 void* srcData, |
| 140 size_t rowBytes, |
| 141 GrResourceKey* cacheKey = NULL); |
139 | 142 |
140 /** | 143 /** |
141 * Search for an entry based on key and dimensions. If found, ref it and ret
urn it. The return | 144 * Search for an entry based on key and dimensions. If found, ref it and ret
urn it. The return |
142 * value will be NULL if not found. The caller must balance with a call to u
nref. | 145 * value will be NULL if not found. The caller must balance with a call to u
nref. |
143 * | 146 * |
144 * @param desc Description of the texture properties. | 147 * @param desc Description of the texture properties. |
145 * @param cacheID Cache-specific properties (e.g., texture gen ID) | 148 * @param cacheID Cache-specific properties (e.g., texture gen ID) |
146 * @param params The texture params used to draw a texture may help deter
mine | 149 * @param params The texture params used to draw a texture may help deter
mine |
147 * the cache entry used. (e.g. different versions may exist | 150 * the cache entry used. (e.g. different versions may exist |
148 * for different wrap modes on GPUs with limited NPOT | 151 * for different wrap modes on GPUs with limited NPOT |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 } | 1028 } |
1026 | 1029 |
1027 GrTexture* texture() { return fTexture; } | 1030 GrTexture* texture() { return fTexture; } |
1028 | 1031 |
1029 private: | 1032 private: |
1030 GrContext* fContext; | 1033 GrContext* fContext; |
1031 GrTexture* fTexture; | 1034 GrTexture* fTexture; |
1032 }; | 1035 }; |
1033 | 1036 |
1034 #endif | 1037 #endif |
OLD | NEW |