| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/base/tiling_data.h" | 5 #include "cc/base/tiling_data.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
| 10 #include "ui/gfx/vector2d.h" | 10 #include "ui/gfx/geometry/vector2d.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 static int ComputeNumTiles(int max_texture_size, | 14 static int ComputeNumTiles(int max_texture_size, |
| 15 int total_size, | 15 int total_size, |
| 16 int border_texels) { | 16 int border_texels) { |
| 17 if (max_texture_size - 2 * border_texels <= 0) | 17 if (max_texture_size - 2 * border_texels <= 0) |
| 18 return total_size > 0 && max_texture_size >= total_size ? 1 : 0; | 18 return total_size > 0 && max_texture_size >= total_size ? 1 : 0; |
| 19 | 19 |
| 20 int num_tiles = std::max(1, | 20 int num_tiles = std::max(1, |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 | 921 |
| 922 // We should always end up in an around rect at some point. | 922 // We should always end up in an around rect at some point. |
| 923 // Since the direction is now vertical, we have to ensure that we will | 923 // Since the direction is now vertical, we have to ensure that we will |
| 924 // advance. | 924 // advance. |
| 925 DCHECK_GE(horizontal_step_count_, 1); | 925 DCHECK_GE(horizontal_step_count_, 1); |
| 926 DCHECK_GE(vertical_step_count_, 1); | 926 DCHECK_GE(vertical_step_count_, 1); |
| 927 } | 927 } |
| 928 } | 928 } |
| 929 | 929 |
| 930 } // namespace cc | 930 } // namespace cc |
| OLD | NEW |