| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 op->RasterWithAlpha(canvas, save_item.alpha); | 207 op->RasterWithAlpha(canvas, save_item.alpha); |
| 208 return true; | 208 return true; |
| 209 } | 209 } |
| 210 | 210 |
| 211 void DisplayItemList::Raster(SkCanvas* canvas, | 211 void DisplayItemList::Raster(SkCanvas* canvas, |
| 212 SkPicture::AbortCallback* callback) const { | 212 SkPicture::AbortCallback* callback) const { |
| 213 gfx::Rect canvas_playback_rect; | 213 gfx::Rect canvas_playback_rect; |
| 214 if (!GetCanvasClipBounds(canvas, &canvas_playback_rect)) | 214 if (!GetCanvasClipBounds(canvas, &canvas_playback_rect)) |
| 215 return; | 215 return; |
| 216 | 216 |
| 217 std::vector<size_t> indices; | 217 std::vector<size_t> indices = rtree_.Search(canvas_playback_rect); |
| 218 rtree_.Search(canvas_playback_rect, &indices); | |
| 219 for (size_t i = 0; i < indices.size(); ++i) { | 218 for (size_t i = 0; i < indices.size(); ++i) { |
| 220 // We use a callback during solid color analysis on the compositor thread to | 219 // We use a callback during solid color analysis on the compositor thread to |
| 221 // break out early. Since we're handling a sequence of pictures via rtree | 220 // break out early. Since we're handling a sequence of pictures via rtree |
| 222 // query results ourselves, we have to respect the callback and early out. | 221 // query results ourselves, we have to respect the callback and early out. |
| 223 if (callback && callback->abort()) | 222 if (callback && callback->abort()) |
| 224 break; | 223 break; |
| 225 | 224 |
| 226 const DisplayItem& item = items_[indices[i]]; | 225 const DisplayItem& item = items_[indices[i]]; |
| 227 // Optimize empty begin/end compositing and merge begin/draw/end compositing | 226 // Optimize empty begin/end compositing and merge begin/draw/end compositing |
| 228 // where possible. | 227 // where possible. |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 std::vector<DrawImage>* images) { | 557 std::vector<DrawImage>* images) { |
| 559 image_map_.GetDiscardableImagesInRect(rect, contents_scale, | 558 image_map_.GetDiscardableImagesInRect(rect, contents_scale, |
| 560 target_color_space, images); | 559 target_color_space, images); |
| 561 } | 560 } |
| 562 | 561 |
| 563 gfx::Rect DisplayItemList::GetRectForImage(ImageId image_id) const { | 562 gfx::Rect DisplayItemList::GetRectForImage(ImageId image_id) const { |
| 564 return image_map_.GetRectForImage(image_id); | 563 return image_map_.GetRectForImage(image_id); |
| 565 } | 564 } |
| 566 | 565 |
| 567 } // namespace cc | 566 } // namespace cc |
| OLD | NEW |