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 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 | 1213 |
1214 TEST_F(LayerTreeHostTestOpacityChange, runMultiThread) | 1214 TEST_F(LayerTreeHostTestOpacityChange, runMultiThread) |
1215 { | 1215 { |
1216 runTest(true); | 1216 runTest(true); |
1217 } | 1217 } |
1218 | 1218 |
1219 class NoScaleContentLayer : public ContentLayer { | 1219 class NoScaleContentLayer : public ContentLayer { |
1220 public: | 1220 public: |
1221 static scoped_refptr<NoScaleContentLayer> create(ContentLayerClient* client)
{ return make_scoped_refptr(new NoScaleContentLayer(client)); } | 1221 static scoped_refptr<NoScaleContentLayer> create(ContentLayerClient* client)
{ return make_scoped_refptr(new NoScaleContentLayer(client)); } |
1222 | 1222 |
1223 virtual gfx::Size contentBounds() const OVERRIDE { return bounds(); } | 1223 virtual void didUpdateBounds() OVERRIDE |
1224 virtual float contentsScaleX() const OVERRIDE { return 1.0; } | 1224 { |
1225 virtual float contentsScaleY() const OVERRIDE { return 1.0; } | 1225 Layer::didUpdateBounds(); |
| 1226 } |
| 1227 |
| 1228 virtual void setIdealContentsScale(float idealContentsScale) |
| 1229 { |
| 1230 Layer::setIdealContentsScale(idealContentsScale); |
| 1231 } |
1226 | 1232 |
1227 private: | 1233 private: |
1228 explicit NoScaleContentLayer(ContentLayerClient* client) | 1234 explicit NoScaleContentLayer(ContentLayerClient* client) |
1229 : ContentLayer(client) { } | 1235 : ContentLayer(client) { } |
1230 virtual ~NoScaleContentLayer() { } | 1236 virtual ~NoScaleContentLayer() { } |
1231 }; | 1237 }; |
1232 | 1238 |
1233 // Ensures that when opacity is being animated, this value does not cause the su
btree to be skipped. | 1239 // Ensures that when opacity is being animated, this value does not cause the su
btree to be skipped. |
1234 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost
Test { | 1240 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost
Test { |
1235 public: | 1241 public: |
(...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3378 LayerTreeSettings settings; | 3384 LayerTreeSettings settings; |
3379 settings.maxPartialTextureUpdates = 4; | 3385 settings.maxPartialTextureUpdates = 4; |
3380 | 3386 |
3381 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc
oped_ptr<Thread>()); | 3387 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc
oped_ptr<Thread>()); |
3382 EXPECT_TRUE(host->initializeRendererIfNeeded()); | 3388 EXPECT_TRUE(host->initializeRendererIfNeeded()); |
3383 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); | 3389 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); |
3384 } | 3390 } |
3385 | 3391 |
3386 } // namespace | 3392 } // namespace |
3387 } // namespace cc | 3393 } // namespace cc |
OLD | NEW |