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/quad_culler.h" | 5 #include "cc/quad_culler.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/math_util.h" | 9 #include "cc/math_util.h" |
10 #include "cc/occlusion_tracker.h" | 10 #include "cc/occlusion_tracker.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 class QuadCullerTest : public testing::Test | 41 class QuadCullerTest : public testing::Test |
42 { | 42 { |
43 public: | 43 public: |
44 QuadCullerTest() | 44 QuadCullerTest() |
45 : m_hostImpl(&m_proxy) | 45 : m_hostImpl(&m_proxy) |
46 { | 46 { |
47 } | 47 } |
48 | 48 |
49 scoped_ptr<TiledLayerImpl> makeLayer(TiledLayerImpl* parent, const gfx::Tran
sform& drawTransform, const gfx::Rect& layerRect, float opacity, bool opaque, co
nst gfx::Rect& layerOpaqueRect, std::vector<LayerImpl*>& surfaceLayerList) | 49 scoped_ptr<TiledLayerImpl> makeLayer(TiledLayerImpl* parent, const gfx::Tran
sform& drawTransform, const gfx::Rect& layerRect, float opacity, bool opaque, co
nst gfx::Rect& layerOpaqueRect, std::vector<LayerImpl*>& surfaceLayerList) |
50 { | 50 { |
51 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(&m_hostImpl, 1
); | 51 scoped_ptr<TiledLayerImpl> layer = TiledLayerImpl::create(m_hostImpl.act
iveTree(), 1); |
52 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(gfx::Size(10
0, 100), LayerTilingData::NoBorderTexels); | 52 scoped_ptr<LayerTilingData> tiler = LayerTilingData::create(gfx::Size(10
0, 100), LayerTilingData::NoBorderTexels); |
53 tiler->setBounds(layerRect.size()); | 53 tiler->setBounds(layerRect.size()); |
54 layer->setTilingData(*tiler); | 54 layer->setTilingData(*tiler); |
55 layer->setSkipsDraw(false); | 55 layer->setSkipsDraw(false); |
56 layer->drawProperties().target_space_transform = drawTransform; | 56 layer->drawProperties().target_space_transform = drawTransform; |
57 layer->drawProperties().screen_space_transform = drawTransform; | 57 layer->drawProperties().screen_space_transform = drawTransform; |
58 layer->drawProperties().visible_content_rect = layerRect; | 58 layer->drawProperties().visible_content_rect = layerRect; |
59 layer->drawProperties().opacity = opacity; | 59 layer->drawProperties().opacity = opacity; |
60 layer->setContentsOpaque(opaque); | 60 layer->setContentsOpaque(opaque); |
61 layer->setBounds(layerRect.size()); | 61 layer->setBounds(layerRect.size()); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 appendQuads(quadList, sharedStateList, childLayer.get(), it, occlusionTracke
r); | 472 appendQuads(quadList, sharedStateList, childLayer.get(), it, occlusionTracke
r); |
473 appendQuads(quadList, sharedStateList, rootLayer.get(), it, occlusionTracker
); | 473 appendQuads(quadList, sharedStateList, rootLayer.get(), it, occlusionTracker
); |
474 EXPECT_EQ(quadList.size(), 9u); | 474 EXPECT_EQ(quadList.size(), 9u); |
475 EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 0, 1); | 475 EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnOpaque(), 0, 1); |
476 EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0,
1); | 476 EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsDrawnTranslucent(), 0,
1); |
477 EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0,
1); | 477 EXPECT_NEAR(occlusionTracker.overdrawMetrics().pixelsCulledForDrawing(), 0,
1); |
478 } | 478 } |
479 | 479 |
480 } // namespace | 480 } // namespace |
481 } // namespace cc | 481 } // namespace cc |
OLD | NEW |