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

Side by Side Diff: cc/layer_tree_host_common_unittest.cc

Issue 11192030: cc: Switch to Chromium DCHECKs LOGs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseonenne Created 8 years, 2 months 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
« no previous file with comments | « cc/layer_tree_host_common.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "CCLayerTreeHostCommon.h" 7 #include "CCLayerTreeHostCommon.h"
8 8
9 #include "CCLayerAnimationController.h" 9 #include "CCLayerAnimationController.h"
10 #include "CCLayerImpl.h" 10 #include "CCLayerImpl.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 void executeCalculateDrawTransformsAndVisibility(LayerChromium* rootLayer, float deviceScaleFactor = 1) 53 void executeCalculateDrawTransformsAndVisibility(LayerChromium* rootLayer, float deviceScaleFactor = 1)
54 { 54 {
55 WebTransformationMatrix identityMatrix; 55 WebTransformationMatrix identityMatrix;
56 std::vector<scoped_refptr<LayerChromium> > dummyRenderSurfaceLayerList; 56 std::vector<scoped_refptr<LayerChromium> > dummyRenderSurfaceLayerList;
57 int dummyMaxTextureSize = 512; 57 int dummyMaxTextureSize = 512;
58 IntSize deviceViewportSize = IntSize(rootLayer->bounds().width() * deviceSca leFactor, rootLayer->bounds().height() * deviceScaleFactor); 58 IntSize deviceViewportSize = IntSize(rootLayer->bounds().width() * deviceSca leFactor, rootLayer->bounds().height() * deviceScaleFactor);
59 59
60 // We are probably not testing what is intended if the rootLayer bounds are empty. 60 // We are probably not testing what is intended if the rootLayer bounds are empty.
61 ASSERT(!rootLayer->bounds().isEmpty()); 61 DCHECK(!rootLayer->bounds().isEmpty());
62 CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize , deviceScaleFactor, dummyMaxTextureSize, dummyRenderSurfaceLayerList); 62 CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize , deviceScaleFactor, dummyMaxTextureSize, dummyRenderSurfaceLayerList);
63 } 63 }
64 64
65 void executeCalculateDrawTransformsAndVisibility(CCLayerImpl* rootLayer, float d eviceScaleFactor = 1) 65 void executeCalculateDrawTransformsAndVisibility(CCLayerImpl* rootLayer, float d eviceScaleFactor = 1)
66 { 66 {
67 // Note: this version skips layer sorting. 67 // Note: this version skips layer sorting.
68 68
69 WebTransformationMatrix identityMatrix; 69 WebTransformationMatrix identityMatrix;
70 std::vector<CCLayerImpl*> dummyRenderSurfaceLayerList; 70 std::vector<CCLayerImpl*> dummyRenderSurfaceLayerList;
71 int dummyMaxTextureSize = 512; 71 int dummyMaxTextureSize = 512;
72 IntSize deviceViewportSize = IntSize(rootLayer->bounds().width() * deviceSca leFactor, rootLayer->bounds().height() * deviceScaleFactor); 72 IntSize deviceViewportSize = IntSize(rootLayer->bounds().width() * deviceSca leFactor, rootLayer->bounds().height() * deviceScaleFactor);
73 73
74 // We are probably not testing what is intended if the rootLayer bounds are empty. 74 // We are probably not testing what is intended if the rootLayer bounds are empty.
75 ASSERT(!rootLayer->bounds().isEmpty()); 75 DCHECK(!rootLayer->bounds().isEmpty());
76 CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize , deviceScaleFactor, 0, dummyMaxTextureSize, dummyRenderSurfaceLayerList); 76 CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSize , deviceScaleFactor, 0, dummyMaxTextureSize, dummyRenderSurfaceLayerList);
77 } 77 }
78 78
79 WebTransformationMatrix remove3DComponentOfMatrix(const WebTransformationMatrix& mat) 79 WebTransformationMatrix remove3DComponentOfMatrix(const WebTransformationMatrix& mat)
80 { 80 {
81 WebTransformationMatrix ret = mat; 81 WebTransformationMatrix ret = mat;
82 ret.setM13(0); 82 ret.setM13(0);
83 ret.setM23(0); 83 ret.setM23(0);
84 ret.setM31(0); 84 ret.setM31(0);
85 ret.setM32(0); 85 ret.setM32(0);
(...skipping 3490 matching lines...) Expand 10 before | Expand all | Expand 10 after
3576 int nonexistentId = -1; 3576 int nonexistentId = -1;
3577 EXPECT_EQ(root, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), root-> id())); 3577 EXPECT_EQ(root, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), root-> id()));
3578 EXPECT_EQ(child, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), child ->id())); 3578 EXPECT_EQ(child, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), child ->id()));
3579 EXPECT_EQ(grandChild, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), grandChild->id())); 3579 EXPECT_EQ(grandChild, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), grandChild->id()));
3580 EXPECT_EQ(maskLayer, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), m askLayer->id())); 3580 EXPECT_EQ(maskLayer, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), m askLayer->id()));
3581 EXPECT_EQ(replicaLayer, CCLayerTreeHostCommon::findLayerInSubtree(root.get() , replicaLayer->id())); 3581 EXPECT_EQ(replicaLayer, CCLayerTreeHostCommon::findLayerInSubtree(root.get() , replicaLayer->id()));
3582 EXPECT_EQ(0, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), nonexiste ntId)); 3582 EXPECT_EQ(0, CCLayerTreeHostCommon::findLayerInSubtree(root.get(), nonexiste ntId));
3583 } 3583 }
3584 3584
3585 } // namespace 3585 } // namespace
OLDNEW
« no previous file with comments | « cc/layer_tree_host_common.cc ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698