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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCRenderSurface.h" | 7 #include "CCRenderSurface.h" |
8 | 8 |
9 #include "CCAppendQuadsData.h" | 9 #include "CCAppendQuadsData.h" |
10 #include "CCLayerImpl.h" | 10 #include "CCLayerImpl.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 OwnPtr<CCLayerImpl> dummyMask = CCLayerImpl::create(1); | 64 OwnPtr<CCLayerImpl> dummyMask = CCLayerImpl::create(1); |
65 WebTransformationMatrix dummyMatrix; | 65 WebTransformationMatrix dummyMatrix; |
66 dummyMatrix.translate(1.0, 2.0); | 66 dummyMatrix.translate(1.0, 2.0); |
67 | 67 |
68 // The rest of the surface properties are either internal and should not cau
se change, | 68 // The rest of the surface properties are either internal and should not cau
se change, |
69 // or they are already accounted for by the owninglayer->layerPropertyChange
d(). | 69 // or they are already accounted for by the owninglayer->layerPropertyChange
d(). |
70 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setDrawOpacity(0.5)
); | 70 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setDrawOpacity(0.5)
); |
71 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setDrawTransform(du
mmyMatrix)); | 71 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setDrawTransform(du
mmyMatrix)); |
72 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setReplicaDrawTrans
form(dummyMatrix)); | 72 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->setReplicaDrawTrans
form(dummyMatrix)); |
73 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->clearLayerList()); | 73 EXECUTE_AND_VERIFY_SURFACE_DID_NOT_CHANGE(renderSurface->clearLayerLists()); |
74 } | 74 } |
75 | 75 |
76 TEST(CCRenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState) | 76 TEST(CCRenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState) |
77 { | 77 { |
78 // This will fake that we are on the correct thread for testing purposes. | 78 // This will fake that we are on the correct thread for testing purposes. |
79 DebugScopedSetImplThread setImplThread; | 79 DebugScopedSetImplThread setImplThread; |
80 | 80 |
81 OwnPtr<CCLayerImpl> rootLayer = CCLayerImpl::create(1); | 81 OwnPtr<CCLayerImpl> rootLayer = CCLayerImpl::create(1); |
82 | 82 |
83 OwnPtr<CCLayerImpl> owningLayer = CCLayerImpl::create(2); | 83 OwnPtr<CCLayerImpl> owningLayer = CCLayerImpl::create(2); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 ASSERT_EQ(1u, passSink.renderPasses().size()); | 157 ASSERT_EQ(1u, passSink.renderPasses().size()); |
158 CCRenderPass* pass = passSink.renderPasses()[0]; | 158 CCRenderPass* pass = passSink.renderPasses()[0]; |
159 | 159 |
160 EXPECT_EQ(CCRenderPass::Id(2, 0), pass->id()); | 160 EXPECT_EQ(CCRenderPass::Id(2, 0), pass->id()); |
161 EXPECT_EQ(contentRect, pass->outputRect()); | 161 EXPECT_EQ(contentRect, pass->outputRect()); |
162 EXPECT_EQ(origin, pass->transformToRootTarget()); | 162 EXPECT_EQ(origin, pass->transformToRootTarget()); |
163 } | 163 } |
164 | 164 |
165 } // namespace | 165 } // namespace |
OLD | NEW |