OLD | NEW |
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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2607 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) { | 2607 static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) { |
2608 return scoped_ptr<LayerImpl>(new FakeLayerWithQuads(tree_impl, id)); | 2608 return scoped_ptr<LayerImpl>(new FakeLayerWithQuads(tree_impl, id)); |
2609 } | 2609 } |
2610 | 2610 |
2611 virtual void AppendQuads(QuadSink* quad_sink, | 2611 virtual void AppendQuads(QuadSink* quad_sink, |
2612 AppendQuadsData* append_quads_data) OVERRIDE { | 2612 AppendQuadsData* append_quads_data) OVERRIDE { |
2613 SharedQuadState* shared_quad_state = | 2613 SharedQuadState* shared_quad_state = |
2614 quad_sink->UseSharedQuadState(CreateSharedQuadState()); | 2614 quad_sink->UseSharedQuadState(CreateSharedQuadState()); |
2615 | 2615 |
2616 SkColor gray = SkColorSetRGB(100, 100, 100); | 2616 SkColor gray = SkColorSetRGB(100, 100, 100); |
2617 gfx::Rect quad_rect(gfx::Point(), content_bounds()); | 2617 gfx::Rect quad_rect(content_bounds()); |
2618 scoped_ptr<SolidColorDrawQuad> my_quad = SolidColorDrawQuad::Create(); | 2618 scoped_ptr<SolidColorDrawQuad> my_quad = SolidColorDrawQuad::Create(); |
2619 my_quad->SetNew(shared_quad_state, quad_rect, gray); | 2619 my_quad->SetNew(shared_quad_state, quad_rect, gray); |
2620 quad_sink->Append(my_quad.PassAs<DrawQuad>(), append_quads_data); | 2620 quad_sink->Append(my_quad.PassAs<DrawQuad>(), append_quads_data); |
2621 } | 2621 } |
2622 | 2622 |
2623 private: | 2623 private: |
2624 FakeLayerWithQuads(LayerTreeImpl* tree_impl, int id) | 2624 FakeLayerWithQuads(LayerTreeImpl* tree_impl, int id) |
2625 : LayerImpl(tree_impl, id) {} | 2625 : LayerImpl(tree_impl, id) {} |
2626 }; | 2626 }; |
2627 | 2627 |
(...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4956 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), | 4956 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), |
4957 render_pass_quad->mask_uv_rect.ToString()); | 4957 render_pass_quad->mask_uv_rect.ToString()); |
4958 | 4958 |
4959 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); | 4959 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); |
4960 host_impl_->DidDrawAllLayers(frame); | 4960 host_impl_->DidDrawAllLayers(frame); |
4961 } | 4961 } |
4962 } | 4962 } |
4963 | 4963 |
4964 } // namespace | 4964 } // namespace |
4965 } // namespace cc | 4965 } // namespace cc |
OLD | NEW |