OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resources/picture_pile_base.h" | 5 #include "cc/resources/picture_pile_base.h" |
6 | 6 |
| 7 #include <algorithm> |
| 8 #include <vector> |
| 9 |
7 #include "base/logging.h" | 10 #include "base/logging.h" |
8 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
9 #include "ui/gfx/rect_conversions.h" | 12 #include "ui/gfx/rect_conversions.h" |
10 | 13 |
11 namespace { | 14 namespace { |
12 // Dimensions of the tiles in this picture pile as well as the dimensions of | 15 // Dimensions of the tiles in this picture pile as well as the dimensions of |
13 // the base picture in each tile. | 16 // the base picture in each tile. |
14 const int kBasePictureSize = 3000; | 17 const int kBasePictureSize = 3000; |
15 const int kTileGridBorderPixels = 1; | 18 const int kTileGridBorderPixels = 1; |
16 } | 19 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 bool PicturePileBase::CanRaster(float contents_scale, gfx::Rect content_rect) { | 164 bool PicturePileBase::CanRaster(float contents_scale, gfx::Rect content_rect) { |
162 if (tiling_.total_size().IsEmpty()) | 165 if (tiling_.total_size().IsEmpty()) |
163 return false; | 166 return false; |
164 gfx::Rect layer_rect = gfx::ToEnclosingRect( | 167 gfx::Rect layer_rect = gfx::ToEnclosingRect( |
165 gfx::ScaleRect(content_rect, 1.f / contents_scale)); | 168 gfx::ScaleRect(content_rect, 1.f / contents_scale)); |
166 layer_rect.Intersect(gfx::Rect(tiling_.total_size())); | 169 layer_rect.Intersect(gfx::Rect(tiling_.total_size())); |
167 return recorded_region_.Contains(layer_rect); | 170 return recorded_region_.Contains(layer_rect); |
168 } | 171 } |
169 | 172 |
170 } // namespace cc | 173 } // namespace cc |
OLD | NEW |