| 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/display_item_list.h" | 5 #include "cc/playback/display_item_list.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 DisplayItemListSettings(proto.settings())); | 60 DisplayItemListSettings(proto.settings())); |
| 61 | 61 |
| 62 for (int i = 0; i < proto.items_size(); i++) { | 62 for (int i = 0; i < proto.items_size(); i++) { |
| 63 const proto::DisplayItem& item_proto = proto.items(i); | 63 const proto::DisplayItem& item_proto = proto.items(i); |
| 64 DisplayItem* item = DisplayItemProtoFactory::AllocateAndConstruct( | 64 DisplayItem* item = DisplayItemProtoFactory::AllocateAndConstruct( |
| 65 layer_rect, list.get(), item_proto); | 65 layer_rect, list.get(), item_proto); |
| 66 if (item) | 66 if (item) |
| 67 item->FromProtobuf(item_proto); | 67 item->FromProtobuf(item_proto); |
| 68 } | 68 } |
| 69 | 69 |
| 70 list->Finalize(); |
| 71 |
| 70 return list; | 72 return list; |
| 71 } | 73 } |
| 72 | 74 |
| 73 DisplayItemList::DisplayItemList(gfx::Rect layer_rect, | 75 DisplayItemList::DisplayItemList(gfx::Rect layer_rect, |
| 74 const DisplayItemListSettings& settings, | 76 const DisplayItemListSettings& settings, |
| 75 bool retain_individual_display_items) | 77 bool retain_individual_display_items) |
| 76 : items_(LargestDisplayItemSize(), | 78 : items_(LargestDisplayItemSize(), |
| 77 LargestDisplayItemSize() * kDefaultNumDisplayItemsToReserve), | 79 LargestDisplayItemSize() * kDefaultNumDisplayItemsToReserve), |
| 78 settings_(settings), | 80 settings_(settings), |
| 79 retain_individual_display_items_(retain_individual_display_items), | 81 retain_individual_display_items_(retain_individual_display_items), |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 } | 340 } |
| 339 | 341 |
| 340 void DisplayItemList::GetDiscardableImagesInRect( | 342 void DisplayItemList::GetDiscardableImagesInRect( |
| 341 const gfx::Rect& rect, | 343 const gfx::Rect& rect, |
| 342 float raster_scale, | 344 float raster_scale, |
| 343 std::vector<DrawImage>* images) { | 345 std::vector<DrawImage>* images) { |
| 344 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images); | 346 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images); |
| 345 } | 347 } |
| 346 | 348 |
| 347 } // namespace cc | 349 } // namespace cc |
| OLD | NEW |