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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 389973004: cc: Give TilingData back a Size instead of a Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tilingsize: comments Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_layer_tiling.h ('k') | cc/resources/picture_layer_tiling_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling.cc
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index 9a9c758388a3c77a7caeca0450887f19dfdd54b4..8f669902bc893465a9f2462ef0128c0ffac72b2c 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -63,7 +63,7 @@ PictureLayerTiling::PictureLayerTiling(float contents_scale,
layer_bounds_(layer_bounds),
resolution_(NON_IDEAL_RESOLUTION),
client_(client),
- tiling_data_(gfx::Size(), gfx::Rect(), true),
+ tiling_data_(gfx::Size(), gfx::Size(), true),
last_impl_frame_time_in_seconds_(0.0),
eviction_tiles_cache_valid_(false),
eviction_cache_tree_priority_(SAME_PRIORITY_FOR_BOTH_TREES) {
@@ -77,7 +77,7 @@ PictureLayerTiling::PictureLayerTiling(float contents_scale,
" Layer bounds: " << layer_bounds.ToString() <<
" Contents scale: " << contents_scale;
- tiling_data_.SetTilingRect(gfx::Rect(content_bounds));
+ tiling_data_.SetTilingSize(content_bounds);
tiling_data_.SetMaxTextureSize(tile_size);
}
@@ -88,10 +88,6 @@ void PictureLayerTiling::SetClient(PictureLayerTilingClient* client) {
client_ = client;
}
-gfx::Rect PictureLayerTiling::TilingRect() const {
- return tiling_data_.tiling_rect();
-}
-
Tile* PictureLayerTiling::CreateTile(int i,
int j,
const PictureLayerTiling* twin_tiling) {
@@ -154,7 +150,7 @@ void PictureLayerTiling::UpdateTilesToCurrentPile(
// Drop tiles outside the new layer bounds if the layer shrank.
SetLiveTilesRect(
gfx::IntersectRects(live_tiles_rect_, gfx::Rect(content_bounds)));
- tiling_data_.SetTilingRect(gfx::Rect(content_bounds));
+ tiling_data_.SetTilingSize(content_bounds);
tile_size = client_->CalculateTileSize(content_bounds);
}
@@ -247,7 +243,7 @@ PictureLayerTiling::CoverageIterator::CoverageIterator(
dest_to_content_scale_);
// IndexFromSrcCoord clamps to valid tile ranges, so it's necessary to
// check for non-intersection first.
- content_rect.Intersect(tiling_->TilingRect());
+ content_rect.Intersect(gfx::Rect(tiling_->tiling_size()));
if (content_rect.IsEmpty())
return;
@@ -348,7 +344,7 @@ gfx::RectF PictureLayerTiling::CoverageIterator::texture_rect() const {
gfx::RectF texture_rect(current_geometry_rect_);
texture_rect.Scale(dest_to_content_scale_,
dest_to_content_scale_);
- texture_rect.Intersect(tiling_->TilingRect());
+ texture_rect.Intersect(gfx::Rect(tiling_->tiling_size()));
if (texture_rect.IsEmpty())
return texture_rect;
texture_rect.Offset(-tex_origin.OffsetFromOrigin());
@@ -430,7 +426,7 @@ void PictureLayerTiling::UpdateTilePriorities(
gfx::Rect visible_rect_in_content_space =
gfx::ScaleToEnclosingRect(visible_layer_rect, contents_scale_);
- if (TilingRect().IsEmpty()) {
+ if (tiling_size().IsEmpty()) {
last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds;
last_visible_rect_in_content_space_ = visible_rect_in_content_space;
return;
@@ -449,10 +445,13 @@ void PictureLayerTiling::UpdateTilePriorities(
gfx::Rect eventually_rect =
ExpandRectEquallyToAreaBoundedBy(visible_rect_in_content_space,
eventually_rect_area,
- TilingRect(),
+ gfx::Rect(tiling_size()),
&expansion_cache_);
- DCHECK(eventually_rect.IsEmpty() || TilingRect().Contains(eventually_rect));
+ DCHECK(eventually_rect.IsEmpty() ||
+ gfx::Rect(tiling_size()).Contains(eventually_rect))
+ << "tiling_size: " << tiling_size().ToString()
+ << " eventually_rect: " << eventually_rect.ToString();
SetLiveTilesRect(eventually_rect);
@@ -560,7 +559,9 @@ void PictureLayerTiling::UpdateTilePriorities(
void PictureLayerTiling::SetLiveTilesRect(
const gfx::Rect& new_live_tiles_rect) {
DCHECK(new_live_tiles_rect.IsEmpty() ||
- TilingRect().Contains(new_live_tiles_rect));
+ gfx::Rect(tiling_size()).Contains(new_live_tiles_rect))
+ << "tiling_size: " << tiling_size().ToString()
+ << " new_live_tiles_rect: " << new_live_tiles_rect.ToString();
if (live_tiles_rect_ == new_live_tiles_rect)
return;
@@ -623,7 +624,7 @@ scoped_ptr<base::Value> PictureLayerTiling::AsValue() const {
scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
state->SetInteger("num_tiles", tiles_.size());
state->SetDouble("content_scale", contents_scale_);
- state->Set("tiling_rect", MathUtil::AsValue(TilingRect()).release());
+ state->Set("tiling_size", MathUtil::AsValue(tiling_size()).release());
return state.PassAs<base::Value>();
}
« no previous file with comments | « cc/resources/picture_layer_tiling.h ('k') | cc/resources/picture_layer_tiling_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698