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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 2109603005: cc: Anchor quad offsets to a visible quad. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | 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 b2373fcae8326558b47b9760dd256e075fc1ad3f..b6763a021cf4896c4cabe725f3fba4f7e46c1b93 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -280,9 +280,15 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
only_used_low_res_last_append_quads_ = true;
gfx::Rect scaled_recorded_viewport = gfx::ScaleToEnclosingRect(
raster_source_->RecordedViewport(), max_contents_scale);
+
+ bool have_origin = false;
+ gfx::Point quad_origin;
+ gfx::Rect visible_quad_layer_rect =
+ shared_quad_state->visible_quad_layer_rect;
+
for (PictureLayerTilingSet::CoverageIterator iter(
- tilings_.get(), max_contents_scale,
- shared_quad_state->visible_quad_layer_rect, ideal_contents_scale_);
+ tilings_.get(), max_contents_scale, visible_quad_layer_rect,
+ ideal_contents_scale_);
iter; ++iter) {
gfx::Rect geometry_rect = iter.geometry_rect();
gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
@@ -297,6 +303,20 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
bool has_draw_quad = false;
if (*iter && iter->draw_info().IsReadyToDraw()) {
const TileDrawInfo& draw_info = iter->draw_info();
+
+ if (!have_origin) {
+ have_origin = true;
+ quad_origin.SetPoint(geometry_rect.x(), geometry_rect.y());
+ shared_quad_state->quad_to_target_transform.Translate(quad_origin.x(),
+ quad_origin.y());
+ shared_quad_state->visible_quad_layer_rect.Offset(-quad_origin.x(),
+ -quad_origin.y());
+ }
+
+ geometry_rect.Offset(-quad_origin.x(), -quad_origin.y());
+ opaque_rect.Offset(-quad_origin.x(), -quad_origin.y());
+ visible_geometry_rect.Offset(-quad_origin.x(), -quad_origin.y());
+
switch (draw_info.mode()) {
case TileDrawInfo::RESOURCE_MODE: {
gfx::RectF texture_rect = iter.texture_rect();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698