| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/tiled_layer_impl.h" | 7 #include "cc/tiled_layer_impl.h" |
| 8 | 8 |
| 9 #include "cc/append_quads_data.h" | 9 #include "cc/append_quads_data.h" |
| 10 #include "cc/layer_tiling_data.h" | 10 #include "cc/layer_tiling_data.h" |
| 11 #include "cc/single_thread_proxy.h" | 11 #include "cc/single_thread_proxy.h" |
| 12 #include "cc/test/layer_test_common.h" | 12 #include "cc/test/layer_test_common.h" |
| 13 #include "cc/test/mock_quad_culler.h" | 13 #include "cc/test/mock_quad_culler.h" |
| 14 #include "cc/tile_draw_quad.h" | 14 #include "cc/tile_draw_quad.h" |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 using namespace cc; | |
| 19 using namespace LayerTestCommon; | 18 using namespace LayerTestCommon; |
| 20 | 19 |
| 20 namespace cc { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Create a default tiled layer with textures for all tiles and a default | 23 // Create a default tiled layer with textures for all tiles and a default |
| 24 // visibility of the entire layer size. | 24 // visibility of the entire layer size. |
| 25 static scoped_ptr<TiledLayerImpl> createLayer(const gfx::Size& tileSize, const g
fx::Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) | 25 static scoped_ptr<TiledLayerImpl> createLayer(const gfx::Size& tileSize, const g
fx::Size& layerSize, LayerTilingData::BorderTexelOption borderTexels) |
| 26 { | 26 { |
| 27 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(1); | 27 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(1); |
| 28 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, border
Texels); | 28 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(tileSize, border
Texels); |
| 29 tiler->setBounds(layerSize); | 29 tiler->setBounds(layerSize); |
| 30 layer->setTilingData(*tiler); | 30 layer->setTilingData(*tiler); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 getQuads(quads, sharedStates, tileSize, layerSize, LayerTilingData::NoBorder
Texels, gfx::Rect(gfx::Point(), layerSize)); | 220 getQuads(quads, sharedStates, tileSize, layerSize, LayerTilingData::NoBorder
Texels, gfx::Rect(gfx::Point(), layerSize)); |
| 221 | 221 |
| 222 for (size_t i = 0; i < quads.size(); ++i) { | 222 for (size_t i = 0; i < quads.size(); ++i) { |
| 223 ASSERT_EQ(quads[i]->material(), DrawQuad::TiledContent) << quadString <<
i; | 223 ASSERT_EQ(quads[i]->material(), DrawQuad::TiledContent) << quadString <<
i; |
| 224 TileDrawQuad* quad = static_cast<TileDrawQuad*>(quads[i]); | 224 TileDrawQuad* quad = static_cast<TileDrawQuad*>(quads[i]); |
| 225 | 225 |
| 226 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i; | 226 EXPECT_EQ(gfx::Rect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i; |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // anonymous namespace | 230 } // namespace |
| 231 } // namespace cc |
| OLD | NEW |