OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <limits> | 6 #include <limits> |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 void PicturePileImpl::RasterCommon(SkCanvas* canvas, | 206 void PicturePileImpl::RasterCommon(SkCanvas* canvas, |
207 SkPicture::AbortCallback* callback, | 207 SkPicture::AbortCallback* callback, |
208 const gfx::Rect& canvas_rect, | 208 const gfx::Rect& canvas_rect, |
209 float contents_scale) const { | 209 float contents_scale) const { |
210 DCHECK(contents_scale >= min_contents_scale_); | 210 DCHECK(contents_scale >= min_contents_scale_); |
211 | 211 |
212 canvas->translate(-canvas_rect.x(), -canvas_rect.y()); | 212 canvas->translate(-canvas_rect.x(), -canvas_rect.y()); |
213 gfx::Rect content_tiling_rect = gfx::ToEnclosingRect( | 213 gfx::Rect content_tiling_rect = gfx::ScaleToEnclosingRect( |
214 gfx::ScaleRect(gfx::Rect(tiling_.tiling_size()), contents_scale)); | 214 gfx::Rect(tiling_.tiling_size()), contents_scale); |
215 content_tiling_rect.Intersect(canvas_rect); | 215 content_tiling_rect.Intersect(canvas_rect); |
216 | 216 |
217 canvas->clipRect(gfx::RectToSkRect(content_tiling_rect), | 217 canvas->clipRect(gfx::RectToSkRect(content_tiling_rect), |
218 SkRegion::kIntersect_Op); | 218 SkRegion::kIntersect_Op); |
219 | 219 |
220 PictureRegionMap picture_region_map; | 220 PictureRegionMap picture_region_map; |
221 CoalesceRasters( | 221 CoalesceRasters( |
222 canvas_rect, content_tiling_rect, contents_scale, &picture_region_map); | 222 canvas_rect, content_tiling_rect, contents_scale, &picture_region_map); |
223 | 223 |
224 #ifndef NDEBUG | 224 #ifndef NDEBUG |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 for (const auto& map_pair : picture_map_) { | 454 for (const auto& map_pair : picture_map_) { |
455 const Picture* picture = map_pair.second.get(); | 455 const Picture* picture = map_pair.second.get(); |
456 if (processed_pictures.count(picture) == 0) { | 456 if (processed_pictures.count(picture) == 0) { |
457 picture->EmitTraceSnapshot(); | 457 picture->EmitTraceSnapshot(); |
458 processed_pictures.insert(picture); | 458 processed_pictures.insert(picture); |
459 } | 459 } |
460 } | 460 } |
461 } | 461 } |
462 | 462 |
463 } // namespace cc | 463 } // namespace cc |
OLD | NEW |