| 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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 layer_size.height() - border.height()); | 43 layer_size.height() - border.height()); |
| 44 | 44 |
| 45 FakeImplProxy proxy; | 45 FakeImplProxy proxy; |
| 46 TestSharedBitmapManager shared_bitmap_manager; | 46 TestSharedBitmapManager shared_bitmap_manager; |
| 47 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); | 47 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); |
| 48 scoped_ptr<NinePatchLayerImpl> layer = | 48 scoped_ptr<NinePatchLayerImpl> layer = |
| 49 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); | 49 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); |
| 50 layer->draw_properties().visible_content_rect = visible_content_rect; | 50 layer->draw_properties().visible_content_rect = visible_content_rect; |
| 51 layer->SetBounds(layer_size); | 51 layer->SetBounds(layer_size); |
| 52 layer->SetContentBounds(layer_size); | 52 layer->SetContentBounds(layer_size); |
| 53 layer->CreateRenderSurface(); | 53 layer->SetHasRenderSurface(true); |
| 54 layer->draw_properties().render_target = layer.get(); | 54 layer->draw_properties().render_target = layer.get(); |
| 55 | 55 |
| 56 UIResourceId uid = 1; | 56 UIResourceId uid = 1; |
| 57 bool is_opaque = false; | 57 bool is_opaque = false; |
| 58 UIResourceBitmap bitmap(bitmap_size, is_opaque); | 58 UIResourceBitmap bitmap(bitmap_size, is_opaque); |
| 59 | 59 |
| 60 host_impl.CreateUIResource(uid, bitmap); | 60 host_impl.CreateUIResource(uid, bitmap); |
| 61 layer->SetUIResourceId(uid); | 61 layer->SetUIResourceId(uid); |
| 62 layer->SetImageBounds(bitmap_size); | 62 layer->SetImageBounds(bitmap_size); |
| 63 layer->SetLayout(aperture_rect, border, fill_center); | 63 layer->SetLayout(aperture_rect, border, fill_center); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 331 |
| 332 const QuadList &quad_list = impl.quad_list(); | 332 const QuadList &quad_list = impl.quad_list(); |
| 333 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 333 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
| 334 it != quad_list.BackToFrontEnd(); ++it) | 334 it != quad_list.BackToFrontEnd(); ++it) |
| 335 EXPECT_TRUE(it->ShouldDrawWithBlending()); | 335 EXPECT_TRUE(it->ShouldDrawWithBlending()); |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 | 338 |
| 339 } // namespace | 339 } // namespace |
| 340 } // namespace cc | 340 } // namespace cc |
| OLD | NEW |