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

Unified Diff: cc/picture_layer_tiling.cc

Issue 11704002: cc: Generate tilings at other scales for impl-side painting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Create tilings during pinch Created 7 years, 11 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
Index: cc/picture_layer_tiling.cc
diff --git a/cc/picture_layer_tiling.cc b/cc/picture_layer_tiling.cc
index 7ea16fd47e6211154fba2603ed6c279ae373b367..e9ba84d5968a124b8f1b0d366c8cda639d16426b 100644
--- a/cc/picture_layer_tiling.cc
+++ b/cc/picture_layer_tiling.cc
@@ -24,7 +24,8 @@ PictureLayerTiling::PictureLayerTiling(float contents_scale,
gfx::Size tile_size)
: client_(NULL),
contents_scale_(contents_scale),
- tiling_data_(tile_size, gfx::Size(), true) {
+ tiling_data_(tile_size, gfx::Size(), true),
+ resolution_(NON_IDEAL_RESOLUTION) {
}
PictureLayerTiling::~PictureLayerTiling() {
@@ -60,12 +61,6 @@ void PictureLayerTiling::CreateTile(int i, int j) {
TileMapKey key(i, j);
DCHECK(!tiles_[key]);
tiles_[key] = client_->CreateTile(this, tile_rect);
-
- // TODO(enne): Remove this when we start setting priorities correctly.
- TilePriority priority;
- priority.resolution = HIGH_RESOLUTION;
- priority.time_to_visible_in_seconds = 1000;
- tiles_[key]->set_priority(ACTIVE_TREE, priority);
}
Region PictureLayerTiling::OpaqueRegionInContentRect(
@@ -271,8 +266,8 @@ gfx::Size PictureLayerTiling::Iterator::texture_size() const {
void PictureLayerTiling::UpdateTilePriorities(
WhichTree tree,
const gfx::Size& device_viewport,
- float layer_content_scale_x,
- float layer_content_scale_y,
+ float last_contents_scale,
+ float current_contents_scale,
danakj 2013/01/07 22:35:56 not sure i'm a fan of the name "current". how does
enne (OOO) 2013/01/08 01:08:00 The tiling's contents scale is the scale for the t
const gfx::Transform& last_screen_transform,
const gfx::Transform& current_screen_transform,
double time_delta) {
@@ -287,6 +282,7 @@ void PictureLayerTiling::UpdateTilePriorities(
for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
TileMapKey key = it->first;
TilePriority priority;
+ priority.resolution = resolution_;
if (key.first > right || key.second > bottom) {
priority.distance_to_visible_in_pixels = std::numeric_limits<int>::max();
priority.time_to_visible_in_seconds =
@@ -296,16 +292,19 @@ void PictureLayerTiling::UpdateTilePriorities(
}
gfx::Rect tile_bound = tiling_data_.TileBounds(key.first, key.second);
- gfx::RectF layer_content_rect = gfx::ScaleRect(
+ gfx::RectF current_layer_content_rect = gfx::ScaleRect(
tile_bound,
- layer_content_scale_x / contents_scale_,
- layer_content_scale_y / contents_scale_);
+ current_contents_scale / contents_scale_,
+ current_contents_scale / contents_scale_);
gfx::RectF screen_rect = MathUtil::mapClippedRect(
- current_screen_transform, layer_content_rect);
+ current_screen_transform, current_layer_content_rect);
danakj 2013/01/07 22:35:56 maybe current_screen_rect and last_screen_rect the
enne (OOO) 2013/01/08 01:08:00 Done.
+ gfx::RectF last_layer_content_rect = gfx::ScaleRect(
+ tile_bound,
+ last_contents_scale / contents_scale_,
+ last_contents_scale / contents_scale_);
gfx::RectF previous_rect = MathUtil::mapClippedRect(
- last_screen_transform, layer_content_rect);
+ last_screen_transform, last_layer_content_rect);
- priority.resolution = HIGH_RESOLUTION;
priority.time_to_visible_in_seconds =
TilePriority::TimeForBoundsToIntersect(
previous_rect, screen_rect, time_delta, view_rect);

Powered by Google App Engine
This is Rietveld 408576698