Chromium Code Reviews| Index: tools/debugger/SkDrawCommand.cpp |
| diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp |
| index 985f7d5cc3705de219d2b7620e69e1fd0456b941..306bc48f8d5f1c3e0c4715865205e32d938c218c 100644 |
| --- a/tools/debugger/SkDrawCommand.cpp |
| +++ b/tools/debugger/SkDrawCommand.cpp |
| @@ -12,6 +12,7 @@ |
| #include "SkColorFilter.h" |
| #include "SkDashPathEffect.h" |
| #include "SkImageFilter.h" |
| +#include "SkJsonWriteBuffer.h" |
| #include "SkMaskFilter.h" |
| #include "SkObjectParser.h" |
| #include "SkPaintDefaults.h" |
| @@ -63,6 +64,7 @@ |
| #define SKDEBUGCANVAS_ATTRIBUTE_VERBS "verbs" |
| #define SKDEBUGCANVAS_ATTRIBUTE_NAME "name" |
| #define SKDEBUGCANVAS_ATTRIBUTE_DATA "data" |
| +#define SKDEBUGCANVAS_ATTRIBUTE_VALUES "values" |
|
Brian Osman
2016/04/28 14:22:33
This was previously "flattened", and I think Mike'
|
| #define SKDEBUGCANVAS_ATTRIBUTE_SHADER "shader" |
| #define SKDEBUGCANVAS_ATTRIBUTE_PATHEFFECT "pathEffect" |
| #define SKDEBUGCANVAS_ATTRIBUTE_MASKFILTER "maskFilter" |
| @@ -592,7 +594,7 @@ static void encode_data(const void* bytes, size_t count, const char* contentType |
| static void flatten(const SkFlattenable* flattenable, Json::Value* target, |
| UrlDataManager& urlDataManager) { |
| - SkWriteBuffer buffer; |
| + SkBinaryWriteBuffer buffer; |
| flattenable->flatten(buffer); |
| void* data = sk_malloc_throw(buffer.bytesWritten()); |
| buffer.writeToMemory(data); |
| @@ -601,6 +603,13 @@ static void flatten(const SkFlattenable* flattenable, Json::Value* target, |
| Json::Value jsonFlattenable; |
| jsonFlattenable[SKDEBUGCANVAS_ATTRIBUTE_NAME] = Json::Value(flattenable->getTypeName()); |
| jsonFlattenable[SKDEBUGCANVAS_ATTRIBUTE_DATA] = jsonData; |
| + |
| + { |
| + SkJsonWriteBuffer jsonBuffer(&urlDataManager); |
| + flattenable->flatten(jsonBuffer); |
| + jsonFlattenable[SKDEBUGCANVAS_ATTRIBUTE_VALUES] = jsonBuffer.getValue(); |
| + } |
| + |
| (*target) = jsonFlattenable; |
| sk_free(data); |
| } |