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 didUpdateBounds() OVERRIDE |
danakj
2012/12/14 22:58:41
Same here?
enne (OOO)
2012/12/14 23:06:02
Done.
| |
1225 virtual float contentsScaleX() const OVERRIDE { return 1.0; } | 1225 { |
1226 virtual float contentsScaleY() const OVERRIDE { return 1.0; } | 1226 Layer::didUpdateBounds(); |
1227 } | |
1228 | |
1229 virtual void calculateContentsScale( | |
1230 float idealContentsScale, | |
1231 float* contentsScaleX, | |
1232 float* contentsScaleY, | |
1233 gfx::Size* contentBounds) OVERRIDE | |
1234 { | |
1235 Layer::calculateContentsScale( | |
1236 idealContentsScale, | |
1237 contentsScaleX, | |
1238 contentsScaleY, | |
1239 contentBounds); | |
1240 } | |
1227 | 1241 |
1228 private: | 1242 private: |
1229 explicit NoScaleContentLayer(ContentLayerClient* client) | 1243 explicit NoScaleContentLayer(ContentLayerClient* client) |
1230 : ContentLayer(client) { } | 1244 : ContentLayer(client) { } |
1231 virtual ~NoScaleContentLayer() { } | 1245 virtual ~NoScaleContentLayer() { } |
1232 }; | 1246 }; |
1233 | 1247 |
1234 // Ensures that when opacity is being animated, this value does not cause the su btree to be skipped. | 1248 // Ensures that when opacity is being animated, this value does not cause the su btree to be skipped. |
1235 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost Test { | 1249 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost Test { |
1236 public: | 1250 public: |
(...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3379 LayerTreeSettings settings; | 3393 LayerTreeSettings settings; |
3380 settings.maxPartialTextureUpdates = 4; | 3394 settings.maxPartialTextureUpdates = 4; |
3381 | 3395 |
3382 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>()); | 3396 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>()); |
3383 EXPECT_TRUE(host->initializeRendererIfNeeded()); | 3397 EXPECT_TRUE(host->initializeRendererIfNeeded()); |
3384 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); | 3398 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); |
3385 } | 3399 } |
3386 | 3400 |
3387 } // namespace | 3401 } // namespace |
3388 } // namespace cc | 3402 } // namespace cc |
OLD | NEW |