| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/resources/picture.h" | 5 #include "cc/resources/picture.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); | 405 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); |
| 406 res->Set("params.layer_rect", MathUtil::AsValue(layer_rect_).release()); | 406 res->Set("params.layer_rect", MathUtil::AsValue(layer_rect_).release()); |
| 407 | 407 |
| 408 size_t serialized_size = stream.bytesWritten(); | 408 size_t serialized_size = stream.bytesWritten(); |
| 409 scoped_ptr<char[]> serialized_picture(new char[serialized_size]); | 409 scoped_ptr<char[]> serialized_picture(new char[serialized_size]); |
| 410 stream.copyTo(serialized_picture.get()); | 410 stream.copyTo(serialized_picture.get()); |
| 411 std::string b64_picture; | 411 std::string b64_picture; |
| 412 base::Base64Encode(std::string(serialized_picture.get(), serialized_size), | 412 base::Base64Encode(std::string(serialized_picture.get(), serialized_size), |
| 413 &b64_picture); | 413 &b64_picture); |
| 414 res->SetString("skp64", b64_picture); | 414 res->SetString("skp64", b64_picture); |
| 415 return res.PassAs<base::Value>(); | 415 return res.Pass(); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void Picture::EmitTraceSnapshot() const { | 418 void Picture::EmitTraceSnapshot() const { |
| 419 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( | 419 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( |
| 420 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( | 420 TRACE_DISABLED_BY_DEFAULT("cc.debug") "," TRACE_DISABLED_BY_DEFAULT( |
| 421 "devtools.timeline.picture"), | 421 "devtools.timeline.picture"), |
| 422 "cc::Picture", | 422 "cc::Picture", |
| 423 this, | 423 this, |
| 424 TracedPicture::AsTraceablePicture(this)); | 424 TracedPicture::AsTraceablePicture(this)); |
| 425 } | 425 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 scoped_refptr<base::debug::TracedValue> record_data = | 547 scoped_refptr<base::debug::TracedValue> record_data = |
| 548 new base::debug::TracedValue(); | 548 new base::debug::TracedValue(); |
| 549 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 549 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
| 550 record_data->BeginArray("layer_rect"); | 550 record_data->BeginArray("layer_rect"); |
| 551 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 551 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
| 552 record_data->EndArray(); | 552 record_data->EndArray(); |
| 553 return record_data; | 553 return record_data; |
| 554 } | 554 } |
| 555 | 555 |
| 556 } // namespace cc | 556 } // namespace cc |
| OLD | NEW |