Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 | 149 |
| 150 void DisplayItemList::Finalize() { | 150 void DisplayItemList::Finalize() { |
| 151 TRACE_EVENT0("cc", "DisplayItemList::Finalize"); | 151 TRACE_EVENT0("cc", "DisplayItemList::Finalize"); |
| 152 // TODO(dtrainor): Need to deal with serializing inputs_.visual_rects. | 152 // TODO(dtrainor): Need to deal with serializing inputs_.visual_rects. |
| 153 // http://crbug.com/568757. | 153 // http://crbug.com/568757. |
| 154 DCHECK(inputs_.items.size() == inputs_.visual_rects.size()) | 154 DCHECK(inputs_.items.size() == inputs_.visual_rects.size()) |
| 155 << "items.size() " << inputs_.items.size() << " visual_rects.size() " | 155 << "items.size() " << inputs_.items.size() << " visual_rects.size() " |
| 156 << inputs_.visual_rects.size(); | 156 << inputs_.visual_rects.size(); |
| 157 rtree_.Build(inputs_.visual_rects); | 157 rtree_.Build(inputs_.visual_rects); |
| 158 | 158 |
| 159 if (!retain_visual_rects_) | 159 // TODO(wkorman): Restore the below, potentially with a switch to allow |
| 160 // This clears both the vector and the vector's capacity, since | 160 // clearing visual rects except for Blimp engine. http://crbug.com/633750 |
| 161 // visual_rects won't be used anymore. | 161 // if (!retain_visual_rects_) |
|
Khushal
2016/08/03 00:29:05
We don't really need to do any post processing on
wkorman
2016/08/03 00:37:00
Yes, I wanted to do things more cleanly in a separ
Khushal
2016/08/03 00:44:42
Sorry for being unclear. I was suggesting that you
| |
| 162 std::vector<gfx::Rect>().swap(inputs_.visual_rects); | 162 // // This clears both the vector and the vector's capacity, since |
| 163 // // visual_rects won't be used anymore. | |
| 164 // std::vector<gfx::Rect>().swap(inputs_.visual_rects); | |
| 163 } | 165 } |
| 164 | 166 |
| 165 bool DisplayItemList::IsSuitableForGpuRasterization() const { | 167 bool DisplayItemList::IsSuitableForGpuRasterization() const { |
| 166 // TODO(wkorman): This is more permissive than Picture's implementation, since | 168 // TODO(wkorman): This is more permissive than Picture's implementation, since |
| 167 // none of the items might individually trigger a veto even though they | 169 // none of the items might individually trigger a veto even though they |
| 168 // collectively have enough "bad" operations that a corresponding Picture | 170 // collectively have enough "bad" operations that a corresponding Picture |
| 169 // would get vetoed. See crbug.com/513016. | 171 // would get vetoed. See crbug.com/513016. |
| 170 return inputs_.all_items_are_suitable_for_gpu_rasterization; | 172 return inputs_.all_items_are_suitable_for_gpu_rasterization; |
| 171 } | 173 } |
| 172 | 174 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 } | 256 } |
| 255 | 257 |
| 256 void DisplayItemList::GetDiscardableImagesInRect( | 258 void DisplayItemList::GetDiscardableImagesInRect( |
| 257 const gfx::Rect& rect, | 259 const gfx::Rect& rect, |
| 258 float raster_scale, | 260 float raster_scale, |
| 259 std::vector<DrawImage>* images) { | 261 std::vector<DrawImage>* images) { |
| 260 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images); | 262 image_map_.GetDiscardableImagesInRect(rect, raster_scale, images); |
| 261 } | 263 } |
| 262 | 264 |
| 263 } // namespace cc | 265 } // namespace cc |
| OLD | NEW |