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

Unified Diff: include/core/SkImage.h

Issue 1121813002: new image from backend desc (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: set samplecount to 0 (for now) Created 5 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 | « no previous file | include/gpu/SkGr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImage.h
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index ebc9a2939408ad113b14329d7545cb51a5b3279d..7128f6ea3a2f7cda78ac8a91fe5aedd7df296782 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -64,6 +64,24 @@ public:
*/
static SkImage* NewFromData(SkData* data);
+ /**
+ * Create a new image from the specified descriptor. Note - the caller is responsible for
+ * managing the lifetime of the underlying platform texture.
+ *
+ * Will return NULL if the specified descriptor is unsupported.
+ */
+ static SkImage* NewFromTexture(GrContext*, const GrBackendTextureDesc&,
+ SkAlphaType = kPremul_SkAlphaType);
+
+ /**
+ * Create a new image by copying the pixels from the specified descriptor. No reference is
+ * kept to the original platform texture.
+ *
+ * Will return NULL if the specified descriptor is unsupported.
+ */
+ static SkImage* NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&,
+ SkAlphaType = kPremul_SkAlphaType);
+
int width() const { return fWidth; }
int height() const { return fHeight; }
uint32_t uniqueID() const { return fUniqueID; }
« no previous file with comments | « no previous file | include/gpu/SkGr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698