| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/debug/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 } | 596 } |
| 597 | 597 |
| 598 const Region* PictureLayerImpl::GetInvalidation() { | 598 const Region* PictureLayerImpl::GetInvalidation() { |
| 599 return &invalidation_; | 599 return &invalidation_; |
| 600 } | 600 } |
| 601 | 601 |
| 602 const PictureLayerTiling* PictureLayerImpl::GetTwinTiling( | 602 const PictureLayerTiling* PictureLayerImpl::GetTwinTiling( |
| 603 const PictureLayerTiling* tiling) const { | 603 const PictureLayerTiling* tiling) const { |
| 604 if (!twin_layer_) | 604 if (!twin_layer_) |
| 605 return NULL; | 605 return NULL; |
| 606 for (size_t i = 0; i < twin_layer_->tilings_->num_tilings(); ++i) | 606 return twin_layer_->tilings_->TilingAtScale(tiling->contents_scale()); |
| 607 if (twin_layer_->tilings_->tiling_at(i)->contents_scale() == | |
| 608 tiling->contents_scale()) | |
| 609 return twin_layer_->tilings_->tiling_at(i); | |
| 610 return NULL; | |
| 611 } | 607 } |
| 612 | 608 |
| 613 size_t PictureLayerImpl::GetMaxTilesForInterestArea() const { | 609 size_t PictureLayerImpl::GetMaxTilesForInterestArea() const { |
| 614 return layer_tree_impl()->settings().max_tiles_for_interest_area; | 610 return layer_tree_impl()->settings().max_tiles_for_interest_area; |
| 615 } | 611 } |
| 616 | 612 |
| 617 float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const { | 613 float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const { |
| 618 float skewport_target_time_in_frames = | 614 float skewport_target_time_in_frames = |
| 619 layer_tree_impl()->use_gpu_rasterization() | 615 layer_tree_impl()->use_gpu_rasterization() |
| 620 ? kGpuSkewportTargetTimeInFrames | 616 ? kGpuSkewportTargetTimeInFrames |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1744 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
| 1749 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1745 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
| 1750 return tiling_range.end - 1 - current_tiling_range_offset; | 1746 return tiling_range.end - 1 - current_tiling_range_offset; |
| 1751 } | 1747 } |
| 1752 } | 1748 } |
| 1753 NOTREACHED(); | 1749 NOTREACHED(); |
| 1754 return 0; | 1750 return 0; |
| 1755 } | 1751 } |
| 1756 | 1752 |
| 1757 } // namespace cc | 1753 } // namespace cc |
| OLD | NEW |