Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/delegated_renderer_layer_impl.h" | 5 #include "cc/layers/delegated_renderer_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/base/scoped_ptr_vector.h" | 7 #include "cc/base/scoped_ptr_vector.h" |
| 8 #include "cc/layers/quad_sink.h" | 8 #include "cc/layers/quad_sink.h" |
| 9 #include "cc/layers/solid_color_layer_impl.h" | 9 #include "cc/layers/solid_color_layer_impl.h" |
| 10 #include "cc/quads/render_pass_draw_quad.h" | 10 #include "cc/quads/render_pass_draw_quad.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 LayerTreeHostImpl::FrameData frame; | 238 LayerTreeHostImpl::FrameData frame; |
| 239 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 239 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
| 240 | 240 |
| 241 // Each non-DelegatedRendererLayer added one RenderPass. The | 241 // Each non-DelegatedRendererLayer added one RenderPass. The |
| 242 // DelegatedRendererLayer added two contributing passes. | 242 // DelegatedRendererLayer added two contributing passes. |
| 243 ASSERT_EQ(5u, frame.render_passes.size()); | 243 ASSERT_EQ(5u, frame.render_passes.size()); |
| 244 | 244 |
| 245 // The DelegatedRendererLayer is at position 3,3 compared to its target, and | 245 // The DelegatedRendererLayer is at position 3,3 compared to its target, and |
| 246 // has a translation transform of 1,1. So its root RenderPass' quads should | 246 // has a translation transform of 1,1. So its root RenderPass' quads should |
| 247 // all be transformed by that combined amount. | 247 // all be transformed by that combined amount. |
| 248 // The DelegatedRendererLayer has a size of 10x10, but the root delegated | |
| 249 // RenderPass has a size of 8x8, so any quads should be scaled by 10/8. | |
| 250 gfx::Transform transform; | 248 gfx::Transform transform; |
| 251 transform.Translate(4.0, 4.0); | 249 transform.Translate(4.0, 4.0); |
| 252 transform.Scale(10.0 / 8.0, 10.0 / 8.0); | |
| 253 EXPECT_TRANSFORMATION_MATRIX_EQ( | 250 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 254 transform, frame.render_passes[3]->quad_list[0]->quadTransform()); | 251 transform, frame.render_passes[3]->quad_list[0]->quadTransform()); |
| 255 | 252 |
| 256 // Quads from non-root RenderPasses should not be shifted though. | 253 // Quads from non-root RenderPasses should not be shifted though. |
| 257 ASSERT_EQ(2u, frame.render_passes[2]->quad_list.size()); | 254 ASSERT_EQ(2u, frame.render_passes[2]->quad_list.size()); |
| 258 EXPECT_TRANSFORMATION_MATRIX_EQ( | 255 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 259 gfx::Transform(), frame.render_passes[2]->quad_list[0]->quadTransform()); | 256 gfx::Transform(), frame.render_passes[2]->quad_list[0]->quadTransform()); |
| 260 EXPECT_TRANSFORMATION_MATRIX_EQ( | 257 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 261 gfx::Transform(), frame.render_passes[2]->quad_list[1]->quadTransform()); | 258 gfx::Transform(), frame.render_passes[2]->quad_list[1]->quadTransform()); |
| 262 ASSERT_EQ(1u, frame.render_passes[1]->quad_list.size()); | 259 ASSERT_EQ(1u, frame.render_passes[1]->quad_list.size()); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 273 | 270 |
| 274 // The delegated layer has a surface between it and the root. | 271 // The delegated layer has a surface between it and the root. |
| 275 EXPECT_TRUE(delegated_renderer_layer_->render_target()->parent()); | 272 EXPECT_TRUE(delegated_renderer_layer_->render_target()->parent()); |
| 276 | 273 |
| 277 // Each non-DelegatedRendererLayer added one RenderPass. The | 274 // Each non-DelegatedRendererLayer added one RenderPass. The |
| 278 // DelegatedRendererLayer added two contributing passes. | 275 // DelegatedRendererLayer added two contributing passes. |
| 279 ASSERT_EQ(5u, frame.render_passes.size()); | 276 ASSERT_EQ(5u, frame.render_passes.size()); |
| 280 | 277 |
| 281 // The DelegatedRendererLayer is at position 9,9 compared to the root, so all | 278 // The DelegatedRendererLayer is at position 9,9 compared to the root, so all |
| 282 // render pass' transforms to the root should be shifted by this amount. | 279 // render pass' transforms to the root should be shifted by this amount. |
| 283 // The DelegatedRendererLayer has a size of 10x10, but the root delegated | |
| 284 // RenderPass has a size of 8x8, so any render passes should be scaled by | |
| 285 // 10/8. | |
| 286 gfx::Transform transform; | 280 gfx::Transform transform; |
| 287 transform.Translate(9.0, 9.0); | 281 transform.Translate(9.0, 9.0); |
| 288 transform.Scale(10.0 / 8.0, 10.0 / 8.0); | |
| 289 | 282 |
| 290 // The first contributing surface has a translation of 5, 6. | 283 // The first contributing surface has a translation of 5, 6. |
| 291 gfx::Transform five_six(1, 0, 0, 1, 5, 6); | 284 gfx::Transform five_six(1, 0, 0, 1, 5, 6); |
| 292 | 285 |
| 293 // The second contributing surface has a translation of 7, 8. | 286 // The second contributing surface has a translation of 7, 8. |
| 294 gfx::Transform seven_eight(1, 0, 0, 1, 7, 8); | 287 gfx::Transform seven_eight(1, 0, 0, 1, 7, 8); |
| 295 | 288 |
| 296 EXPECT_TRANSFORMATION_MATRIX_EQ( | 289 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 297 transform * five_six, frame.render_passes[1]->transform_to_root_target); | 290 transform * five_six, frame.render_passes[1]->transform_to_root_target); |
| 298 EXPECT_TRANSFORMATION_MATRIX_EQ( | 291 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 QuadsFromRootRenderPassAreNotModifiedForTheTarget) { | 454 QuadsFromRootRenderPassAreNotModifiedForTheTarget) { |
| 462 LayerTreeHostImpl::FrameData frame; | 455 LayerTreeHostImpl::FrameData frame; |
| 463 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 456 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
| 464 | 457 |
| 465 // Each non-DelegatedRendererLayer added one RenderPass. The | 458 // Each non-DelegatedRendererLayer added one RenderPass. The |
| 466 // DelegatedRendererLayer added two contributing passes and its owned surface | 459 // DelegatedRendererLayer added two contributing passes and its owned surface |
| 467 // added one pass. | 460 // added one pass. |
| 468 ASSERT_EQ(6u, frame.render_passes.size()); | 461 ASSERT_EQ(6u, frame.render_passes.size()); |
| 469 | 462 |
| 470 // Because the DelegatedRendererLayer owns a RenderSurfaceImpl, its root | 463 // Because the DelegatedRendererLayer owns a RenderSurfaceImpl, its root |
| 471 // RenderPass' quads do not need to be translated at all. However, they are | 464 // RenderPass' quads do not need to be translated at all. |
| 472 // scaled from the frame's size (8x8) to the layer's bounds (10x10). | |
| 473 gfx::Transform transform; | |
| 474 transform.Scale(10.0 / 8.0, 10.0 / 8.0); | |
| 475 EXPECT_TRANSFORMATION_MATRIX_EQ( | 465 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 476 transform, frame.render_passes[3]->quad_list[0]->quadTransform()); | 466 gfx::Transform(), frame.render_passes[3]->quad_list[0]->quadTransform()); |
| 477 | 467 |
| 478 // Quads from non-root RenderPasses should not be shifted either. | 468 // Quads from non-root RenderPasses should not be shifted either. |
| 479 ASSERT_EQ(2u, frame.render_passes[2]->quad_list.size()); | 469 ASSERT_EQ(2u, frame.render_passes[2]->quad_list.size()); |
| 480 EXPECT_TRANSFORMATION_MATRIX_EQ( | 470 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 481 gfx::Transform(), frame.render_passes[2]->quad_list[0]->quadTransform()); | 471 gfx::Transform(), frame.render_passes[2]->quad_list[0]->quadTransform()); |
| 482 EXPECT_TRANSFORMATION_MATRIX_EQ( | 472 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 483 gfx::Transform(), frame.render_passes[2]->quad_list[1]->quadTransform()); | 473 gfx::Transform(), frame.render_passes[2]->quad_list[1]->quadTransform()); |
| 484 ASSERT_EQ(1u, frame.render_passes[1]->quad_list.size()); | 474 ASSERT_EQ(1u, frame.render_passes[1]->quad_list.size()); |
| 485 EXPECT_TRANSFORMATION_MATRIX_EQ( | 475 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 486 gfx::Transform(), frame.render_passes[1]->quad_list[0]->quadTransform()); | 476 gfx::Transform(), frame.render_passes[1]->quad_list[0]->quadTransform()); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 // the drawable_content_rect of the delegated renderer layer. | 696 // the drawable_content_rect of the delegated renderer layer. |
| 707 EXPECT_EQ(delegated_renderer_layer_->drawable_content_rect().ToString(), | 697 EXPECT_EQ(delegated_renderer_layer_->drawable_content_rect().ToString(), |
| 708 root_delegated_shared_quad_state->clip_rect.ToString()); | 698 root_delegated_shared_quad_state->clip_rect.ToString()); |
| 709 | 699 |
| 710 // Even though the quads in the root pass have no clip of their own, they | 700 // Even though the quads in the root pass have no clip of their own, they |
| 711 // inherit the clip rect from the delegated renderer layer if it does not | 701 // inherit the clip rect from the delegated renderer layer if it does not |
| 712 // own a surface. | 702 // own a surface. |
| 713 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); | 703 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); |
| 714 | 704 |
| 715 gfx::Transform expected; | 705 gfx::Transform expected; |
| 716 // Device scale factor is 2. | |
| 717 expected.Scale(2.0, 2.0); | |
| 718 // This is the transform from the layer's space to its target. | 706 // This is the transform from the layer's space to its target. |
| 719 // The position (20) - the width / scale (75 / 2) = 20 - 37.5 = -17.5 | 707 expected.Translate(-20, -20); |
| 720 expected.Translate(-17.5, -17.5); | |
| 721 expected.Scale(2.0, 2.0); | 708 expected.Scale(2.0, 2.0); |
| 722 expected.Translate(8.0, 8.0); | 709 expected.Translate(8.0, 8.0); |
| 723 // The frame has size 100x100 but the layer's bounds are 75x75. | |
| 724 expected.Scale(75.0 / 100.0, 75.0 / 100.0); | |
| 725 // This is the transform within the source frame. | 710 // This is the transform within the source frame. |
| 726 expected.Scale(1.5, 1.5); | 711 expected.Scale(1.5, 1.5); |
| 727 expected.Translate(7.0, 7.0); | 712 expected.Translate(7.0, 7.0); |
| 728 EXPECT_TRANSFORMATION_MATRIX_EQ( | 713 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 729 expected, root_delegated_shared_quad_state->content_to_target_transform); | 714 expected, root_delegated_shared_quad_state->content_to_target_transform); |
|
jamesr
2014/06/04 22:46:29
this test produces an actual total translation of
| |
| 730 | 715 |
| 731 // The contributing render pass should not be transformed from its input. | 716 // The contributing render pass should not be transformed from its input. |
| 732 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), | 717 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), |
| 733 contrib_delegated_shared_quad_state->clip_rect.ToString()); | 718 contrib_delegated_shared_quad_state->clip_rect.ToString()); |
| 734 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); | 719 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); |
| 735 expected.MakeIdentity(); | 720 expected.MakeIdentity(); |
| 736 expected.Scale(0.8f, 0.8f); | 721 expected.Scale(0.8f, 0.8f); |
| 737 expected.Translate(9.0, 9.0); | 722 expected.Translate(9.0, 9.0); |
| 738 EXPECT_TRANSFORMATION_MATRIX_EQ( | 723 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 739 expected, | 724 expected, |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 754 const SharedQuadState* contrib_delegated_shared_quad_state = NULL; | 739 const SharedQuadState* contrib_delegated_shared_quad_state = NULL; |
| 755 VerifyRenderPasses( | 740 VerifyRenderPasses( |
| 756 frame, | 741 frame, |
| 757 2, | 742 2, |
| 758 &root_delegated_shared_quad_state, | 743 &root_delegated_shared_quad_state, |
| 759 &contrib_delegated_shared_quad_state); | 744 &contrib_delegated_shared_quad_state); |
| 760 | 745 |
| 761 // Since the quads have a clip_rect it should be modified by delegated | 746 // Since the quads have a clip_rect it should be modified by delegated |
| 762 // renderer layer's draw_transform. | 747 // renderer layer's draw_transform. |
| 763 // The position of the resulting clip_rect is: | 748 // The position of the resulting clip_rect is: |
| 764 // (clip rect position (10) * scale to layer (75/100) + translate (8)) * | 749 // (clip rect position (10) * inverse dsf (1/2) + translate (8)) * |
| 765 // layer scale (2) + layer position (20) = 51 | 750 // layer scale (2) + layer position (20) = 46 |
| 766 // But the layer is centered, so: 51 - (75 / 2) = 51 - 75 / 2 = 13.5 | 751 // But the layer is centered, so: 46 - (75 / 2) = 46 - 75 / 2 = 8.5 |
| 767 // The device scale is 2, so everything gets doubled, giving 27. | 752 // The device scale is 2, so everything gets doubled, giving 17. |
| 768 // | 753 // |
| 769 // The size is 35x35 scaled to fit inside the layer's bounds at 75x75 from | 754 // The size is 35x35 scaled by the device scale. |
| 770 // a frame at 100x100: 35 * 2 (device scale) * 75 / 100 = 52.5. The device | 755 EXPECT_EQ(gfx::Rect(17, 17, 70, 70).ToString(), |
| 771 // scale doubles this to 105. | |
| 772 EXPECT_EQ(gfx::Rect(27, 27, 105, 105).ToString(), | |
| 773 root_delegated_shared_quad_state->clip_rect.ToString()); | 756 root_delegated_shared_quad_state->clip_rect.ToString()); |
| 774 | 757 |
| 775 // The quads had a clip and it should be preserved. | 758 // The quads had a clip and it should be preserved. |
| 776 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); | 759 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); |
| 777 | 760 |
| 778 gfx::Transform expected; | 761 gfx::Transform expected; |
| 779 // Device scale factor is 2. | |
| 780 expected.Scale(2.0, 2.0); | |
| 781 // This is the transform from the layer's space to its target. | 762 // This is the transform from the layer's space to its target. |
| 782 // The position (20) - the width / scale (75 / 2) = 20 - 37.5 = -17.5 | 763 expected.Translate(-20, -20); |
| 783 expected.Translate(-17.5, -17.5); | |
| 784 expected.Scale(2.0, 2.0); | 764 expected.Scale(2.0, 2.0); |
| 785 expected.Translate(8.0, 8.0); | 765 expected.Translate(8.0, 8.0); |
| 786 // The frame has size 100x100 but the layer's bounds are 75x75. | |
| 787 expected.Scale(75.0 / 100.0, 75.0 / 100.0); | |
| 788 // This is the transform within the source frame. | 766 // This is the transform within the source frame. |
| 789 expected.Scale(1.5, 1.5); | 767 expected.Scale(1.5, 1.5); |
| 790 expected.Translate(7.0, 7.0); | 768 expected.Translate(7.0, 7.0); |
| 791 EXPECT_TRANSFORMATION_MATRIX_EQ( | 769 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 792 expected, root_delegated_shared_quad_state->content_to_target_transform); | 770 expected, root_delegated_shared_quad_state->content_to_target_transform); |
|
jamesr
2014/06/04 22:46:29
this one fails in the same way.
| |
| 793 | 771 |
| 794 // The contributing render pass should not be transformed from its input. | 772 // The contributing render pass should not be transformed from its input. |
| 795 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), | 773 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), |
| 796 contrib_delegated_shared_quad_state->clip_rect.ToString()); | 774 contrib_delegated_shared_quad_state->clip_rect.ToString()); |
| 797 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); | 775 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); |
| 798 expected.MakeIdentity(); | 776 expected.MakeIdentity(); |
| 799 expected.Scale(0.8f, 0.8f); | 777 expected.Scale(0.8f, 0.8f); |
| 800 expected.Translate(9.0, 9.0); | 778 expected.Translate(9.0, 9.0); |
| 801 EXPECT_TRANSFORMATION_MATRIX_EQ( | 779 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 802 expected, | 780 expected, |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 818 const SharedQuadState* root_delegated_shared_quad_state = NULL; | 796 const SharedQuadState* root_delegated_shared_quad_state = NULL; |
| 819 const SharedQuadState* contrib_delegated_shared_quad_state = NULL; | 797 const SharedQuadState* contrib_delegated_shared_quad_state = NULL; |
| 820 VerifyRenderPasses( | 798 VerifyRenderPasses( |
| 821 frame, | 799 frame, |
| 822 3, | 800 3, |
| 823 &root_delegated_shared_quad_state, | 801 &root_delegated_shared_quad_state, |
| 824 &contrib_delegated_shared_quad_state); | 802 &contrib_delegated_shared_quad_state); |
| 825 | 803 |
| 826 // When the layer owns a surface, then its position and translation are not | 804 // When the layer owns a surface, then its position and translation are not |
| 827 // a part of its draw transform. | 805 // a part of its draw transform. |
| 828 // The position of the resulting clip_rect is: | 806 EXPECT_EQ(gfx::Rect(10, 10, 35, 35).ToString(), |
| 829 // (clip rect position (10) * scale to layer (75/100)) * device scale (2) = 15 | |
| 830 // The size is 35x35 scaled to fit inside the layer's bounds at 75x75 from | |
| 831 // a frame at 100x100: 35 * 2 (device scale) * 75 / 100 = 52.5. | |
| 832 EXPECT_EQ(gfx::Rect(15, 15, 53, 53).ToString(), | |
| 833 root_delegated_shared_quad_state->clip_rect.ToString()); | 807 root_delegated_shared_quad_state->clip_rect.ToString()); |
| 834 | 808 |
| 835 // Since the layer owns a surface it doesn't need to clip its quads, so | 809 // Since the layer owns a surface it doesn't need to clip its quads, so |
| 836 // unclipped quads remain unclipped. | 810 // unclipped quads remain unclipped. |
| 837 EXPECT_FALSE(root_delegated_shared_quad_state->is_clipped); | 811 EXPECT_FALSE(root_delegated_shared_quad_state->is_clipped); |
| 838 | 812 |
| 839 gfx::Transform expected; | 813 gfx::Transform expected; |
| 840 // Device scale factor is 2. | |
| 841 expected.Scale(2.0, 2.0); | |
| 842 // The frame has size 100x100 but the layer's bounds are 75x75. | |
| 843 expected.Scale(75.0 / 100.0, 75.0 / 100.0); | |
| 844 // This is the transform within the source frame. | 814 // This is the transform within the source frame. |
| 845 expected.Scale(1.5, 1.5); | 815 expected.Scale(1.5, 1.5); |
| 846 expected.Translate(7.0, 7.0); | 816 expected.Translate(7.0, 7.0); |
| 847 EXPECT_TRANSFORMATION_MATRIX_EQ( | 817 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 848 expected, root_delegated_shared_quad_state->content_to_target_transform); | 818 expected, root_delegated_shared_quad_state->content_to_target_transform); |
| 849 | 819 |
| 850 // The contributing render pass should not be transformed from its input. | 820 // The contributing render pass should not be transformed from its input. |
| 851 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), | 821 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), |
| 852 contrib_delegated_shared_quad_state->clip_rect.ToString()); | 822 contrib_delegated_shared_quad_state->clip_rect.ToString()); |
| 853 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); | 823 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 873 | 843 |
| 874 const SharedQuadState* root_delegated_shared_quad_state = NULL; | 844 const SharedQuadState* root_delegated_shared_quad_state = NULL; |
| 875 const SharedQuadState* contrib_delegated_shared_quad_state = NULL; | 845 const SharedQuadState* contrib_delegated_shared_quad_state = NULL; |
| 876 VerifyRenderPasses( | 846 VerifyRenderPasses( |
| 877 frame, | 847 frame, |
| 878 3, | 848 3, |
| 879 &root_delegated_shared_quad_state, | 849 &root_delegated_shared_quad_state, |
| 880 &contrib_delegated_shared_quad_state); | 850 &contrib_delegated_shared_quad_state); |
| 881 | 851 |
| 882 // When the layer owns a surface, then its position and translation are not | 852 // When the layer owns a surface, then its position and translation are not |
| 883 // a part of its draw transform. | 853 // a part of its draw transform. The clip_rect should be preserved. |
| 884 // The position of the resulting clip_rect is: | 854 EXPECT_EQ(gfx::Rect(10, 10, 35, 35).ToString(), |
| 885 // (clip rect position (10) * scale to layer (75/100)) * device scale (2) = 15 | |
| 886 // The size is 35x35 scaled to fit inside the layer's bounds at 75x75 from | |
| 887 // a frame at 100x100: 35 * 2 (device scale) * 75 / 100 = 52.5. | |
| 888 EXPECT_EQ(gfx::Rect(15, 15, 53, 53).ToString(), | |
| 889 root_delegated_shared_quad_state->clip_rect.ToString()); | 855 root_delegated_shared_quad_state->clip_rect.ToString()); |
| 890 | 856 |
| 891 // The quads had a clip and it should be preserved. | 857 // The quads had a clip and it should be preserved. |
| 892 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); | 858 EXPECT_TRUE(root_delegated_shared_quad_state->is_clipped); |
| 893 | 859 |
| 894 gfx::Transform expected; | 860 gfx::Transform expected; |
| 895 // Device scale factor is 2. | |
| 896 expected.Scale(2.0, 2.0); | |
| 897 // The frame has size 100x100 but the layer's bounds are 75x75. | |
| 898 expected.Scale(75.0 / 100.0, 75.0 / 100.0); | |
| 899 // This is the transform within the source frame. | 861 // This is the transform within the source frame. |
| 900 expected.Scale(1.5, 1.5); | 862 expected.Scale(1.5, 1.5); |
| 901 expected.Translate(7.0, 7.0); | 863 expected.Translate(7.0, 7.0); |
| 902 EXPECT_TRANSFORMATION_MATRIX_EQ( | 864 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 903 expected, root_delegated_shared_quad_state->content_to_target_transform); | 865 expected, root_delegated_shared_quad_state->content_to_target_transform); |
| 904 | 866 |
| 905 // The contributing render pass should not be transformed from its input. | 867 // The contributing render pass should not be transformed from its input. |
| 906 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), | 868 EXPECT_EQ(gfx::Rect(21, 21, 3, 3).ToString(), |
| 907 contrib_delegated_shared_quad_state->clip_rect.ToString()); | 869 contrib_delegated_shared_quad_state->clip_rect.ToString()); |
| 908 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); | 870 EXPECT_FALSE(contrib_delegated_shared_quad_state->is_clipped); |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1503 // The occlusion extends to 500 in the x-axis, pushing the left of the | 1465 // The occlusion extends to 500 in the x-axis, pushing the left of the |
| 1504 // visible part of the quad to 500 - 211 = 300 - 11 inside the quad. | 1466 // visible part of the quad to 500 - 211 = 300 - 11 inside the quad. |
| 1505 EXPECT_EQ(gfx::Rect(300 - 11, 0, 100 + 11, 500).ToString(), | 1467 EXPECT_EQ(gfx::Rect(300 - 11, 0, 100 + 11, 500).ToString(), |
| 1506 impl.quad_list()[0]->visible_rect.ToString()); | 1468 impl.quad_list()[0]->visible_rect.ToString()); |
| 1507 } | 1469 } |
| 1508 } | 1470 } |
| 1509 } | 1471 } |
| 1510 | 1472 |
| 1511 } // namespace | 1473 } // namespace |
| 1512 } // namespace cc | 1474 } // namespace cc |
| OLD | NEW |