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

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

Issue 2914863003: Use SaveLayerAlpha bounds when doing Save-Draw-Restore optimization (Closed)
Patch Set: savebounds . Created 3 years, 6 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 | « no previous file | cc/paint/paint_op_buffer.h » ('j') | 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // relevant here and that lcd text is preserved post merge, but I haven't 176 // relevant here and that lcd text is preserved post merge, but I haven't
177 // tested that. 177 // tested that.
178 const PaintRecord* record = draw_item.picture.get(); 178 const PaintRecord* record = draw_item.picture.get();
179 if (record->size() != 1u) 179 if (record->size() != 1u)
180 return false; 180 return false;
181 181
182 const PaintOp* op = record->GetFirstOp(); 182 const PaintOp* op = record->GetFirstOp();
183 if (!op->IsDrawOp()) 183 if (!op->IsDrawOp())
184 return false; 184 return false;
185 185
186 op->RasterWithAlpha(canvas, save_item.alpha); 186 SkRect bounds = save_item.has_bounds ? save_item.bounds : PaintOp::kUnsetRect;
187 op->RasterWithAlpha(canvas, bounds, save_item.alpha);
187 return true; 188 return true;
188 } 189 }
189 190
190 void DisplayItemList::Raster(SkCanvas* canvas, 191 void DisplayItemList::Raster(SkCanvas* canvas,
191 SkPicture::AbortCallback* callback) const { 192 SkPicture::AbortCallback* callback) const {
192 gfx::Rect canvas_playback_rect; 193 gfx::Rect canvas_playback_rect;
193 if (!GetCanvasClipBounds(canvas, &canvas_playback_rect)) 194 if (!GetCanvasClipBounds(canvas, &canvas_playback_rect))
194 return; 195 return;
195 196
196 std::vector<size_t> indices = rtree_.Search(canvas_playback_rect); 197 std::vector<size_t> indices = rtree_.Search(canvas_playback_rect);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 std::vector<DrawImage>* images) { 537 std::vector<DrawImage>* images) {
537 image_map_.GetDiscardableImagesInRect(rect, contents_scale, 538 image_map_.GetDiscardableImagesInRect(rect, contents_scale,
538 target_color_space, images); 539 target_color_space, images);
539 } 540 }
540 541
541 gfx::Rect DisplayItemList::GetRectForImage(PaintImage::Id image_id) const { 542 gfx::Rect DisplayItemList::GetRectForImage(PaintImage::Id image_id) const {
542 return image_map_.GetRectForImage(image_id); 543 return image_map_.GetRectForImage(image_id);
543 } 544 }
544 545
545 } // namespace cc 546 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/paint/paint_op_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698