OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
6 | 6 |
7 #include "base/synchronization/lock.h" | 7 #include "base/synchronization/lock.h" |
8 #include "cc/content_layer.h" | 8 #include "cc/content_layer.h" |
9 #include "cc/content_layer_client.h" | 9 #include "cc/content_layer_client.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 | 1214 |
1215 TEST_F(LayerTreeHostTestOpacityChange, runMultiThread) | 1215 TEST_F(LayerTreeHostTestOpacityChange, runMultiThread) |
1216 { | 1216 { |
1217 runTest(true); | 1217 runTest(true); |
1218 } | 1218 } |
1219 | 1219 |
1220 class NoScaleContentLayer : public ContentLayer { | 1220 class NoScaleContentLayer : public ContentLayer { |
1221 public: | 1221 public: |
1222 static scoped_refptr<NoScaleContentLayer> create(ContentLayerClient* client)
{ return make_scoped_refptr(new NoScaleContentLayer(client)); } | 1222 static scoped_refptr<NoScaleContentLayer> create(ContentLayerClient* client)
{ return make_scoped_refptr(new NoScaleContentLayer(client)); } |
1223 | 1223 |
1224 virtual gfx::Size contentBounds() const OVERRIDE { return bounds(); } | 1224 virtual void calculateContentsScale( |
1225 virtual float contentsScaleX() const OVERRIDE { return 1.0; } | 1225 float idealContentsScale, |
1226 virtual float contentsScaleY() const OVERRIDE { return 1.0; } | 1226 float* contentsScaleX, |
| 1227 float* contentsScaleY, |
| 1228 gfx::Size* contentBounds) OVERRIDE |
| 1229 { |
| 1230 Layer::calculateContentsScale( |
| 1231 idealContentsScale, |
| 1232 contentsScaleX, |
| 1233 contentsScaleY, |
| 1234 contentBounds); |
| 1235 } |
1227 | 1236 |
1228 private: | 1237 private: |
1229 explicit NoScaleContentLayer(ContentLayerClient* client) | 1238 explicit NoScaleContentLayer(ContentLayerClient* client) |
1230 : ContentLayer(client) { } | 1239 : ContentLayer(client) { } |
1231 virtual ~NoScaleContentLayer() { } | 1240 virtual ~NoScaleContentLayer() { } |
1232 }; | 1241 }; |
1233 | 1242 |
1234 // Ensures that when opacity is being animated, this value does not cause the su
btree to be skipped. | 1243 // Ensures that when opacity is being animated, this value does not cause the su
btree to be skipped. |
1235 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost
Test { | 1244 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost
Test { |
1236 public: | 1245 public: |
(...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3379 LayerTreeSettings settings; | 3388 LayerTreeSettings settings; |
3380 settings.maxPartialTextureUpdates = 4; | 3389 settings.maxPartialTextureUpdates = 4; |
3381 | 3390 |
3382 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc
oped_ptr<Thread>()); | 3391 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc
oped_ptr<Thread>()); |
3383 EXPECT_TRUE(host->initializeRendererIfNeeded()); | 3392 EXPECT_TRUE(host->initializeRendererIfNeeded()); |
3384 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); | 3393 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); |
3385 } | 3394 } |
3386 | 3395 |
3387 } // namespace | 3396 } // namespace |
3388 } // namespace cc | 3397 } // namespace cc |
OLD | NEW |