| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui_resource_layer_impl.h" | 8 #include "cc/layers/ui_resource_layer_impl.h" |
| 9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
| 10 #include "cc/resources/ui_resource_bitmap.h" | 10 #include "cc/resources/ui_resource_bitmap.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 const gfx::Size& bitmap_size, | 29 const gfx::Size& bitmap_size, |
| 30 const gfx::Size& layer_size, | 30 const gfx::Size& layer_size, |
| 31 bool opaque, | 31 bool opaque, |
| 32 UIResourceId uid) { | 32 UIResourceId uid) { |
| 33 gfx::Rect visible_layer_rect(layer_size); | 33 gfx::Rect visible_layer_rect(layer_size); |
| 34 scoped_ptr<UIResourceLayerImpl> layer = | 34 scoped_ptr<UIResourceLayerImpl> layer = |
| 35 UIResourceLayerImpl::Create(host_impl->active_tree(), 1); | 35 UIResourceLayerImpl::Create(host_impl->active_tree(), 1); |
| 36 layer->draw_properties().visible_layer_rect = visible_layer_rect; | 36 layer->draw_properties().visible_layer_rect = visible_layer_rect; |
| 37 layer->SetBounds(layer_size); | 37 layer->SetBounds(layer_size); |
| 38 layer->SetForceRenderSurface(true); | 38 layer->SetForceRenderSurface(true); |
| 39 layer->draw_properties().render_target = layer.get(); | |
| 40 | 39 |
| 41 UIResourceBitmap bitmap(bitmap_size, opaque); | 40 UIResourceBitmap bitmap(bitmap_size, opaque); |
| 42 | 41 |
| 43 host_impl->CreateUIResource(uid, bitmap); | 42 host_impl->CreateUIResource(uid, bitmap); |
| 44 layer->SetUIResourceId(uid); | 43 layer->SetUIResourceId(uid); |
| 45 | 44 |
| 46 return layer; | 45 return layer; |
| 47 } | 46 } |
| 48 | 47 |
| 49 void QuadSizeTest(scoped_ptr<UIResourceLayerImpl> layer, | 48 void QuadSizeTest(scoped_ptr<UIResourceLayerImpl> layer, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 LayerTestCommon::VerifyQuadsAreOccluded( | 213 LayerTestCommon::VerifyQuadsAreOccluded( |
| 215 impl.quad_list(), occluded, &partially_occluded_count); | 214 impl.quad_list(), occluded, &partially_occluded_count); |
| 216 // The layer outputs one quad, which is partially occluded. | 215 // The layer outputs one quad, which is partially occluded. |
| 217 EXPECT_EQ(1u, impl.quad_list().size()); | 216 EXPECT_EQ(1u, impl.quad_list().size()); |
| 218 EXPECT_EQ(1u, partially_occluded_count); | 217 EXPECT_EQ(1u, partially_occluded_count); |
| 219 } | 218 } |
| 220 } | 219 } |
| 221 | 220 |
| 222 } // namespace | 221 } // namespace |
| 223 } // namespace cc | 222 } // namespace cc |
| OLD | NEW |