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/rect.h" |
10 #include "ui/gfx/vector2d.h" | 10 #include "ui/gfx/vector2d.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 delta_y_(0), | 481 delta_y_(0), |
482 current_step_(0), | 482 current_step_(0), |
483 horizontal_step_count_(0), | 483 horizontal_step_count_(0), |
484 vertical_step_count_(0) { | 484 vertical_step_count_(0) { |
485 if (tiling_data_->num_tiles_x() <= 0 || tiling_data_->num_tiles_y() <= 0) { | 485 if (tiling_data_->num_tiles_x() <= 0 || tiling_data_->num_tiles_y() <= 0) { |
486 done(); | 486 done(); |
487 return; | 487 return; |
488 } | 488 } |
489 | 489 |
490 gfx::Rect consider(consider_rect); | 490 gfx::Rect consider(consider_rect); |
491 gfx::Rect ignore(ignore_rect); | |
492 gfx::Rect center(center_rect); | |
493 consider.Intersect(tiling_data_->tiling_rect()); | 491 consider.Intersect(tiling_data_->tiling_rect()); |
494 ignore.Intersect(tiling_data_->tiling_rect()); | |
495 if (consider.IsEmpty()) { | 492 if (consider.IsEmpty()) { |
496 done(); | 493 done(); |
497 return; | 494 return; |
498 } | 495 } |
499 | 496 |
| 497 gfx::Rect center(center_rect); |
| 498 gfx::Rect ignore(ignore_rect); |
| 499 ignore.Intersect(tiling_data_->tiling_rect()); |
| 500 |
500 consider_left_ = | 501 consider_left_ = |
501 tiling_data_->FirstBorderTileXIndexFromSrcCoord(consider.x()); | 502 tiling_data_->FirstBorderTileXIndexFromSrcCoord(consider.x()); |
502 consider_top_ = tiling_data_->FirstBorderTileYIndexFromSrcCoord(consider.y()); | 503 consider_top_ = tiling_data_->FirstBorderTileYIndexFromSrcCoord(consider.y()); |
503 consider_right_ = | 504 consider_right_ = |
504 tiling_data_->LastBorderTileXIndexFromSrcCoord(consider.right() - 1); | 505 tiling_data_->LastBorderTileXIndexFromSrcCoord(consider.right() - 1); |
505 consider_bottom_ = | 506 consider_bottom_ = |
506 tiling_data_->LastBorderTileYIndexFromSrcCoord(consider.bottom() - 1); | 507 tiling_data_->LastBorderTileYIndexFromSrcCoord(consider.bottom() - 1); |
507 | 508 |
508 if (!ignore.IsEmpty()) { | 509 if (!ignore.IsEmpty()) { |
509 ignore_left_ = tiling_data_->FirstBorderTileXIndexFromSrcCoord(ignore.x()); | 510 ignore_left_ = tiling_data_->FirstBorderTileXIndexFromSrcCoord(ignore.x()); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 current_step_ = 0; | 682 current_step_ = 0; |
682 direction_ = static_cast<Direction>((direction_ + 1) % 4); | 683 direction_ = static_cast<Direction>((direction_ + 1) % 4); |
683 | 684 |
684 if (direction_ == RIGHT || direction_ == LEFT) { | 685 if (direction_ == RIGHT || direction_ == LEFT) { |
685 ++vertical_step_count_; | 686 ++vertical_step_count_; |
686 ++horizontal_step_count_; | 687 ++horizontal_step_count_; |
687 } | 688 } |
688 } | 689 } |
689 | 690 |
690 } // namespace cc | 691 } // namespace cc |
OLD | NEW |