Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: cc/layer_tree_host_unittest.cc

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix shadowing Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 updateContentsScale(float idealContentsScale)
1230 {
1231 Layer::updateContentsScale(idealContentsScale);
1232 }
1227 1233
1228 private: 1234 private:
1229 explicit NoScaleContentLayer(ContentLayerClient* client) 1235 explicit NoScaleContentLayer(ContentLayerClient* client)
1230 : ContentLayer(client) { } 1236 : ContentLayer(client) { }
1231 virtual ~NoScaleContentLayer() { } 1237 virtual ~NoScaleContentLayer() { }
1232 }; 1238 };
1233 1239
1234 // Ensures that when opacity is being animated, this value does not cause the su btree to be skipped. 1240 // Ensures that when opacity is being animated, this value does not cause the su btree to be skipped.
1235 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost Test { 1241 class LayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public LayerTreeHost Test {
1236 public: 1242 public:
(...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after
3379 LayerTreeSettings settings; 3385 LayerTreeSettings settings;
3380 settings.maxPartialTextureUpdates = 4; 3386 settings.maxPartialTextureUpdates = 4;
3381 3387
3382 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>()); 3388 scoped_ptr<LayerTreeHost> host = LayerTreeHost::create(&client, settings, sc oped_ptr<Thread>());
3383 EXPECT_TRUE(host->initializeRendererIfNeeded()); 3389 EXPECT_TRUE(host->initializeRendererIfNeeded());
3384 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates); 3390 EXPECT_EQ(0u, host->settings().maxPartialTextureUpdates);
3385 } 3391 }
3386 3392
3387 } // namespace 3393 } // namespace
3388 } // namespace cc 3394 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698