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 <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <set> | 10 #include <set> |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 tile_height = RoundUp(tile_height, kTileRoundUp); | 739 tile_height = RoundUp(tile_height, kTileRoundUp); |
740 tile_height = std::min(tile_height, default_tile_height); | 740 tile_height = std::min(tile_height, default_tile_height); |
741 } | 741 } |
742 | 742 |
743 // Under no circumstance should we be larger than the max texture size. | 743 // Under no circumstance should we be larger than the max texture size. |
744 tile_width = std::min(tile_width, max_texture_size); | 744 tile_width = std::min(tile_width, max_texture_size); |
745 tile_height = std::min(tile_height, max_texture_size); | 745 tile_height = std::min(tile_height, max_texture_size); |
746 return gfx::Size(tile_width, tile_height); | 746 return gfx::Size(tile_width, tile_height); |
747 } | 747 } |
748 | 748 |
749 void PictureLayerImpl::GetContentsResourceId( | 749 void PictureLayerImpl::GetContentsResourceId(ResourceId* resource_id, |
750 ResourceProvider::ResourceId* resource_id, | 750 gfx::Size* resource_size) const { |
751 gfx::Size* resource_size) const { | |
752 // The bounds and the pile size may differ if the pile wasn't updated (ie. | 751 // The bounds and the pile size may differ if the pile wasn't updated (ie. |
753 // PictureLayer::Update didn't happen). In that case the pile will be empty. | 752 // PictureLayer::Update didn't happen). In that case the pile will be empty. |
754 DCHECK_IMPLIES(!raster_source_->GetSize().IsEmpty(), | 753 DCHECK_IMPLIES(!raster_source_->GetSize().IsEmpty(), |
755 bounds() == raster_source_->GetSize()) | 754 bounds() == raster_source_->GetSize()) |
756 << " bounds " << bounds().ToString() << " pile " | 755 << " bounds " << bounds().ToString() << " pile " |
757 << raster_source_->GetSize().ToString(); | 756 << raster_source_->GetSize().ToString(); |
758 gfx::Rect content_rect(bounds()); | 757 gfx::Rect content_rect(bounds()); |
759 PictureLayerTilingSet::CoverageIterator iter( | 758 PictureLayerTilingSet::CoverageIterator iter( |
760 tilings_.get(), 1.f, content_rect, ideal_contents_scale_); | 759 tilings_.get(), 1.f, content_rect, ideal_contents_scale_); |
761 | 760 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 | 1242 |
1244 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1243 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1245 return !layer_tree_impl()->IsRecycleTree(); | 1244 return !layer_tree_impl()->IsRecycleTree(); |
1246 } | 1245 } |
1247 | 1246 |
1248 bool PictureLayerImpl::HasValidTilePriorities() const { | 1247 bool PictureLayerImpl::HasValidTilePriorities() const { |
1249 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1248 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1250 } | 1249 } |
1251 | 1250 |
1252 } // namespace cc | 1251 } // namespace cc |
OLD | NEW |