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

Unified Diff: src/image/SkImage.cpp

Issue 823013003: add toString to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 12 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/core/SkImage.h ('k') | no next file » | 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 1acff3e4ed5ff7bad77e7bc63643c5bda0f39974..8796b0328355f1c5049ee0151454197c74acbc57 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) {
« no previous file with comments | « include/core/SkImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698