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..5e745648bc5e058137bf0a5f89524941f8df300c 100644 |
--- a/cc/layers/surface_layer_impl.cc |
+++ b/cc/layers/surface_layer_impl.cc |
@@ -68,7 +68,26 @@ void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass, |
SharedQuadState* shared_quad_state = |
render_pass->CreateAndAppendSharedQuadState(); |
- PopulateScaledSharedQuadState(shared_quad_state, surface_scale_); |
+ gfx::Transform scaled_draw_transform = |
+ draw_properties().target_space_transform; |
+ |
+ float boundsWidth = bounds().width(); |
danakj
2016/11/21 23:37:22
chromium style, though I'd drop these 4 temp vars
xlai (Olivia)
2016/11/22 16:55:59
Done. I was trying to force them (integer) to floa
danakj
2016/11/22 19:19:13
Ah, you can use a static cast for that, or use tem
|
+ float boundsHeight = bounds().height(); |
+ float surfaceSizeWidth = surface_size_.width(); |
+ float surfaceSizeHeight = surface_size_.height(); |
+ float scale_x = surfaceSizeWidth / boundsWidth; |
danakj
2016/11/21 23:37:22
why not invert these, and then you don't have to r
xlai (Olivia)
2016/11/22 16:55:59
Done.
|
+ float scale_y = surfaceSizeHeight / boundsHeight; |
+ scaled_draw_transform.Scale(SK_MScalar1 / scale_x, SK_MScalar1 / scale_y); |
+ |
+ gfx::Size scaled_bounds = gfx::ScaleToCeiledSize(bounds(), surface_scale_); |
danakj
2016/11/21 23:37:22
I'm very confused what the function of this surfac
xlai (Olivia)
2016/11/22 16:55:59
Actually, this part of code is exactly same as the
danakj
2016/11/22 19:19:13
My feeling is that it doesn't make sense to change
|
+ 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( |
danakj
2016/11/21 23:37:22
If you can't just add params toPopulateScaledShare
xlai (Olivia)
2016/11/22 16:55:59
Done.
|
+ 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; |