| 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/geometry/vector2d.h" |
| 9 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 10 #include "ui/gfx/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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 current_step_ = 0; | 672 current_step_ = 0; |
| 673 direction_ = static_cast<Direction>((direction_ + 1) % 4); | 673 direction_ = static_cast<Direction>((direction_ + 1) % 4); |
| 674 | 674 |
| 675 if (direction_ == RIGHT || direction_ == LEFT) { | 675 if (direction_ == RIGHT || direction_ == LEFT) { |
| 676 ++vertical_step_count_; | 676 ++vertical_step_count_; |
| 677 ++horizontal_step_count_; | 677 ++horizontal_step_count_; |
| 678 } | 678 } |
| 679 } | 679 } |
| 680 | 680 |
| 681 } // namespace cc | 681 } // namespace cc |
| OLD | NEW |