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

Unified Diff: src/gpu/GrGpu.h

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698