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

Side by Side Diff: cc/layer_tree_host_unittest.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/layer_tree_host.h" 7 #include "cc/layer_tree_host.h"
8 8
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "cc/content_layer.h" 10 #include "cc/content_layer.h"
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 bool drawsContent() const { return true; } 1248 bool drawsContent() const { return true; }
1249 MOCK_CONST_METHOD0(preserves3D, bool()); 1249 MOCK_CONST_METHOD0(preserves3D, bool());
1250 void paintContents(SkCanvas*, const IntRect&, FloatRect&) OVERRIDE { } 1250 void paintContents(SkCanvas*, const IntRect&, FloatRect&) OVERRIDE { }
1251 void notifySyncRequired() { } 1251 void notifySyncRequired() { }
1252 }; 1252 };
1253 1253
1254 class NoScaleContentLayer : public ContentLayer { 1254 class NoScaleContentLayer : public ContentLayer {
1255 public: 1255 public:
1256 static scoped_refptr<NoScaleContentLayer> create(ContentLayerClient* client) { return make_scoped_refptr(new NoScaleContentLayer(client)); } 1256 static scoped_refptr<NoScaleContentLayer> create(ContentLayerClient* client) { return make_scoped_refptr(new NoScaleContentLayer(client)); }
1257 1257
1258 virtual bool needsContentsScale() const OVERRIDE { return false; } 1258 virtual IntSize contentBounds() const OVERRIDE { return bounds(); }
1259 virtual float contentsScaleX() const OVERRIDE { return 1.0; }
1260 virtual float contentsScaleY() const OVERRIDE { return 1.0; }
1259 1261
1260 private: 1262 private:
1261 explicit NoScaleContentLayer(ContentLayerClient* client) 1263 explicit NoScaleContentLayer(ContentLayerClient* client)
1262 : ContentLayer(client) { } 1264 : ContentLayer(client) { }
1263 virtual ~NoScaleContentLayer() { } 1265 virtual ~NoScaleContentLayer() { }
1264 }; 1266 };
1265 1267
1266 class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers : public LayerTr eeHostTest { 1268 class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers : public LayerTr eeHostTest {
1267 public: 1269 public:
1268 1270
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 int m_numCommitComplete; 3179 int m_numCommitComplete;
3178 int m_numDrawLayers; 3180 int m_numDrawLayers;
3179 }; 3181 };
3180 3182
3181 TEST_F(LayerTreeHostTestContinuousAnimate, runMultiThread) 3183 TEST_F(LayerTreeHostTestContinuousAnimate, runMultiThread)
3182 { 3184 {
3183 runTest(true); 3185 runTest(true);
3184 } 3186 }
3185 3187
3186 } // namespace 3188 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698