Index: src/gpu/GrGpu.h |
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h |
index ebe4116ebed388ee8277554baa1692a0cacbb607..9725590544fbc599bf91df5317462e764108c623 100644 |
--- a/src/gpu/GrGpu.h |
+++ b/src/gpu/GrGpu.h |
@@ -97,21 +97,21 @@ public: |
const SkTArray<GrMipLevel>& texels); |
/** |
- * This function is a shim which creates a SkTArGrMipLevell> of size 1. |
- * It then calls createTexture with that SkTArray. |
- * |
- * @param srcData texel data to load texture. Begins with full-size |
- * palette data for paletted texture. For compressed |
- * formats it contains the compressed pixel data. Otherwise, |
- * it contains width*height texels. If nullptr 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 pixel formats. |
- * @return The texture object if successful, otherwise, nullptr. |
+ * Simplified createTexture() interface for when there is no initial texel data to upload. |
*/ |
- GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
- const void* srcData, size_t rowBytes); |
+ GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) { |
+ return this->createTexture(desc, budgeted, SkTArray<GrMipLevel>()); |
+ } |
+ |
+ /** Simplified createTexture() interface for when there is only a base level */ |
+ GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, const void* level0Data, |
+ size_t rowBytes) { |
+ SkASSERT(level0Data); |
+ GrMipLevel level = { level0Data, rowBytes }; |
+ SkSTArray<1, GrMipLevel> array; |
+ array.push_back() = level; |
+ return this->createTexture(desc, budgeted, array); |
+ } |
/** |
* Implements GrTextureProvider::wrapBackendTexture |