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

Side by Side Diff: cc/debug/traced_picture.cc

Issue 14772032: Trace picture piles on layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/debug/traced_picture.h" 5 #include "cc/debug/traced_picture.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "cc/debug/traced_value.h" 10 #include "cc/debug/traced_value.h"
(...skipping 10 matching lines...) Expand all
21 scoped_ptr<base::debug::ConvertableToTraceFormat> 21 scoped_ptr<base::debug::ConvertableToTraceFormat>
22 TracedPicture::AsTraceablePicture(Picture* picture) { 22 TracedPicture::AsTraceablePicture(Picture* picture) {
23 TracedPicture* ptr = new TracedPicture(picture); 23 TracedPicture* ptr = new TracedPicture(picture);
24 scoped_ptr<TracedPicture> result(ptr); 24 scoped_ptr<TracedPicture> result(ptr);
25 return result.PassAs<base::debug::ConvertableToTraceFormat>(); 25 return result.PassAs<base::debug::ConvertableToTraceFormat>();
26 } 26 }
27 27
28 void TracedPicture::AppendAsTraceFormat(std::string* out) const { 28 void TracedPicture::AppendAsTraceFormat(std::string* out) const {
29 std::string encoded_picture; 29 std::string encoded_picture;
30 picture_->AsBase64String(&encoded_picture); 30 picture_->AsBase64String(&encoded_picture);
31 out->append("\""); 31 out->append("{");
32 out->append("\"layer_rect\": [");
33 base::StringAppendF(
34 out, "%i,%i,%i,%i",
35 picture_->LayerRect().x(), picture_->LayerRect().y(),
vmpstr2 2013/05/14 18:16:09 picture's layer rect is encoded as a part of AsBas
36 picture_->LayerRect().width(), picture_->LayerRect().height());
37 out->append("],");
38 out->append("\"data_b64\": \"");
32 out->append(encoded_picture); 39 out->append(encoded_picture);
33 out->append("\""); 40 out->append("\"}");
34 } 41 }
35 42
36 } // namespace cc 43 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698