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

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

Issue 385433002: Push inverse device scale factor in DRLI->DRLI pushes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/layers/delegated_renderer_layer_impl.cc ('k') | no next file » | 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/solid_color_layer_impl.h" 8 #include "cc/layers/solid_color_layer_impl.h"
9 #include "cc/quads/render_pass_draw_quad.h" 9 #include "cc/quads/render_pass_draw_quad.h"
10 #include "cc/quads/solid_color_draw_quad.h" 10 #include "cc/quads/solid_color_draw_quad.h"
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 EXPECT_EQ(1u, partially_occluded_count); 1516 EXPECT_EQ(1u, partially_occluded_count);
1517 // The quad in the contributing surface is at (211,300) in the root. 1517 // The quad in the contributing surface is at (211,300) in the root.
1518 // The occlusion extends to 500 in the x-axis, pushing the left of the 1518 // The occlusion extends to 500 in the x-axis, pushing the left of the
1519 // visible part of the quad to 500 - 211 = 300 - 11 inside the quad. 1519 // visible part of the quad to 500 - 211 = 300 - 11 inside the quad.
1520 EXPECT_EQ(gfx::Rect(300 - 11, 0, 100 + 11, 500).ToString(), 1520 EXPECT_EQ(gfx::Rect(300 - 11, 0, 100 + 11, 500).ToString(),
1521 impl.quad_list()[0]->visible_rect.ToString()); 1521 impl.quad_list()[0]->visible_rect.ToString());
1522 } 1522 }
1523 } 1523 }
1524 } 1524 }
1525 1525
1526 TEST_F(DelegatedRendererLayerImplTest, PushPropertiesTo) {
1527 gfx::Size layer_size(1000, 1000);
1528
1529 scoped_ptr<FakeDelegatedRendererLayerImpl> delegated_renderer_layer_impl =
1530 FakeDelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 5);
1531 delegated_renderer_layer_impl->SetBounds(layer_size);
1532 delegated_renderer_layer_impl->SetContentBounds(layer_size);
1533 delegated_renderer_layer_impl->SetDrawsContent(true);
1534
1535 RenderPassList delegated_render_passes;
1536 // |pass1| covers the whole layer.
1537 RenderPass::Id pass1_id = RenderPass::Id(5, 0);
1538 AddRenderPass(&delegated_render_passes,
1539 pass1_id,
1540 gfx::Rect(layer_size),
1541 gfx::Transform());
1542 delegated_renderer_layer_impl->SetFrameDataForRenderPasses(
1543 2.f, &delegated_render_passes);
1544 DCHECK_EQ(0.5f, delegated_renderer_layer_impl->inverse_device_scale_factor());
danakj 2014/07/09 21:12:57 EXPECT_EQ
1545
1546 scoped_ptr<DelegatedRendererLayerImpl> other_layer =
1547 DelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 6);
1548
1549 delegated_renderer_layer_impl->PushPropertiesTo(other_layer.get());
1550
1551 DCHECK_EQ(0.5f, other_layer->inverse_device_scale_factor());
danakj 2014/07/09 21:12:57 EXPECT_EQ
1552 }
1553
1526 } // namespace 1554 } // namespace
1527 } // namespace cc 1555 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698