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 "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
7 #include "cc/layers/nine_patch_layer_impl.h" | 7 #include "cc/layers/nine_patch_layer_impl.h" |
8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.h" |
9 #include "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
10 #include "cc/resources/ui_resource_client.h" | 10 #include "cc/resources/ui_resource_client.h" |
11 #include "cc/test/fake_impl_proxy.h" | 11 #include "cc/test/fake_impl_task_runner_provider.h" |
12 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
13 #include "cc/test/fake_ui_resource_layer_tree_host_impl.h" | 13 #include "cc/test/fake_ui_resource_layer_tree_host_impl.h" |
14 #include "cc/test/geometry_test_utils.h" | 14 #include "cc/test/geometry_test_utils.h" |
15 #include "cc/test/layer_test_common.h" | 15 #include "cc/test/layer_test_common.h" |
16 #include "cc/trees/single_thread_proxy.h" | 16 #include "cc/trees/single_thread_proxy.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "ui/gfx/geometry/rect_conversions.h" | 19 #include "ui/gfx/geometry/rect_conversions.h" |
20 #include "ui/gfx/geometry/safe_integer_conversions.h" | 20 #include "ui/gfx/geometry/safe_integer_conversions.h" |
21 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
(...skipping 14 matching lines...) Expand all Loading... |
36 const gfx::Rect& border, | 36 const gfx::Rect& border, |
37 bool fill_center, | 37 bool fill_center, |
38 size_t expected_quad_size) { | 38 size_t expected_quad_size) { |
39 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 39 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
40 gfx::Rect visible_layer_rect(layer_size); | 40 gfx::Rect visible_layer_rect(layer_size); |
41 gfx::Rect expected_remaining(border.x(), | 41 gfx::Rect expected_remaining(border.x(), |
42 border.y(), | 42 border.y(), |
43 layer_size.width() - border.width(), | 43 layer_size.width() - border.width(), |
44 layer_size.height() - border.height()); | 44 layer_size.height() - border.height()); |
45 | 45 |
46 FakeImplProxy proxy; | 46 FakeImplTaskRunnerProvider task_runner_provider; |
47 TestSharedBitmapManager shared_bitmap_manager; | 47 TestSharedBitmapManager shared_bitmap_manager; |
48 TestTaskGraphRunner task_graph_runner; | 48 TestTaskGraphRunner task_graph_runner; |
49 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | 49 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); |
50 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, | 50 FakeUIResourceLayerTreeHostImpl host_impl( |
51 &task_graph_runner); | 51 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); |
52 host_impl.SetVisible(true); | 52 host_impl.SetVisible(true); |
53 host_impl.InitializeRenderer(output_surface.get()); | 53 host_impl.InitializeRenderer(output_surface.get()); |
54 | 54 |
55 scoped_ptr<NinePatchLayerImpl> layer = | 55 scoped_ptr<NinePatchLayerImpl> layer = |
56 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); | 56 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); |
57 layer->draw_properties().visible_layer_rect = visible_layer_rect; | 57 layer->draw_properties().visible_layer_rect = visible_layer_rect; |
58 layer->SetBounds(layer_size); | 58 layer->SetBounds(layer_size); |
59 layer->SetHasRenderSurface(true); | 59 layer->SetHasRenderSurface(true); |
60 layer->draw_properties().render_target = layer.get(); | 60 layer->draw_properties().render_target = layer.get(); |
61 | 61 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 const QuadList &quad_list = impl.quad_list(); | 336 const QuadList &quad_list = impl.quad_list(); |
337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
338 it != quad_list.BackToFrontEnd(); ++it) | 338 it != quad_list.BackToFrontEnd(); ++it) |
339 EXPECT_TRUE(it->ShouldDrawWithBlending()); | 339 EXPECT_TRUE(it->ShouldDrawWithBlending()); |
340 } | 340 } |
341 } | 341 } |
342 | 342 |
343 } // namespace | 343 } // namespace |
344 } // namespace cc | 344 } // namespace cc |
OLD | NEW |