Chromium Code Reviews| Index: include/gpu/GrTextureProvider.h |
| diff --git a/include/gpu/GrTextureProvider.h b/include/gpu/GrTextureProvider.h |
| index 28fda48c43e87dbf17d033e6fa37d0f62dc68a57..d96b2c516aa1db36ae38b2e9f064b1edede15f18 100644 |
| --- a/include/gpu/GrTextureProvider.h |
| +++ b/include/gpu/GrTextureProvider.h |
| @@ -9,6 +9,7 @@ |
| #define GrTextureProvider_DEFINED |
| #include "GrTexture.h" |
| +#include "SkMipMap.h" |
| class SK_API GrTextureProvider { |
| public: |
| @@ -29,6 +30,18 @@ public: |
| GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, const void* srcData, |
| size_t rowBytes); |
| + /** |
|
bsalomon
2015/07/22 17:21:10
What do you think about combining createTexture an
cblume
2015/07/22 18:32:40
I like that idea.
In general, I am in favor of ha
cblume
2015/07/24 23:49:03
Thinking a bit more about this...ideally mipmapped
|
| + * Creates a new mipmapped texture in the resource cache and returns it. The |
| + * caller owns a ref on the returned texture which must be balanced by a |
| + * call to unref. |
| + * |
| + * @param desc Description of the texture properties. |
| + * @param budgeted Does the texture count against the resource cache budget? |
| + * @param srcData The mipmap data used to populate the texture. |
| + */ |
| + GrTexture* createMipmappedTexture(const GrSurfaceDesc& desc, bool budgeted, |
| + const SkMipMap& srcData); |
| + |
| /** Shortcut for creating a texture with no initial data to upload. */ |
| GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted) { |
| return this->createTexture(desc, budgeted, NULL, 0); |