| OLD | NEW |
| 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 27 matching lines...) Expand all Loading... |
| 38 * @param srcData Pointer to the pixel values (optional). | 38 * @param srcData Pointer to the pixel values (optional). |
| 39 * @param rowBytes The number of bytes between rows of the texture. Zero | 39 * @param rowBytes The number of bytes between rows of the texture. Zero |
| 40 * implies tightly packed rows. For compressed pixel config
s, this | 40 * implies tightly packed rows. For compressed pixel config
s, this |
| 41 * field is ignored. | 41 * field is ignored. |
| 42 */ | 42 */ |
| 43 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, con
st void* srcData, | 43 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, con
st void* srcData, |
| 44 size_t rowBytes); | 44 size_t rowBytes); |
| 45 | 45 |
| 46 /** Shortcut for creating a texture with no initial data to upload. */ | 46 /** Shortcut for creating a texture with no initial data to upload. */ |
| 47 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) { | 47 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) { |
| 48 return this->createTexture(desc, budgeted, NULL, 0); | 48 return this->createTexture(desc, budgeted, nullptr, 0); |
| 49 } | 49 } |
| 50 | 50 |
| 51 /** Assigns a unique key to the texture. The texture will be findable via th
is key using | 51 /** Assigns a unique key to the texture. The texture will be findable via th
is key using |
| 52 findTextureByUniqueKey(). If an existing texture has this key, it's key
will be removed. */ | 52 findTextureByUniqueKey(). If an existing texture has this key, it's key
will be removed. */ |
| 53 void assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) { | 53 void assignUniqueKeyToTexture(const GrUniqueKey& key, GrTexture* texture) { |
| 54 this->assignUniqueKeyToResource(key, texture); | 54 this->assignUniqueKeyToResource(key, texture); |
| 55 } | 55 } |
| 56 | 56 |
| 57 /** Finds a texture by unique key. If the texture is found it is ref'ed and
returned. */ | 57 /** Finds a texture by unique key. If the texture is found it is ref'ed and
returned. */ |
| 58 GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key); | 58 GrTexture* findAndRefTextureByUniqueKey(const GrUniqueKey& key); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 private: | 166 private: |
| 167 GrResourceCache* fCache; | 167 GrResourceCache* fCache; |
| 168 GrGpu* fGpu; | 168 GrGpu* fGpu; |
| 169 | 169 |
| 170 // In debug builds we guard against improper thread handling | 170 // In debug builds we guard against improper thread handling |
| 171 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 171 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 #endif | 174 #endif |
| OLD | NEW |