| 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 "cc/tiled_layer_impl.h" | 5 #include "cc/tiled_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/append_quads_data.h" | 7 #include "cc/append_quads_data.h" |
| 8 #include "cc/layer_tiling_data.h" | 8 #include "cc/layer_tiling_data.h" |
| 9 #include "cc/single_thread_proxy.h" | 9 #include "cc/single_thread_proxy.h" |
| 10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 TiledLayerImplTest() | 24 TiledLayerImplTest() |
| 25 : m_hostImpl(&m_proxy) | 25 : m_hostImpl(&m_proxy) |
| 26 { | 26 { |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Create a default tiled layer with textures for all tiles and a default | 29 // Create a default tiled layer with textures for all tiles and a default |
| 30 // visibility of the entire layer size. | 30 // visibility of the entire layer size. |
| 31 scoped_ptr<TiledLayerImpl> createLayer(const gfx::Size& tileSize, const gfx:
:Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) | 31 scoped_ptr<TiledLayerImpl> createLayer(const gfx::Size& tileSize, const gfx:
:Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) |
| 32 { | 32 { |
| 33 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::Create(m_hostImpl.act
iveTree(), 1); | 33 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::Create(m_hostImpl.act
ive_tree(), 1); |
| 34 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, bo
rderTexels); | 34 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, bo
rderTexels); |
| 35 tiler->setBounds(layerSize); | 35 tiler->setBounds(layerSize); |
| 36 layer->setTilingData(*tiler); | 36 layer->setTilingData(*tiler); |
| 37 layer->setSkipsDraw(false); | 37 layer->setSkipsDraw(false); |
| 38 layer->draw_properties().visible_content_rect = gfx::Rect(gfx::Point(),
layerSize); | 38 layer->draw_properties().visible_content_rect = gfx::Rect(gfx::Point(),
layerSize); |
| 39 layer->draw_properties().opacity = 1; | 39 layer->draw_properties().opacity = 1; |
| 40 layer->SetBounds(layerSize); | 40 layer->SetBounds(layerSize); |
| 41 layer->SetContentBounds(layerSize); | 41 layer->SetContentBounds(layerSize); |
| 42 layer->CreateRenderSurface(); | 42 layer->CreateRenderSurface(); |
| 43 layer->draw_properties().render_target = layer.get(); | 43 layer->draw_properties().render_target = layer.get(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 EXPECT_NE(0u, quad->resource_id) << LayerTestCommon::quadString << i; | 223 EXPECT_NE(0u, quad->resource_id) << LayerTestCommon::quadString << i; |
| 224 EXPECT_EQ(gfx::RectF(gfx::PointF(), tileSize), quad->tex_coord_rect) <<
LayerTestCommon::quadString << i; | 224 EXPECT_EQ(gfx::RectF(gfx::PointF(), tileSize), quad->tex_coord_rect) <<
LayerTestCommon::quadString << i; |
| 225 EXPECT_EQ(tileSize, quad->texture_size) << LayerTestCommon::quadString <
< i; | 225 EXPECT_EQ(tileSize, quad->texture_size) << LayerTestCommon::quadString <
< i; |
| 226 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaque_rect) << LayerTestCommon::
quadString << i; | 226 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaque_rect) << LayerTestCommon::
quadString << i; |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace | 230 } // namespace |
| 231 } // namespace cc | 231 } // namespace cc |
| OLD | NEW |