Chromium Code Reviews| Index: cc/layers/surface_layer_impl.cc |
| diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc |
| index 2289a29326f449746f68eb7ddff19fd3a0ba58bf..273734ea4335540121142696821a88f33fc7b33b 100644 |
| --- a/cc/layers/surface_layer_impl.cc |
| +++ b/cc/layers/surface_layer_impl.cc |
| @@ -68,7 +68,27 @@ void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass, |
| SharedQuadState* shared_quad_state = |
| render_pass->CreateAndAppendSharedQuadState(); |
| - PopulateScaledSharedQuadState(shared_quad_state, surface_scale_); |
| + gfx::Transform scaled_draw_transform = |
|
danakj
2016/11/14 20:44:06
New code requires new unit tests of the class.
xlai (Olivia)
2016/11/15 16:36:20
Done.
|
| + draw_properties().target_space_transform; |
| + |
| + float boundsWidth = bounds().width(); |
| + float boundsHeight = bounds().height(); |
| + float surfaceSizeWidth = surface_size_.width(); |
| + float surfaceSizeHeight = surface_size_.height(); |
| + float scale_x = surfaceSizeWidth / boundsWidth * surface_scale_; |
| + float scale_y = surfaceSizeHeight / boundsHeight * surface_scale_; |
| + |
| + scaled_draw_transform.Scale(SK_MScalar1 / scale_x, SK_MScalar1 / scale_y); |
|
Justin Novosad
2016/11/14 20:41:27
How does this affect other uses of surface_layer?
xlai (Olivia)
2016/11/15 16:36:20
I don't think it will not affect other uses of sur
|
| + |
| + gfx::Size scaled_bounds = gfx::ScaleToCeiledSize(bounds(), surface_scale_); |
| + gfx::Rect scaled_visible_layer_rect = |
| + gfx::ScaleToEnclosingRect(visible_layer_rect(), surface_scale_); |
| + scaled_visible_layer_rect.Intersect(gfx::Rect(scaled_bounds)); |
| + |
| + shared_quad_state->SetAll( |
| + scaled_draw_transform, scaled_bounds, scaled_visible_layer_rect, |
| + draw_properties().clip_rect, draw_properties().is_clipped, |
| + draw_properties().opacity, draw_blend_mode(), sorting_context_id_); |
| if (!surface_id_.is_valid()) |
| return; |