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/delegated_renderer_layer_impl.h" | 5 #include "cc/delegated_renderer_layer_impl.h" |
6 | 6 |
7 #include "cc/append_quads_data.h" | 7 #include "cc/append_quads_data.h" |
8 #include "cc/layer_tree_host_impl.h" | 8 #include "cc/layer_tree_host_impl.h" |
9 #include "cc/quad_sink.h" | 9 #include "cc/quad_sink.h" |
10 #include "cc/render_pass_draw_quad.h" | 10 #include "cc/render_pass_draw_quad.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 static void addRenderPassQuad(TestRenderPass* toPass, TestRenderPass* contributi
ngPass) | 86 static void addRenderPassQuad(TestRenderPass* toPass, TestRenderPass* contributi
ngPass) |
87 { | 87 { |
88 MockQuadCuller quadSink(toPass->quad_list, toPass->shared_quad_state_list); | 88 MockQuadCuller quadSink(toPass->quad_list, toPass->shared_quad_state_list); |
89 AppendQuadsData data(toPass->id); | 89 AppendQuadsData data(toPass->id); |
90 gfx::Rect outputRect = contributingPass->output_rect; | 90 gfx::Rect outputRect = contributingPass->output_rect; |
91 SharedQuadState* sharedState = quadSink.useSharedQuadState(SharedQuadState::
Create()); | 91 SharedQuadState* sharedState = quadSink.useSharedQuadState(SharedQuadState::
Create()); |
92 sharedState->SetAll(gfx::Transform(), outputRect, outputRect, outputRect, fa
lse, 1); | 92 sharedState->SetAll(gfx::Transform(), outputRect, outputRect, outputRect, fa
lse, 1); |
93 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); | 93 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); |
94 quad->SetNew(sharedState, outputRect, contributingPass->id, false, 0, output
Rect, 0, 0, 0, 0); | 94 quad->SetNew(sharedState, outputRect, contributingPass->id, false, 0, output
Rect, gfx::RectF()); |
95 quadSink.append(quad.PassAs<DrawQuad>(), data); | 95 quadSink.append(quad.PassAs<DrawQuad>(), data); |
96 } | 96 } |
97 | 97 |
98 class DelegatedRendererLayerImplTestSimple : public DelegatedRendererLayerImplTe
st { | 98 class DelegatedRendererLayerImplTestSimple : public DelegatedRendererLayerImplTe
st { |
99 public: | 99 public: |
100 DelegatedRendererLayerImplTestSimple() | 100 DelegatedRendererLayerImplTestSimple() |
101 : DelegatedRendererLayerImplTest() | 101 : DelegatedRendererLayerImplTest() |
102 { | 102 { |
103 scoped_ptr<LayerImpl> rootLayer = SolidColorLayerImpl::create(m_hostImpl
.get(), 1).PassAs<LayerImpl>(); | 103 scoped_ptr<LayerImpl> rootLayer = SolidColorLayerImpl::create(m_hostImpl
.get(), 1).PassAs<LayerImpl>(); |
104 scoped_ptr<LayerImpl> layerBefore = SolidColorLayerImpl::create(m_hostIm
pl.get(), 2).PassAs<LayerImpl>(); | 104 scoped_ptr<LayerImpl> layerBefore = SolidColorLayerImpl::create(m_hostIm
pl.get(), 2).PassAs<LayerImpl>(); |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 gfx::Transform expected; | 500 gfx::Transform expected; |
501 expected.Translate(30, 30); | 501 expected.Translate(30, 30); |
502 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, sharedState->content_to_target_tra
nsform); | 502 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, sharedState->content_to_target_tra
nsform); |
503 | 503 |
504 m_hostImpl->drawLayers(frame); | 504 m_hostImpl->drawLayers(frame); |
505 m_hostImpl->didDrawAllLayers(frame); | 505 m_hostImpl->didDrawAllLayers(frame); |
506 } | 506 } |
507 | 507 |
508 } // namespace | 508 } // namespace |
509 } // namespace cc | 509 } // namespace cc |
OLD | NEW |