Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: cc/paint/display_item_list.cc

Issue 2881063003: cc: Change RTree::Search to return results, add comments, more tests. (Closed)
Patch Set: update Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/paint/discardable_image_map_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/paint/discardable_image_map_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698