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 "CCLayerImpl.h" | 10 #include "CCLayerImpl.h" |
10 #include "CCRenderPassSink.h" | 11 #include "CCRenderPassSink.h" |
11 #include "CCSharedQuadState.h" | 12 #include "CCSharedQuadState.h" |
12 #include "CCSingleThreadProxy.h" | 13 #include "CCSingleThreadProxy.h" |
13 #include "MockCCQuadCuller.h" | 14 #include "MockCCQuadCuller.h" |
14 #include <gmock/gmock.h> | 15 #include <gmock/gmock.h> |
15 #include <gtest/gtest.h> | 16 #include <gtest/gtest.h> |
16 #include <public/WebTransformationMatrix.h> | 17 #include <public/WebTransformationMatrix.h> |
17 | 18 |
18 using namespace WebCore; | 19 using namespace WebCore; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 origin.translate(30, 40); | 94 origin.translate(30, 40); |
94 | 95 |
95 renderSurface->setDrawTransform(origin); | 96 renderSurface->setDrawTransform(origin); |
96 renderSurface->setContentRect(contentRect); | 97 renderSurface->setContentRect(contentRect); |
97 renderSurface->setClipRect(clipRect); | 98 renderSurface->setClipRect(clipRect); |
98 renderSurface->setDrawOpacity(1); | 99 renderSurface->setDrawOpacity(1); |
99 | 100 |
100 CCQuadList quadList; | 101 CCQuadList quadList; |
101 CCSharedQuadStateList sharedStateList; | 102 CCSharedQuadStateList sharedStateList; |
102 MockCCQuadCuller mockQuadCuller(quadList, sharedStateList); | 103 MockCCQuadCuller mockQuadCuller(quadList, sharedStateList); |
| 104 CCAppendQuadsData appendQuadsData; |
103 | 105 |
104 bool forReplica = false; | 106 bool forReplica = false; |
105 renderSurface->appendQuads(mockQuadCuller, forReplica, 1); | 107 renderSurface->appendQuads(mockQuadCuller, appendQuadsData, forReplica, 2); |
106 | 108 |
107 ASSERT_EQ(1u, sharedStateList.size()); | 109 ASSERT_EQ(1u, sharedStateList.size()); |
108 CCSharedQuadState* sharedQuadState = sharedStateList[0].get(); | 110 CCSharedQuadState* sharedQuadState = sharedStateList[0].get(); |
109 | 111 |
110 EXPECT_EQ(30, sharedQuadState->quadTransform.m41()); | 112 EXPECT_EQ(30, sharedQuadState->quadTransform.m41()); |
111 EXPECT_EQ(40, sharedQuadState->quadTransform.m42()); | 113 EXPECT_EQ(40, sharedQuadState->quadTransform.m42()); |
112 EXPECT_EQ(contentRect, IntRect(sharedQuadState->visibleContentRect)); | 114 EXPECT_EQ(contentRect, IntRect(sharedQuadState->visibleContentRect)); |
113 EXPECT_EQ(1, sharedQuadState->opacity); | 115 EXPECT_EQ(1, sharedQuadState->opacity); |
114 EXPECT_FALSE(sharedQuadState->opaque); | 116 EXPECT_FALSE(sharedQuadState->opaque); |
115 } | 117 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 155 |
154 ASSERT_EQ(1u, passSink.renderPasses().size()); | 156 ASSERT_EQ(1u, passSink.renderPasses().size()); |
155 CCRenderPass* pass = passSink.renderPasses()[0].get(); | 157 CCRenderPass* pass = passSink.renderPasses()[0].get(); |
156 | 158 |
157 EXPECT_EQ(2, pass->id()); | 159 EXPECT_EQ(2, pass->id()); |
158 EXPECT_EQ(contentRect, pass->outputRect()); | 160 EXPECT_EQ(contentRect, pass->outputRect()); |
159 EXPECT_EQ(origin, pass->transformToRootTarget()); | 161 EXPECT_EQ(origin, pass->transformToRootTarget()); |
160 } | 162 } |
161 | 163 |
162 } // namespace | 164 } // namespace |
OLD | NEW |