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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 FakeUIResourceLayerTreeHostImpl host_impl( | 51 FakeUIResourceLayerTreeHostImpl host_impl( |
52 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); | 52 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); |
53 host_impl.SetVisible(true); | 53 host_impl.SetVisible(true); |
54 host_impl.InitializeRenderer(output_surface.get()); | 54 host_impl.InitializeRenderer(output_surface.get()); |
55 | 55 |
56 scoped_ptr<NinePatchLayerImpl> layer = | 56 scoped_ptr<NinePatchLayerImpl> layer = |
57 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); | 57 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); |
58 layer->draw_properties().visible_layer_rect = visible_layer_rect; | 58 layer->draw_properties().visible_layer_rect = visible_layer_rect; |
59 layer->SetBounds(layer_size); | 59 layer->SetBounds(layer_size); |
60 layer->SetForceRenderSurface(true); | 60 layer->SetForceRenderSurface(true); |
61 layer->draw_properties().render_target = layer.get(); | |
62 | 61 |
63 UIResourceId uid = 1; | 62 UIResourceId uid = 1; |
64 bool is_opaque = false; | 63 bool is_opaque = false; |
65 UIResourceBitmap bitmap(bitmap_size, is_opaque); | 64 UIResourceBitmap bitmap(bitmap_size, is_opaque); |
66 | 65 |
67 host_impl.CreateUIResource(uid, bitmap); | 66 host_impl.CreateUIResource(uid, bitmap); |
68 layer->SetUIResourceId(uid); | 67 layer->SetUIResourceId(uid); |
69 layer->SetImageBounds(bitmap_size); | 68 layer->SetImageBounds(bitmap_size); |
70 layer->SetLayout(aperture_rect, border, fill_center, false); | 69 layer->SetLayout(aperture_rect, border, fill_center, false); |
71 AppendQuadsData data; | 70 AppendQuadsData data; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 335 |
337 const QuadList &quad_list = impl.quad_list(); | 336 const QuadList &quad_list = impl.quad_list(); |
338 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 337 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
339 it != quad_list.BackToFrontEnd(); ++it) | 338 it != quad_list.BackToFrontEnd(); ++it) |
340 EXPECT_TRUE(it->ShouldDrawWithBlending()); | 339 EXPECT_TRUE(it->ShouldDrawWithBlending()); |
341 } | 340 } |
342 } | 341 } |
343 | 342 |
344 } // namespace | 343 } // namespace |
345 } // namespace cc | 344 } // namespace cc |
OLD | NEW |