| 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/display_item_list.h" | 5 #include "cc/paint/display_item_list.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 << "items.size() " << items_.size() << " visual_rects.size() " | 258 << "items.size() " << items_.size() << " visual_rects.size() " |
| 259 << visual_rects_.size(); | 259 << visual_rects_.size(); |
| 260 rtree_.Build(visual_rects_); | 260 rtree_.Build(visual_rects_); |
| 261 | 261 |
| 262 if (!retain_visual_rects_) | 262 if (!retain_visual_rects_) |
| 263 // This clears both the vector and the vector's capacity, since | 263 // This clears both the vector and the vector's capacity, since |
| 264 // visual_rects won't be used anymore. | 264 // visual_rects won't be used anymore. |
| 265 std::vector<gfx::Rect>().swap(visual_rects_); | 265 std::vector<gfx::Rect>().swap(visual_rects_); |
| 266 } | 266 } |
| 267 | 267 |
| 268 bool DisplayItemList::IsSuitableForGpuRasterization() const { | |
| 269 // TODO(wkorman): This is more permissive than Picture's implementation, since | |
| 270 // none of the items might individually trigger a veto even though they | |
| 271 // collectively have enough "bad" operations that a corresponding Picture | |
| 272 // would get vetoed. See crbug.com/513016. | |
| 273 return all_items_are_suitable_for_gpu_rasterization_; | |
| 274 } | |
| 275 | |
| 276 int DisplayItemList::ApproximateOpCount() const { | 268 int DisplayItemList::ApproximateOpCount() const { |
| 277 return approximate_op_count_; | 269 return approximate_op_count_; |
| 278 } | 270 } |
| 279 | 271 |
| 280 size_t DisplayItemList::ApproximateMemoryUsage() const { | 272 size_t DisplayItemList::ApproximateMemoryUsage() const { |
| 281 size_t memory_usage = sizeof(*this); | 273 size_t memory_usage = sizeof(*this); |
| 282 | 274 |
| 283 size_t external_memory_usage = 0; | 275 size_t external_memory_usage = 0; |
| 284 for (const auto& item : items_) { | 276 for (const auto& item : items_) { |
| 285 size_t bytes = 0; | 277 size_t bytes = 0; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 std::vector<DrawImage>* images) { | 550 std::vector<DrawImage>* images) { |
| 559 image_map_.GetDiscardableImagesInRect(rect, contents_scale, | 551 image_map_.GetDiscardableImagesInRect(rect, contents_scale, |
| 560 target_color_space, images); | 552 target_color_space, images); |
| 561 } | 553 } |
| 562 | 554 |
| 563 gfx::Rect DisplayItemList::GetRectForImage(ImageId image_id) const { | 555 gfx::Rect DisplayItemList::GetRectForImage(ImageId image_id) const { |
| 564 return image_map_.GetRectForImage(image_id); | 556 return image_map_.GetRectForImage(image_id); |
| 565 } | 557 } |
| 566 | 558 |
| 567 } // namespace cc | 559 } // namespace cc |
| OLD | NEW |