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

Unified Diff: cc/picture_layer_impl.cc

Issue 11414238: implement the logic to set tile priorities based on current matrix (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 8 years 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/picture_layer_impl.h ('k') | cc/picture_layer_tiling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_layer_impl.cc
diff --git a/cc/picture_layer_impl.cc b/cc/picture_layer_impl.cc
index 8c53563cb3355211d1e552dd1e197d110a95cd75..093e7d4ca6c12b5f4d839ddeeee8086e63f8fa2c 100644
--- a/cc/picture_layer_impl.cc
+++ b/cc/picture_layer_impl.cc
@@ -4,6 +4,7 @@
#include "cc/picture_layer_impl.h"
+#include "base/time.h"
#include "cc/append_quads_data.h"
#include "cc/checkerboard_draw_quad.h"
#include "cc/debug_border_draw_quad.h"
@@ -19,7 +20,8 @@ namespace cc {
PictureLayerImpl::PictureLayerImpl(int id) :
LayerImpl(id),
tilings_(this),
- pile_(PicturePileImpl::Create()) {
+ pile_(PicturePileImpl::Create()),
+ last_update_time_(0) {
}
PictureLayerImpl::~PictureLayerImpl() {
@@ -132,6 +134,30 @@ void PictureLayerImpl::didUpdateTransforms() {
tilings_.AddTiling(contentsScaleX(), tile_size);
// TODO(enne): handle invalidations, create new tiles
}
+
+ gfx::Transform current_screen_space_transform = screenSpaceTransform();
+ double current_time =
+ (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
+ double time_delta = 0;
+ if (last_update_time_ != 0 && last_bounds_ == bounds() &&
+ last_content_bounds_ == contentBounds() &&
+ last_content_scale_x_ == contentsScaleX() &&
+ last_content_scale_y_ == contentsScaleY()) {
+ time_delta = current_time - last_update_time_;
+ }
+ tilings_.UpdateTilePriorities(layerTreeHostImpl()->deviceViewportSize(),
+ contentsScaleX(),
+ contentsScaleY(),
+ last_screen_space_transform_,
+ current_screen_space_transform,
+ time_delta);
+
+ last_screen_space_transform_ = current_screen_space_transform;
+ last_update_time_ = current_time;
+ last_bounds_ = bounds();
+ last_content_bounds_ = contentBounds();
+ last_content_scale_x_ = contentsScaleX();
+ last_content_scale_y_ = contentsScaleY();
}
scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling*,
« no previous file with comments | « cc/picture_layer_impl.h ('k') | cc/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698