| 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 |
| 11 #include "base/base64.h" | 11 #include "base/base64.h" |
| 12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
| 13 #include "base/debug/trace_event_argument.h" | |
| 14 #include "base/values.h" | 13 #include "base/values.h" |
| 15 #include "cc/base/math_util.h" | 14 #include "cc/base/math_util.h" |
| 16 #include "cc/base/util.h" | 15 #include "cc/base/util.h" |
| 17 #include "cc/debug/traced_picture.h" | 16 #include "cc/debug/traced_picture.h" |
| 18 #include "cc/debug/traced_value.h" | 17 #include "cc/debug/traced_value.h" |
| 19 #include "cc/layers/content_layer_client.h" | 18 #include "cc/layers/content_layer_client.h" |
| 20 #include "skia/ext/pixel_ref_utils.h" | 19 #include "skia/ext/pixel_ref_utils.h" |
| 21 #include "third_party/skia/include/core/SkCanvas.h" | 20 #include "third_party/skia/include/core/SkCanvas.h" |
| 22 #include "third_party/skia/include/core/SkData.h" | 21 #include "third_party/skia/include/core/SkData.h" |
| 23 #include "third_party/skia/include/core/SkDrawFilter.h" | 22 #include "third_party/skia/include/core/SkDrawFilter.h" |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 // We found a non-empty list: store it and get the first pixel ref. | 579 // We found a non-empty list: store it and get the first pixel ref. |
| 581 current_pixel_refs_ = &iter->second; | 580 current_pixel_refs_ = &iter->second; |
| 582 current_index_ = 0; | 581 current_index_ = 0; |
| 583 break; | 582 break; |
| 584 } | 583 } |
| 585 return *this; | 584 return *this; |
| 586 } | 585 } |
| 587 | 586 |
| 588 scoped_refptr<base::debug::ConvertableToTraceFormat> | 587 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 589 Picture::AsTraceableRasterData(float scale) const { | 588 Picture::AsTraceableRasterData(float scale) const { |
| 590 scoped_refptr<base::debug::TracedValue> raster_data = | 589 scoped_ptr<base::DictionaryValue> raster_data(new base::DictionaryValue()); |
| 591 new base::debug::TracedValue(); | 590 raster_data->Set("picture_id", TracedValue::CreateIDRef(this).release()); |
| 592 TracedValue::SetIDRef(this, raster_data.get(), "picture_id"); | |
| 593 raster_data->SetDouble("scale", scale); | 591 raster_data->SetDouble("scale", scale); |
| 594 return raster_data; | 592 return TracedValue::FromValue(raster_data.release()); |
| 595 } | 593 } |
| 596 | 594 |
| 597 scoped_refptr<base::debug::ConvertableToTraceFormat> | 595 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 598 Picture::AsTraceableRecordData() const { | 596 Picture::AsTraceableRecordData() const { |
| 599 scoped_refptr<base::debug::TracedValue> record_data = | 597 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); |
| 600 new base::debug::TracedValue(); | 598 record_data->Set("picture_id", TracedValue::CreateIDRef(this).release()); |
| 601 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 599 record_data->Set("layer_rect", MathUtil::AsValue(layer_rect_).release()); |
| 602 record_data->BeginArray("layer_rect"); | 600 return TracedValue::FromValue(record_data.release()); |
| 603 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | |
| 604 record_data->EndArray(); | |
| 605 return record_data; | |
| 606 } | 601 } |
| 607 | 602 |
| 608 } // namespace cc | 603 } // namespace cc |
| OLD | NEW |