OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "CCRenderPass.h" | 7 #include "CCRenderPass.h" |
8 | 8 |
9 #include "CCCheckerboardDrawQuad.h" | 9 #include "CCCheckerboardDrawQuad.h" |
10 #include "CCGeometryTestUtils.h" | 10 #include "CCGeometryTestUtils.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 pass->setDamageRect(damageRect); | 60 pass->setDamageRect(damageRect); |
61 pass->setHasTransparentBackground(hasTransparentBackground); | 61 pass->setHasTransparentBackground(hasTransparentBackground); |
62 pass->setHasOcclusionFromOutsideTargetSurface(hasOcclusionFromOutsideTargetS
urface); | 62 pass->setHasOcclusionFromOutsideTargetSurface(hasOcclusionFromOutsideTargetS
urface); |
63 pass->setFilters(filters); | 63 pass->setFilters(filters); |
64 pass->setBackgroundFilters(backgroundFilters); | 64 pass->setBackgroundFilters(backgroundFilters); |
65 | 65 |
66 // Stick a quad in the pass, this should not get copied. | 66 // Stick a quad in the pass, this should not get copied. |
67 CCTestRenderPass* testPass = static_cast<CCTestRenderPass*>(pass.get()); | 67 CCTestRenderPass* testPass = static_cast<CCTestRenderPass*>(pass.get()); |
68 testPass->sharedQuadStateList().append(CCSharedQuadState::create(WebTransfor
mationMatrix(), IntRect(), IntRect(), 1, false)); | 68 testPass->sharedQuadStateList().append(CCSharedQuadState::create(WebTransfor
mationMatrix(), IntRect(), IntRect(), 1, false)); |
69 testPass->quadList().append(CCCheckerboardDrawQuad::create(testPass->sharedQ
uadStateList().last().get(), IntRect())); | 69 testPass->quadList().append(CCCheckerboardDrawQuad::create(testPass->sharedQ
uadStateList().last(), IntRect())); |
70 | 70 |
71 CCRenderPass::Id newId(63, 4); | 71 CCRenderPass::Id newId(63, 4); |
72 | 72 |
73 OwnPtr<CCRenderPass> copy(pass->copy(newId)); | 73 OwnPtr<CCRenderPass> copy(pass->copy(newId)); |
74 EXPECT_EQ(newId, copy->id()); | 74 EXPECT_EQ(newId, copy->id()); |
75 EXPECT_RECT_EQ(pass->outputRect(), copy->outputRect()); | 75 EXPECT_RECT_EQ(pass->outputRect(), copy->outputRect()); |
76 EXPECT_EQ(pass->transformToRootTarget(), copy->transformToRootTarget()); | 76 EXPECT_EQ(pass->transformToRootTarget(), copy->transformToRootTarget()); |
77 EXPECT_RECT_EQ(pass->damageRect(), copy->damageRect()); | 77 EXPECT_RECT_EQ(pass->damageRect(), copy->damageRect()); |
78 EXPECT_EQ(pass->hasTransparentBackground(), copy->hasTransparentBackground()
); | 78 EXPECT_EQ(pass->hasTransparentBackground(), copy->hasTransparentBackground()
); |
79 EXPECT_EQ(pass->hasOcclusionFromOutsideTargetSurface(), copy->hasOcclusionFr
omOutsideTargetSurface()); | 79 EXPECT_EQ(pass->hasOcclusionFromOutsideTargetSurface(), copy->hasOcclusionFr
omOutsideTargetSurface()); |
80 EXPECT_EQ(pass->filters(), copy->filters()); | 80 EXPECT_EQ(pass->filters(), copy->filters()); |
81 EXPECT_EQ(pass->backgroundFilters(), copy->backgroundFilters()); | 81 EXPECT_EQ(pass->backgroundFilters(), copy->backgroundFilters()); |
82 EXPECT_EQ(0u, copy->quadList().size()); | 82 EXPECT_EQ(0u, copy->quadList().size()); |
83 | 83 |
84 EXPECT_EQ(sizeof(CCRenderPassSize), sizeof(CCRenderPass)); | 84 EXPECT_EQ(sizeof(CCRenderPassSize), sizeof(CCRenderPass)); |
85 } | 85 } |
86 | 86 |
87 } // namespace | 87 } // namespace |
OLD | NEW |