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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 271533011: cc: Move tiling management out of draw properties calculation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 6b2a0759e0d6480ab8acfc78f4069595e0b4da9a..c3acd6e3688f31b65367ad82b2dc0d3b23d622dc 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -145,6 +145,9 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
SharedQuadState* shared_quad_state = quad_sink->CreateSharedQuadState();
PopulateSharedQuadState(shared_quad_state);
+ gfx::Transform scaled_transform = draw_transform();
+ scaled_transform.Scale(contents_scale_x(), contents_scale_x());
enne (OOO) 2014/05/13 18:04:09 This contents_scale is the wrong value. You need
danakj 2014/05/13 18:10:07 the contents_scale_x() is going to be 1 always now
+
if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) {
AppendDebugBorderQuad(
quad_sink,
@@ -156,7 +159,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
gfx::Rect geometry_rect = rect;
gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
gfx::Rect visible_geometry_rect =
- quad_sink->UnoccludedContentRect(geometry_rect, draw_transform());
+ quad_sink->UnoccludedContentRect(geometry_rect, scaled_transform);
if (visible_geometry_rect.IsEmpty())
return;
@@ -241,7 +244,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink,
++iter) {
gfx::Rect geometry_rect = iter.geometry_rect();
gfx::Rect visible_geometry_rect =
- quad_sink->UnoccludedContentRect(geometry_rect, draw_transform());
+ quad_sink->UnoccludedContentRect(geometry_rect, scaled_transform);
if (visible_geometry_rect.IsEmpty())
continue;
@@ -503,9 +506,6 @@ void PictureLayerImpl::CalculateContentsScale(
ideal_device_scale_ = ideal_device_scale;
ideal_source_scale_ = std::max(ideal_source_scale, min_source_scale);
- ManageTilings(animating_transform_to_screen,
- maximum_animation_contents_scale);
-
// The content scale and bounds for a PictureLayerImpl is somewhat fictitious.
// There are (usually) several tilings at different scales. However, the
// content bounds is the (integer!) space in which quads are generated.
@@ -517,7 +517,6 @@ void PictureLayerImpl::CalculateContentsScale(
const PictureLayerTiling* tiling = tilings_->tiling_at(i);
max_contents_scale = std::max(max_contents_scale, tiling->contents_scale());
}
-
*contents_scale_x = max_contents_scale;
danakj 2014/05/13 18:10:07 we would always set these to 1 now, and move this
*contents_scale_y = max_contents_scale;
*content_bounds = gfx::ToCeiledSize(
@@ -700,7 +699,8 @@ void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
void PictureLayerImpl::SyncTiling(
const PictureLayerTiling* tiling) {
- if (!CanHaveTilingWithScale(tiling->contents_scale()))
+ if (!CanHaveTilingWithScale(tiling->contents_scale()) ||
+ !IsDrawnRenderSurfaceLayerListMember())
return;
tilings_->AddTiling(tiling->contents_scale());
@@ -982,7 +982,7 @@ void PictureLayerImpl::ManageTilings(bool animating_transform_to_screen,
was_animating_transform_to_screen_ = animating_transform_to_screen;
- if (!change_target_tiling)
+ if (!change_target_tiling || !IsDrawnRenderSurfaceLayerListMember())
danakj 2014/05/13 18:10:07 Let's do this change separately
return;
PictureLayerTiling* high_res = NULL;

Powered by Google App Engine
This is Rietveld 408576698