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

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: move all the math from picture_layer_tiling to tile_prority Created 8 years, 1 month 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_impl.cc
diff --git a/cc/picture_layer_impl.cc b/cc/picture_layer_impl.cc
index 18095964f70095b5ee16343138d2fc01f5003e4e..f5f8960dad50b858a93eea7b7a3c536b2ba8fd02 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/layer_tree_host_impl.h"
#include "cc/math_util.h"
#include "cc/quad_sink.h"
@@ -13,7 +14,8 @@ namespace cc {
PictureLayerImpl::PictureLayerImpl(int id) :
LayerImpl(id),
- tilings_(this) {
+ tilings_(this),
+ last_update_time_(0) {
}
PictureLayerImpl::~PictureLayerImpl() {
@@ -81,6 +83,7 @@ void PictureLayerImpl::dumpLayerProperties(std::string*, int indent) const {
}
void PictureLayerImpl::didUpdateTransforms() {
+ DCHECK(contentsScaleX() == contentsScaleY());
tilings_.SetLayerBounds(bounds());
// TODO(enne): Add more tilings during pinch zoom.
if (!tilings_.num_tilings()) {
@@ -88,6 +91,20 @@ 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 =
+ (last_update_time_ == 0 ? 0 : current_time - last_update_time_);
+ tilings_.UpdateTilePriorities(layerTreeHostImpl()->deviceViewportSize(),
+ contentsScaleX(),
+ last_screen_space_transform_,
+ current_screen_space_transform,
+ time_delta);
+
+ last_screen_space_transform_ = current_screen_space_transform;
+ last_update_time_ = current_time;
}
scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling*,
« no previous file with comments | « cc/picture_layer_impl.h ('k') | cc/picture_layer_tiling.h » ('j') | cc/picture_layer_tiling.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698