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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 607023003: cc: Unify the occlusion access by adding an ability to scale transform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +build.gn change Created 6 years, 2 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/cc_tests.gyp ('k') | cc/trees/occlusion.h » ('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 8a78bb1a8e2c9cce50a8837696e64e43a9f748aa..09c541e85332ef66ea05f75b007b78cd40d1f583 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -165,30 +165,30 @@ void PictureLayerImpl::AppendQuads(
AppendDebugBorderQuad(
render_pass, content_bounds(), shared_quad_state, append_quads_data);
- SolidColorLayerImpl::AppendSolidQuads(
- render_pass,
- occlusion_tracker,
- shared_quad_state,
- content_bounds(),
- draw_properties().target_space_transform,
- pile_->solid_color(),
- append_quads_data);
+ SolidColorLayerImpl::AppendSolidQuads(render_pass,
+ occlusion_tracker,
+ shared_quad_state,
+ content_bounds(),
+ draw_transform(),
+ pile_->solid_color(),
+ append_quads_data);
return;
}
+ Occlusion occlusion =
+ occlusion_tracker.GetCurrentOcclusionForLayer(draw_transform());
+
float max_contents_scale = MaximumTilingContentsScale();
gfx::Transform scaled_draw_transform = draw_transform();
scaled_draw_transform.Scale(SK_MScalar1 / max_contents_scale,
SK_MScalar1 / max_contents_scale);
gfx::Size scaled_content_bounds =
gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), max_contents_scale));
-
gfx::Rect scaled_visible_content_rect =
gfx::ScaleToEnclosingRect(visible_content_rect(), max_contents_scale);
scaled_visible_content_rect.Intersect(gfx::Rect(scaled_content_bounds));
-
- Occlusion occlusion =
- occlusion_tracker.GetCurrentOcclusionForLayer(scaled_draw_transform);
+ Occlusion scaled_occlusion =
+ occlusion.GetOcclusionWithGivenDrawTransform(scaled_draw_transform);
shared_quad_state->SetAll(scaled_draw_transform,
scaled_content_bounds,
@@ -211,7 +211,7 @@ void PictureLayerImpl::AppendQuads(
gfx::Rect geometry_rect = scaled_visible_content_rect;
gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
gfx::Rect visible_geometry_rect =
- occlusion.GetUnoccludedContentRect(geometry_rect);
+ scaled_occlusion.GetUnoccludedContentRect(geometry_rect);
if (visible_geometry_rect.IsEmpty())
return;
@@ -306,7 +306,7 @@ void PictureLayerImpl::AppendQuads(
gfx::Rect geometry_rect = iter.geometry_rect();
gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
gfx::Rect visible_geometry_rect =
- occlusion.GetUnoccludedContentRect(geometry_rect);
+ scaled_occlusion.GetUnoccludedContentRect(geometry_rect);
if (visible_geometry_rect.IsEmpty())
continue;
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/trees/occlusion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698