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