| 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 15 matching lines...) Expand all Loading... |
| 26 public: | 26 public: |
| 27 TiledLayerImplTest() | 27 TiledLayerImplTest() |
| 28 : m_hostImpl(&m_proxy) | 28 : m_hostImpl(&m_proxy) |
| 29 { | 29 { |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Create a default tiled layer with textures for all tiles and a default | 32 // Create a default tiled layer with textures for all tiles and a default |
| 33 // visibility of the entire layer size. | 33 // visibility of the entire layer size. |
| 34 scoped_ptr<TiledLayerImpl> createLayer(const gfx::Size& tileSize, const gfx:
:Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) | 34 scoped_ptr<TiledLayerImpl> createLayer(const gfx::Size& tileSize, const gfx:
:Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) |
| 35 { | 35 { |
| 36 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(&m_hostImpl, 1
); | 36 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(m_hostImpl.act
iveTree(), 1); |
| 37 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, bo
rderTexels); | 37 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, bo
rderTexels); |
| 38 tiler->setBounds(layerSize); | 38 tiler->setBounds(layerSize); |
| 39 layer->setTilingData(*tiler); | 39 layer->setTilingData(*tiler); |
| 40 layer->setSkipsDraw(false); | 40 layer->setSkipsDraw(false); |
| 41 layer->drawProperties().visible_content_rect = gfx::Rect(gfx::Point(), l
ayerSize); | 41 layer->drawProperties().visible_content_rect = gfx::Rect(gfx::Point(), l
ayerSize); |
| 42 layer->drawProperties().opacity = 1; | 42 layer->drawProperties().opacity = 1; |
| 43 layer->setBounds(layerSize); | 43 layer->setBounds(layerSize); |
| 44 layer->setContentBounds(layerSize); | 44 layer->setContentBounds(layerSize); |
| 45 layer->createRenderSurface(); | 45 layer->createRenderSurface(); |
| 46 layer->drawProperties().render_target = layer.get(); | 46 layer->drawProperties().render_target = layer.get(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 EXPECT_NE(0u, quad->resource_id) << quadString << i; | 226 EXPECT_NE(0u, quad->resource_id) << quadString << i; |
| 227 EXPECT_EQ(gfx::RectF(gfx::PointF(), tileSize), quad->tex_coord_rect) <<
quadString << i; | 227 EXPECT_EQ(gfx::RectF(gfx::PointF(), tileSize), quad->tex_coord_rect) <<
quadString << i; |
| 228 EXPECT_EQ(tileSize, quad->texture_size) << quadString << i; | 228 EXPECT_EQ(tileSize, quad->texture_size) << quadString << i; |
| 229 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaque_rect) << quadString << i; | 229 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaque_rect) << quadString << i; |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace | 233 } // namespace |
| 234 } // namespace cc | 234 } // namespace cc |
| OLD | NEW |