OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/playback/drawing_display_item.h" | 5 #include "cc/playback/drawing_display_item.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // SkPicture always does a wrapping save/restore on the canvas, so it is not | 84 // SkPicture always does a wrapping save/restore on the canvas, so it is not |
85 // necessary here. | 85 // necessary here. |
86 if (callback) | 86 if (callback) |
87 picture_->playback(canvas, callback); | 87 picture_->playback(canvas, callback); |
88 else | 88 else |
89 canvas->drawPicture(picture_.get()); | 89 canvas->drawPicture(picture_.get()); |
90 } | 90 } |
91 | 91 |
92 void DrawingDisplayItem::AsValueInto( | 92 void DrawingDisplayItem::AsValueInto( |
| 93 const gfx::Rect& visual_rect, |
93 base::trace_event::TracedValue* array) const { | 94 base::trace_event::TracedValue* array) const { |
94 array->BeginDictionary(); | 95 array->BeginDictionary(); |
95 array->SetString("name", "DrawingDisplayItem"); | 96 array->SetString("name", "DrawingDisplayItem"); |
96 | 97 |
| 98 array->BeginArray("visualRect"); |
| 99 array->AppendInteger(visual_rect.x()); |
| 100 array->AppendInteger(visual_rect.y()); |
| 101 array->AppendInteger(visual_rect.width()); |
| 102 array->AppendInteger(visual_rect.height()); |
| 103 array->EndArray(); |
| 104 |
97 array->BeginArray("cullRect"); | 105 array->BeginArray("cullRect"); |
98 array->AppendInteger(picture_->cullRect().x()); | 106 array->AppendInteger(picture_->cullRect().x()); |
99 array->AppendInteger(picture_->cullRect().y()); | 107 array->AppendInteger(picture_->cullRect().y()); |
100 array->AppendInteger(picture_->cullRect().width()); | 108 array->AppendInteger(picture_->cullRect().width()); |
101 array->AppendInteger(picture_->cullRect().height()); | 109 array->AppendInteger(picture_->cullRect().height()); |
102 array->EndArray(); | 110 array->EndArray(); |
103 | 111 |
104 std::string b64_picture; | 112 std::string b64_picture; |
105 PictureDebugUtil::SerializeAsBase64(picture_.get(), &b64_picture); | 113 PictureDebugUtil::SerializeAsBase64(picture_.get(), &b64_picture); |
106 array->SetString("skp64", b64_picture); | 114 array->SetString("skp64", b64_picture); |
107 array->EndDictionary(); | 115 array->EndDictionary(); |
108 } | 116 } |
109 | 117 |
110 void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const { | 118 void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const { |
111 item->SetNew(picture_); | 119 item->SetNew(picture_); |
112 } | 120 } |
113 | 121 |
114 } // namespace cc | 122 } // namespace cc |
OLD | NEW |