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

Unified Diff: src/gpu/GrGpu.h

Issue 302783002: Initial work to get ETC1 data up to the GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add #define to not always compile in ETC1 support Created 6 years, 7 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
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 11f87e0458d9b0b8b0aa3cd386ee7363d4a6028c..cd7502e18ac3a0f5a0588d5c9aaafe1ab479d094 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -71,15 +71,26 @@ public:
* two but underlying API requires a power of two texture then srcData
* will be embedded in a power of two texture. The extra width and height
* is filled as though srcData were rendered clamped into the texture.
+ * The exception is when using compressed data formats. In this case, the
+ * desc width and height must be a multiple of the compressed format block
+ * size otherwise this function returns NULL. Similarly, if the underlying
+ * API requires a power of two texture and the source width and height are not
+ * a power of two, then this function returns NULL.
*
* If kRenderTarget_TextureFlag is specified the GrRenderTarget is
* accessible via GrTexture::asRenderTarget(). The texture will hold a ref
- * on the render target until the texture is destroyed.
+ * on the render target until the texture is destroyed. Compressed textures
+ * cannot have the kRenderTarget_TextureFlag set.
*
* @param desc describes the texture to be created.
* @param srcData texel data to load texture. Begins with full-size
- * palette data for paletted textures. Contains width*
- * height texels. If NULL texture data is uninitialized.
+ * palette data for paletted textures. For compressed
+ * formats it contains the compressed pixel data. Otherwise,
+ * it contains width*height texels. If NULL texture data
+ * is uninitialized.
+ * @param rowBytes the number of bytes between consecutive rows. Zero
+ * means rows are tightly packed. This field is ignored
+ * for compressed formats.
*
* @return The texture object if successful, otherwise NULL.
*/
@@ -414,6 +425,8 @@ private:
virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
const void* srcData,
size_t rowBytes) = 0;
+ virtual GrTexture* onCreateCompressedTexture(const GrTextureDesc& desc,
+ const void* srcData) = 0;
virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0;
virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&) = 0;
virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0;
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698