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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |