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

Unified Diff: src/image/SkImage.cpp

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 | « include/core/SkSurfaceProps.h ('k') | src/image/SkImagePriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index f11900dcaa29e7fa748d70f5c641280081bb383d..cbde961b7838ed5902c6796ffe963d903d63c49b 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -9,14 +9,7 @@
#include "SkCanvas.h"
#include "SkImagePriv.h"
#include "SkImage_Base.h"
-
-static SkImage_Base* as_IB(SkImage* image) {
- return static_cast<SkImage_Base*>(image);
-}
-
-static const SkImage_Base* as_IB(const SkImage* image) {
- return static_cast<const SkImage_Base*>(image);
-}
+#include "SkSurface.h"
uint32_t SkImage::NextUniqueID() {
static int32_t gUniqueID;
@@ -91,6 +84,13 @@ SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const {
return NULL;
}
+SkSurface* SkImage::newSurface(const SkImageInfo& info, const SkSurfaceProps* props) const {
+ if (NULL == props) {
+ props = &as_IB(this)->props();
+ }
+ return as_IB(this)->onNewSurface(info, *props);
+}
+
///////////////////////////////////////////////////////////////////////////////
static bool raster_canvas_supports(const SkImageInfo& info) {
« no previous file with comments | « include/core/SkSurfaceProps.h ('k') | src/image/SkImagePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698