| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
| 8 #include "cc/layers/nine_patch_layer_impl.h" | 8 #include "cc/layers/nine_patch_layer_impl.h" |
| 9 #include "cc/quads/texture_draw_quad.h" | 9 #include "cc/quads/texture_draw_quad.h" |
| 10 #include "cc/resources/ui_resource_bitmap.h" | 10 #include "cc/resources/ui_resource_bitmap.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 image_remaining_right = border_right * ratio_right, | 144 image_remaining_right = border_right * ratio_right, |
| 145 image_remaining_bottom = border_bottom * ratio_bottom; | 145 image_remaining_bottom = border_bottom * ratio_bottom; |
| 146 gfx::Rect expected_tex_remaining( | 146 gfx::Rect expected_tex_remaining( |
| 147 image_remaining_left, image_remaining_top, | 147 image_remaining_left, image_remaining_top, |
| 148 bitmap_size.width() - image_remaining_right - image_remaining_left, | 148 bitmap_size.width() - image_remaining_right - image_remaining_left, |
| 149 bitmap_size.height() - image_remaining_bottom - image_remaining_top); | 149 bitmap_size.height() - image_remaining_bottom - image_remaining_top); |
| 150 | 150 |
| 151 FakeImplTaskRunnerProvider task_runner_provider; | 151 FakeImplTaskRunnerProvider task_runner_provider; |
| 152 TestSharedBitmapManager shared_bitmap_manager; | 152 TestSharedBitmapManager shared_bitmap_manager; |
| 153 TestTaskGraphRunner task_graph_runner; | 153 TestTaskGraphRunner task_graph_runner; |
| 154 std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | 154 std::unique_ptr<OutputSurface> output_surface = |
| 155 FakeOutputSurface::CreateDelegating3d(); |
| 155 FakeUIResourceLayerTreeHostImpl host_impl( | 156 FakeUIResourceLayerTreeHostImpl host_impl( |
| 156 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); | 157 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); |
| 157 host_impl.SetVisible(true); | 158 host_impl.SetVisible(true); |
| 158 host_impl.InitializeRenderer(output_surface.get()); | 159 host_impl.InitializeRenderer(output_surface.get()); |
| 159 | 160 |
| 160 std::unique_ptr<NinePatchLayerImpl> layer = | 161 std::unique_ptr<NinePatchLayerImpl> layer = |
| 161 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); | 162 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); |
| 162 layer->draw_properties().visible_layer_rect = visible_layer_rect; | 163 layer->draw_properties().visible_layer_rect = visible_layer_rect; |
| 163 layer->SetBounds(layer_size); | 164 layer->SetBounds(layer_size); |
| 164 layer->test_properties()->force_render_surface = true; | 165 layer->test_properties()->force_render_surface = true; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 450 |
| 450 const QuadList &quad_list = impl.quad_list(); | 451 const QuadList &quad_list = impl.quad_list(); |
| 451 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 452 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
| 452 it != quad_list.BackToFrontEnd(); ++it) | 453 it != quad_list.BackToFrontEnd(); ++it) |
| 453 EXPECT_TRUE(it->ShouldDrawWithBlending()); | 454 EXPECT_TRUE(it->ShouldDrawWithBlending()); |
| 454 } | 455 } |
| 455 } | 456 } |
| 456 | 457 |
| 457 } // namespace | 458 } // namespace |
| 458 } // namespace cc | 459 } // namespace cc |
| OLD | NEW |