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

Side by Side Diff: cc/layers/delegated_renderer_layer_impl_unittest.cc

Issue 295193002: Get rid of graphics layer anchor points, and replace with transform origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 6 years, 6 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/base/math_util.cc ('k') | cc/layers/io_surface_layer_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 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 root_layer->SetBounds(gfx::Size(100, 100)); 504 root_layer->SetBounds(gfx::Size(100, 100));
505 505
506 delegated_renderer_layer->SetPosition(gfx::Point(20, 20)); 506 delegated_renderer_layer->SetPosition(gfx::Point(20, 20));
507 delegated_renderer_layer->SetBounds(gfx::Size(75, 75)); 507 delegated_renderer_layer->SetBounds(gfx::Size(75, 75));
508 delegated_renderer_layer->SetContentBounds(gfx::Size(75, 75)); 508 delegated_renderer_layer->SetContentBounds(gfx::Size(75, 75));
509 delegated_renderer_layer->SetDrawsContent(true); 509 delegated_renderer_layer->SetDrawsContent(true);
510 gfx::Transform transform; 510 gfx::Transform transform;
511 transform.Scale(2.0, 2.0); 511 transform.Scale(2.0, 2.0);
512 transform.Translate(8.0, 8.0); 512 transform.Translate(8.0, 8.0);
513 delegated_renderer_layer->SetTransform(transform); 513 delegated_renderer_layer->SetTransform(transform);
514 delegated_renderer_layer->SetTransformOrigin(
515 gfx::Point3F(75 * 0.5f, 75 * 0.5f, 0.0f));
514 516
515 ScopedPtrVector<RenderPass> delegated_render_passes; 517 ScopedPtrVector<RenderPass> delegated_render_passes;
516 518
517 gfx::Size child_pass_content_bounds(7, 7); 519 gfx::Size child_pass_content_bounds(7, 7);
518 gfx::Rect child_pass_rect(20, 20, 7, 7); 520 gfx::Rect child_pass_rect(20, 20, 7, 7);
519 gfx::Transform child_pass_transform; 521 gfx::Transform child_pass_transform;
520 child_pass_transform.Scale(0.8f, 0.8f); 522 child_pass_transform.Scale(0.8f, 0.8f);
521 child_pass_transform.Translate(9.0, 9.0); 523 child_pass_transform.Translate(9.0, 9.0);
522 gfx::Rect child_pass_clip_rect(21, 21, 3, 3); 524 gfx::Rect child_pass_clip_rect(21, 21, 3, 3);
523 bool child_pass_clipped = false; 525 bool child_pass_clipped = false;
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 gfx::Size viewport_size(1000, 1000); 1381 gfx::Size viewport_size(1000, 1000);
1380 gfx::Rect quad_rect(200, 300, 400, 500); 1382 gfx::Rect quad_rect(200, 300, 400, 500);
1381 1383
1382 gfx::Transform transform; 1384 gfx::Transform transform;
1383 transform.Translate(11.0, 0.0); 1385 transform.Translate(11.0, 0.0);
1384 1386
1385 LayerTestCommon::LayerImplTest impl; 1387 LayerTestCommon::LayerImplTest impl;
1386 1388
1387 FakeDelegatedRendererLayerImpl* delegated_renderer_layer_impl = 1389 FakeDelegatedRendererLayerImpl* delegated_renderer_layer_impl =
1388 impl.AddChildToRoot<FakeDelegatedRendererLayerImpl>(); 1390 impl.AddChildToRoot<FakeDelegatedRendererLayerImpl>();
1389 delegated_renderer_layer_impl->SetAnchorPoint(gfx::PointF());
1390 delegated_renderer_layer_impl->SetBounds(layer_size); 1391 delegated_renderer_layer_impl->SetBounds(layer_size);
1391 delegated_renderer_layer_impl->SetContentBounds(layer_size); 1392 delegated_renderer_layer_impl->SetContentBounds(layer_size);
1392 delegated_renderer_layer_impl->SetDrawsContent(true); 1393 delegated_renderer_layer_impl->SetDrawsContent(true);
1393 1394
1394 ScopedPtrVector<RenderPass> delegated_render_passes; 1395 ScopedPtrVector<RenderPass> delegated_render_passes;
1395 // pass2 is just the size of the quad. It contributes to |pass1| with a 1396 // pass2 is just the size of the quad. It contributes to |pass1| with a
1396 // translation of (11,0). 1397 // translation of (11,0).
1397 RenderPass::Id pass2_id = 1398 RenderPass::Id pass2_id =
1398 delegated_renderer_layer_impl->FirstContributingRenderPassId(); 1399 delegated_renderer_layer_impl->FirstContributingRenderPassId();
1399 TestRenderPass* pass2 = 1400 TestRenderPass* pass2 =
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 // The occlusion extends to 500 in the x-axis, pushing the left of the 1504 // 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. 1505 // 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(), 1506 EXPECT_EQ(gfx::Rect(300 - 11, 0, 100 + 11, 500).ToString(),
1506 impl.quad_list()[0]->visible_rect.ToString()); 1507 impl.quad_list()[0]->visible_rect.ToString());
1507 } 1508 }
1508 } 1509 }
1509 } 1510 }
1510 1511
1511 } // namespace 1512 } // namespace
1512 } // namespace cc 1513 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/math_util.cc ('k') | cc/layers/io_surface_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698