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/paint/drawing_display_item.h" | 5 #include "cc/paint/drawing_display_item.h" |
6 | 6 |
7 #include "third_party/skia/include/core/SkPicture.h" | 7 #include "third_party/skia/include/core/SkPicture.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 DrawingDisplayItem::DrawingDisplayItem() : DisplayItem(DRAWING) {} | 11 DrawingDisplayItem::DrawingDisplayItem() |
| 12 : DisplayItem(DRAWING), bounds(SkRect::MakeEmpty()) {} |
12 | 13 |
13 DrawingDisplayItem::DrawingDisplayItem(sk_sp<const PaintRecord> record) | 14 DrawingDisplayItem::DrawingDisplayItem(sk_sp<const PaintRecord> record, |
14 : DisplayItem(DRAWING), picture(std::move(record)) {} | 15 const SkRect& bounds) |
| 16 : DisplayItem(DRAWING), picture(std::move(record)), bounds(bounds) {} |
15 | 17 |
16 DrawingDisplayItem::DrawingDisplayItem(const DrawingDisplayItem& item) | 18 DrawingDisplayItem::DrawingDisplayItem(const DrawingDisplayItem& item) |
17 : DisplayItem(DRAWING), picture(item.picture) {} | 19 : DisplayItem(DRAWING), picture(item.picture), bounds(item.bounds) {} |
18 | 20 |
19 DrawingDisplayItem::~DrawingDisplayItem() = default; | 21 DrawingDisplayItem::~DrawingDisplayItem() = default; |
20 | 22 |
21 size_t DrawingDisplayItem::ExternalMemoryUsage() const { | 23 size_t DrawingDisplayItem::ExternalMemoryUsage() const { |
22 return picture->bytes_used(); | 24 return picture->bytes_used(); |
23 } | 25 } |
24 | 26 |
25 DISABLE_CFI_PERF | 27 DISABLE_CFI_PERF |
26 size_t DrawingDisplayItem::OpCount() const { | 28 size_t DrawingDisplayItem::OpCount() const { |
27 return picture->size(); | 29 return picture->size(); |
28 } | 30 } |
29 | 31 |
30 } // namespace cc | 32 } // namespace cc |
OLD | NEW |