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

Side by Side Diff: cc/trees/layer_tree_host_common.cc

Issue 23572033: cc: Add test for AA quads due to precision loss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: danakj review comments Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 globals.device_scale_factor, 1402 globals.device_scale_factor,
1403 data_from_ancestor.in_subtree_of_page_scale_application_layer ? 1403 data_from_ancestor.in_subtree_of_page_scale_application_layer ?
1404 globals.page_scale_factor : 1.f, 1404 globals.page_scale_factor : 1.f,
1405 animating_transform_to_screen); 1405 animating_transform_to_screen);
1406 1406
1407 // The draw_transform that gets computed below is effectively the layer's 1407 // The draw_transform that gets computed below is effectively the layer's
1408 // draw_transform, unless the layer itself creates a render_surface. In that 1408 // draw_transform, unless the layer itself creates a render_surface. In that
1409 // case, the render_surface re-parents the transforms. 1409 // case, the render_surface re-parents the transforms.
1410 layer_draw_properties.target_space_transform = combined_transform; 1410 layer_draw_properties.target_space_transform = combined_transform;
1411 // M[draw] = M[parent] * LT * S[layer2content] 1411 // M[draw] = M[parent] * LT * S[layer2content]
1412 layer_draw_properties.target_space_transform.Scale 1412 layer_draw_properties.target_space_transform.Scale(
1413 (1.f / layer->contents_scale_x(), 1.f / layer->contents_scale_y()); 1413 SK_MScalar1 / layer->contents_scale_x(),
1414 SK_MScalar1 / layer->contents_scale_y());
1414 1415
1415 // The layer's screen_space_transform represents the transform between root 1416 // The layer's screen_space_transform represents the transform between root
1416 // layer's "screen space" and local content space. 1417 // layer's "screen space" and local content space.
1417 layer_draw_properties.screen_space_transform = 1418 layer_draw_properties.screen_space_transform =
1418 data_from_ancestor.full_hierarchy_matrix; 1419 data_from_ancestor.full_hierarchy_matrix;
1419 if (!layer->preserves_3d()) 1420 if (!layer->preserves_3d())
1420 layer_draw_properties.screen_space_transform.FlattenTo2d(); 1421 layer_draw_properties.screen_space_transform.FlattenTo2d();
1421 layer_draw_properties.screen_space_transform.PreconcatTransform 1422 layer_draw_properties.screen_space_transform.PreconcatTransform
1422 (layer_draw_properties.target_space_transform); 1423 (layer_draw_properties.target_space_transform);
1423 1424
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
2215 // At this point, we think the point does hit the touch event handler region 2216 // At this point, we think the point does hit the touch event handler region
2216 // on the layer, but we need to walk up the parents to ensure that the layer 2217 // on the layer, but we need to walk up the parents to ensure that the layer
2217 // was not clipped in such a way that the hit point actually should not hit 2218 // was not clipped in such a way that the hit point actually should not hit
2218 // the layer. 2219 // the layer.
2219 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) 2220 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl))
2220 return false; 2221 return false;
2221 2222
2222 return true; 2223 return true;
2223 } 2224 }
2224 } // namespace cc 2225 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698