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

Unified Diff: cc/layers/render_surface_impl.cc

Issue 2828353003: Determine mask UVs based on texture size (Closed)
Patch Set: nit Created 3 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
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/render_surface_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/render_surface_impl.cc
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index 8669a2061ea03fc9723dff70c8d2957e7b1e8b5c..c61a56ff3bcb5113272c752f43e6021f2d4f0d1c 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -414,15 +414,18 @@ void RenderSurfaceImpl::AppendQuads(RenderPass* render_pass,
TileMaskLayer(render_pass, shared_quad_state, visible_layer_rect);
return;
}
- mask_layer->GetContentsResourceId(&mask_resource_id, &mask_texture_size);
+ gfx::SizeF mask_uv_size;
+ mask_layer->GetContentsResourceId(&mask_resource_id, &mask_texture_size,
+ &mask_uv_size);
gfx::SizeF unclipped_mask_target_size = gfx::ScaleSize(
gfx::SizeF(OwningEffectNode()->unscaled_mask_target_size),
surface_contents_scale.x(), surface_contents_scale.y());
- // Convert content_rect from target space to normalized space.
- // Where unclipped_mask_target_size maps to gfx::Size(1, 1).
- mask_uv_rect = gfx::ScaleRect(gfx::RectF(content_rect()),
- 1.0f / unclipped_mask_target_size.width(),
- 1.0f / unclipped_mask_target_size.height());
+ // Convert content_rect from target space to normalized mask UV space.
+ // Where |unclipped_mask_target_size| maps to |mask_uv_size|.
+ mask_uv_rect = gfx::ScaleRect(
+ gfx::RectF(content_rect()),
+ mask_uv_size.width() / unclipped_mask_target_size.width(),
+ mask_uv_size.height() / unclipped_mask_target_size.height());
}
gfx::RectF tex_coord_rect(gfx::Rect(content_rect().size()));
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/render_surface_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698