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

Side by Side Diff: cc/CCRenderPassTest.cpp

Issue 10979010: Remove WTF HashMap and PassOwnPtr dependencies for CCRenderPass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/CCRenderPassSink.h ('k') | cc/CCRenderSurface.cpp » ('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 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 28 matching lines...) Expand all
39 WebKit::WebFilterOperations m_filters; 39 WebKit::WebFilterOperations m_filters;
40 WebKit::WebFilterOperations m_backgroundFilters; 40 WebKit::WebFilterOperations m_backgroundFilters;
41 }; 41 };
42 42
43 TEST(CCRenderPassTest, copyShouldBeIdenticalExceptIdAndQuads) 43 TEST(CCRenderPassTest, copyShouldBeIdenticalExceptIdAndQuads)
44 { 44 {
45 CCRenderPass::Id id(3, 2); 45 CCRenderPass::Id id(3, 2);
46 IntRect outputRect(45, 22, 120, 13); 46 IntRect outputRect(45, 22, 120, 13);
47 WebTransformationMatrix transformToRoot(1, 0.5, 0.5, -0.5, -1, 0); 47 WebTransformationMatrix transformToRoot(1, 0.5, 0.5, -0.5, -1, 0);
48 48
49 OwnPtr<CCRenderPass> pass(CCRenderPass::create(id, outputRect, transformToRo ot)); 49 scoped_ptr<CCRenderPass> pass = CCRenderPass::create(id, outputRect, transfo rmToRoot);
50 50
51 IntRect damageRect(56, 123, 19, 43); 51 IntRect damageRect(56, 123, 19, 43);
52 bool hasTransparentBackground = true; 52 bool hasTransparentBackground = true;
53 bool hasOcclusionFromOutsideTargetSurface = true; 53 bool hasOcclusionFromOutsideTargetSurface = true;
54 WebFilterOperations filters; 54 WebFilterOperations filters;
55 WebFilterOperations backgroundFilters; 55 WebFilterOperations backgroundFilters;
56 56
57 filters.append(WebFilterOperation::createGrayscaleFilter(0.2f)); 57 filters.append(WebFilterOperation::createGrayscaleFilter(0.2f));
58 backgroundFilters.append(WebFilterOperation::createInvertFilter(0.2f)); 58 backgroundFilters.append(WebFilterOperation::createInvertFilter(0.2f));
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(), 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 scoped_ptr<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
OLDNEW
« no previous file with comments | « cc/CCRenderPassSink.h ('k') | cc/CCRenderSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698