Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 1144523003: Rename cc::ResourceProvider::ResourceId to cc::ResourceId and move it to its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698