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

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: passing content scale from layer to tiling so that screenspacetransform can be applied 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..5ae76df22cf6a9433f78df375c3c94cef17d0665 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() {
@@ -88,6 +90,19 @@ void PictureLayerImpl::didUpdateTransforms() {
tilings_.AddTiling(contentsScaleX(), tile_size);
// TODO(enne): handle invalidations, create new tiles
}
+
+ gfx::Transform current_transform = screenSpaceTransform();
+ double current_time =
+ (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
+ if (last_update_time_ != 0) {
epennerAtGoogle 2012/11/30 16:48:34 Should we move this condition into UpdateTilePrior
qinmin 2012/11/30 19:24:13 using timedelta 0 when this happens, so that we wo
+ tilings_.UpdateTilePriorities(layerTreeHostImpl()->deviceViewportSize(),
+ contentsScaleX(),
danakj 2012/11/30 18:39:00 can you DCHECK that contentsScaleX() == contentsSc
qinmin 2012/11/30 19:24:13 Done.
+ last_transform_,
+ current_transform,
+ current_time - last_update_time_);
+ }
+ last_transform_ = current_transform;
+ last_update_time_ = current_time;
}
scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling*,

Powered by Google App Engine
This is Rietveld 408576698