aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-15 20:17:47 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-15 20:17:47 +0000
commit76f9e938df0b5826fd4c80b854ceafaf385cfbe1 (patch)
tree5e72265c6e177791a1fff149763308454c958429 /include
parent06b8a19b5693a352cabe8e624469e67e335bc369 (diff)
Added print out of SkShader information to debugger
Diffstat (limited to 'include')
-rw-r--r--include/core/SkBitmap.h3
-rw-r--r--include/core/SkColorShader.h1
-rw-r--r--include/core/SkComposeShader.h1
-rw-r--r--include/core/SkEmptyShader.h1
-rw-r--r--include/core/SkMatrix.h4
-rw-r--r--include/core/SkShader.h2
-rw-r--r--include/core/SkTypes.h10
-rw-r--r--include/effects/SkTransparentShader.h1
-rw-r--r--include/utils/SkDumpCanvas.h4
9 files changed, 25 insertions, 2 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 7ea950bea2..4ec3ea41cb 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -21,6 +21,7 @@ struct SkRect;
class SkPaint;
class SkPixelRef;
class SkRegion;
+class SkString;
// This is an opaque class, not interpreted by skia
class SkGpuTexture;
@@ -625,6 +626,8 @@ public:
int fHeight;
};
+ SkDEVCODE(void toString(SkString* str) const;)
+
private:
struct MipMap;
mutable MipMap* fMipMap;
diff --git a/include/core/SkColorShader.h b/include/core/SkColorShader.h
index 0823b70b69..c3790682e4 100644
--- a/include/core/SkColorShader.h
+++ b/include/core/SkColorShader.h
@@ -48,6 +48,7 @@ public:
virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
+ SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader)
protected:
diff --git a/include/core/SkComposeShader.h b/include/core/SkComposeShader.h
index b0790bf393..524161b785 100644
--- a/include/core/SkComposeShader.h
+++ b/include/core/SkComposeShader.h
@@ -39,6 +39,7 @@ public:
virtual void endContext() SK_OVERRIDE;
virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE;
+ SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeShader)
protected:
diff --git a/include/core/SkEmptyShader.h b/include/core/SkEmptyShader.h
index 13da457ad4..08c131db1b 100644
--- a/include/core/SkEmptyShader.h
+++ b/include/core/SkEmptyShader.h
@@ -30,6 +30,7 @@ public:
virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE;
virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) SK_OVERRIDE;
+ SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader)
protected:
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 2d3786cf31..f9b72d7aeb 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -527,8 +527,8 @@ public:
// return the number of bytes read
uint32_t readFromMemory(const void* buffer);
- void dump() const;
- void toDumpString(SkString*) const;
+ SkDEVCODE(void dump() const;)
+ SkDEVCODE(void toString(SkString*) const;)
/**
* Calculates the maximum stretching factor of the matrix. If the matrix has
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index d5945afdd7..899e3b6122 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -341,6 +341,8 @@ public:
static SkShader* CreateBitmapShader(const SkBitmap& src,
TileMode tmx, TileMode tmy);
+ SkDEVCODE(virtual void toString(SkString* str) const;)
+
protected:
enum MatrixClass {
kLinear_MatrixClass, // no perspective
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 113fd00e6b..cbba50cc1b 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -112,6 +112,16 @@ inline void operator delete(void* p) {
#define SkAssertResult(cond) cond
#endif
+#ifdef SK_DEVELOPER
+ #define SkDEVCODE(code) code
+ // the 'toString' helper functions convert Sk* objects to human-readable
+ // form in developer mode
+ #define SK_DEVELOPER_TO_STRING() virtual void toString(SkString* str) const SK_OVERRIDE;
+#else
+ #define SkDEVCODE(code)
+ #define SK_DEVELOPER_TO_STRING()
+#endif
+
template <bool>
struct SkCompileAssert {
};
diff --git a/include/effects/SkTransparentShader.h b/include/effects/SkTransparentShader.h
index 74187f7912..bee9a02d2d 100644
--- a/include/effects/SkTransparentShader.h
+++ b/include/effects/SkTransparentShader.h
@@ -21,6 +21,7 @@ public:
virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE;
virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE;
+ SK_DEVELOPER_TO_STRING()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader)
private:
diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h
index 608ab01334..8d9c67d50d 100644
--- a/include/utils/SkDumpCanvas.h
+++ b/include/utils/SkDumpCanvas.h
@@ -10,6 +10,8 @@
#include "SkCanvas.h"
+#ifdef SK_DEVELOPER
+
/** This class overrides all the draw methods on SkCanvas, and formats them
as text, and then sends that to a Dumper helper object.
@@ -155,3 +157,5 @@ private:
};
#endif
+
+#endif