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

Unified Diff: src/gpu/GrGpu.h

Issue 1760343003: Revert of Don't allow nullptr in texels array params (unless using a transfer buffer). (Closed) Base URL: https://skia.googlesource.com/skia@usesdk
Patch Set: Created 4 years, 10 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 | « include/gpu/GrTextureProvider.h ('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 5b4c05a0fd6b86d46d534d4743c5ef9fe1d15baa..5d35fcf859bca3792681e9e6ff5037e92fc9fdf0 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -96,13 +96,22 @@
const SkTArray<GrMipLevel>& texels);
/**
- * Simplified createTexture() interface when there is no initial texel data
- * to upload.
- */
- GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) {
- return this->createTexture(desc, budgeted, SkTArray<GrMipLevel>());
- }
-
+ * 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.
+ */
+ GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted,
+ const void* srcData, size_t rowBytes);
+
/**
* Implements GrTextureProvider::wrapBackendTexture
*/
« no previous file with comments | « include/gpu/GrTextureProvider.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698