aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-01-02 20:45:37 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-02 20:45:37 -0800
commitf8d18743d49493038a761479b7ae55535b9f215d (patch)
treeaa7a866e117e0bd588737661b11e8f8bcbd8e5b2 /src
parent787bb480f6b615a4a4c7b65955452575a51b1587 (diff)
add toString to SkImage
BUG=skia: TBR= Review URL: https://codereview.chromium.org/823013003
Diffstat (limited to 'src')
-rw-r--r--src/image/SkImage.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 1acff3e4ed..8796b03283 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -10,6 +10,7 @@
#include "SkImagePriv.h"
#include "SkImage_Base.h"
#include "SkReadPixelsRec.h"
+#include "SkString.h"
#include "SkSurface.h"
uint32_t SkImage::NextUniqueID() {
@@ -78,6 +79,12 @@ SkSurface* SkImage::newSurface(const SkImageInfo& info, const SkSurfaceProps* pr
return as_IB(this)->onNewSurface(info, *props);
}
+const char* SkImage::toString(SkString* str) const {
+ str->appendf("image: (id:%d (%d, %d) %s)", this->uniqueID(), this->width(), this->height(),
+ this->isOpaque() ? "opaque" : "");
+ return str->c_str();
+}
+
///////////////////////////////////////////////////////////////////////////////
static bool raster_canvas_supports(const SkImageInfo& info) {