diff options
author | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 22:33:03 +0000 |
---|---|---|
committer | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-24 22:33:03 +0000 |
commit | dc5407d4f1f83a3004d38f42ca78880cb5bf616d (patch) | |
tree | 48e6f74041394b10a8cf86f12a67e19ab19dde77 /cc/debug | |
parent | 0c53f82641e1ca6c9a741df6ba400eb11f649535 (diff) | |
download | chromium_src-dc5407d4f1f83a3004d38f42ca78880cb5bf616d.zip chromium_src-dc5407d4f1f83a3004d38f42ca78880cb5bf616d.tar.gz chromium_src-dc5407d4f1f83a3004d38f42ca78880cb5bf616d.tar.bz2 |
Store picture parameters outside the b64-encoded data
This will allow us to save skp files from js without having to round-trip
through C++ to strip out the header data.
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/15784007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202203 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug')
-rw-r--r-- | cc/debug/traced_picture.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/cc/debug/traced_picture.cc b/cc/debug/traced_picture.cc index 33ae7e1..698c2db 100644 --- a/cc/debug/traced_picture.cc +++ b/cc/debug/traced_picture.cc @@ -26,18 +26,10 @@ scoped_ptr<base::debug::ConvertableToTraceFormat> } void TracedPicture::AppendAsTraceFormat(std::string* out) const { - std::string encoded_picture; - picture_->AsBase64String(&encoded_picture); - out->append("{"); - out->append("\"layer_rect\": ["); - base::StringAppendF( - out, "%i,%i,%i,%i", - picture_->LayerRect().x(), picture_->LayerRect().y(), - picture_->LayerRect().width(), picture_->LayerRect().height()); - out->append("],"); - out->append("\"data_b64\": \""); - out->append(encoded_picture); - out->append("\"}"); + scoped_ptr<base::Value> value = picture_->AsValue(); + std::string tmp; + base::JSONWriter::Write(value.get(), &tmp); + out->append(tmp); } } // namespace cc |