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

Unified Diff: include/core/SkImage.h

Issue 741763002: add SkImage::newSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: another warning fix Created 6 years, 1 month 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 | « gm/surface.cpp ('k') | include/core/SkSurfaceProps.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 4e016348559b0f32358a710269724dedba545fd4..63fa41b4e7953a4448b4abf40bd58d10704a2b61 100644
--- a/include/core/SkImage.h
+++ b/include/core/SkImage.h
@@ -18,6 +18,8 @@ class SkData;
class SkCanvas;
class SkImageGenerator;
class SkPaint;
+class SkSurface;
+class SkSurfaceProps;
class GrContext;
class GrTexture;
@@ -92,6 +94,15 @@ public:
SkData* encode(SkImageEncoder::Type t = SkImageEncoder::kPNG_Type,
int quality = 80) const;
+ /**
+ * Return a new surface that is compatible with this image's internal representation
+ * (e.g. raster or gpu).
+ *
+ * If no surfaceprops are specified, the image will attempt to match the props of when it
+ * was created (if it came from a surface).
+ */
+ SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps* = NULL) const;
+
protected:
SkImage(int width, int height) :
fWidth(width),
« no previous file with comments | « gm/surface.cpp ('k') | include/core/SkSurfaceProps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698