Index: src/gpu/GrGpu.h |
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h |
index 9365d8927f650d4da1e75635c6359207b99974a0..5a81f5ae40607e6c3e8b3ea509c15167e57edd7e 100644 |
--- a/src/gpu/GrGpu.h |
+++ b/src/gpu/GrGpu.h |
@@ -13,6 +13,7 @@ |
#include "GrStencil.h" |
#include "GrTraceMarker.h" |
#include "GrXferProcessor.h" |
+#include "SkMipMap.h" |
#include "SkPath.h" |
class GrBatchTracker; |
@@ -95,6 +96,21 @@ public: |
const void* srcData, size_t rowBytes); |
/** |
+ * Creates a mipmapped texture object. If kRenderTarget_GrSurfaceFlag the texture can |
+ * be used as a render target by calling GrTexture::asRenderTarget(). Not all |
+ * pixel configs can be used as render targets. Support for configs as textures |
+ * or render targets can be checked using GrCaps. |
+ * |
+ * @param desc describes the texture to be created. |
+ * @param budgeted does this texture count against the resource cache budget? |
+ * @param srcData texel data to load texture. |
+ * |
+ * @return The texture object if successful, otherwise NULL. |
+ */ |
+ GrTexture* createMipmappedTexture(const GrSurfaceDesc& desc, bool budgeted, |
+ const SkMipMap& srcData); |
+ |
+ /** |
* Implements GrContext::wrapBackendTexture |
*/ |
GrTexture* wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership); |
@@ -408,6 +424,13 @@ private: |
virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
GrGpuResource::LifeCycle lifeCycle, |
const void* srcData) = 0; |
+ virtual GrTexture* onCreateMipmappedTexture(const GrSurfaceDesc& desc, |
+ GrGpuResource::LifeCycle lifeCycle, |
+ const SkMipMap& srcData) = 0; |
+ virtual GrTexture* onCreateCompressedMipmappedTexture(const GrSurfaceDesc& desc, |
+ GrGpuResource::LifeCycle lifeCycle, |
+ const SkMipMap& srcData) = 0; |
+ |
virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership) = 0; |
virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
GrWrapOwnership) = 0; |