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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 394113002: Tiling priorities in Android Webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address 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/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 02fb92fb735dce8d5048487eebe38ab6800c7706..de3ab388a7e642c038dae8abeffe3a377acaaee6 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -399,7 +399,7 @@ void PictureLayerImpl::UpdateTiles(
// resourceless software draw, so don't update them.
if (!layer_tree_impl()->resourceless_software_draw()) {
visible_rect_for_tile_priority_ = visible_content_rect();
- viewport_size_for_tile_priority_ = layer_tree_impl()->DrawViewportSize();
+ viewport_rect_for_tile_priority_ = layer_tree_impl()->ExternalTilingRect();
screen_space_transform_for_tile_priority_ = screen_space_transform();
}
@@ -457,16 +457,27 @@ void PictureLayerImpl::UpdateTilePriorities(
if (!tiling_needs_update)
return;
- // Use visible_content_rect, unless it's empty. If it's empty, then
- // try to inverse project the viewport into layer space and use that.
+ // If visible_rect_for_tile_priority_ is empty or
+ // LayerTreeImpl::ExternalTilingRect is set to be different from the device
+ // viewport, try to inverse project the viewport into layer space and use
+ // that. Otherwise just use visible_rect_for_tile_priority_
gfx::Rect visible_rect_in_content_space = visible_rect_for_tile_priority_;
- if (visible_rect_in_content_space.IsEmpty()) {
+ gfx::Rect external_tiling_rect = layer_tree_impl()->ExternalTilingRect();
+ gfx::Transform external_tiling_transform =
+ layer_tree_impl()->ExternalTilingTransform();
+ gfx::Transform identity;
+ gfx::Transform layer_to_screen = screen_space_transform_for_tile_priority_;
+ layer_to_screen.ConcatTransform(external_tiling_transform);
aelias_OOO_until_Jul13 2014/07/16 21:23:31 Please bake it into screen_space_transform_for_til
hush (inactive) 2014/07/17 00:05:53 Done.
+ if (visible_rect_in_content_space.IsEmpty() ||
+ layer_tree_impl()->DrawViewportSize() != external_tiling_rect.size() ||
aelias_OOO_until_Jul13 2014/07/16 21:23:31 Please cast the DrawViewportSize to a rect instead
hush (inactive) 2014/07/17 00:05:53 Yes, indeed it is missing that case. I will use De
+ !external_tiling_transform.IsIdentity()) {
gfx::Transform screen_to_layer(gfx::Transform::kSkipInitialization);
- if (screen_space_transform_for_tile_priority_.GetInverse(
- &screen_to_layer)) {
- visible_rect_in_content_space =
- gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
- screen_to_layer, gfx::Rect(viewport_size_for_tile_priority_)));
+
+ if (layer_to_screen.GetInverse(&screen_to_layer)) {
+ // Transform from view space to content space.
+ visible_rect_in_content_space = gfx::ToEnclosingRect(
+ MathUtil::ProjectClippedRect(screen_to_layer, external_tiling_rect));
+
visible_rect_in_content_space.Intersect(gfx::Rect(content_bounds()));
}
}
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698