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

Side by Side Diff: cc/CCTiledLayerImplTest.cpp

Issue 10940002: Add wrapper container for a vector of OwnPtr<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/CCSolidColorLayerImplTest.cpp ('k') | cc/LayerChromium.h » ('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 "CCTiledLayerImpl.h" 7 #include "CCTiledLayerImpl.h"
8 8
9 #include "CCAppendQuadsData.h" 9 #include "CCAppendQuadsData.h"
10 #include "CCLayerTestCommon.h" 10 #include "CCLayerTestCommon.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 DebugScopedSetImplThread scopedImplThread; 207 DebugScopedSetImplThread scopedImplThread;
208 208
209 IntSize tileSize(50, 50); 209 IntSize tileSize(50, 50);
210 IntSize layerSize(250, 250); 210 IntSize layerSize(250, 250);
211 CCQuadList quads; 211 CCQuadList quads;
212 CCSharedQuadStateList sharedStates; 212 CCSharedQuadStateList sharedStates;
213 getQuads(quads, sharedStates, tileSize, layerSize, CCLayerTilingData::NoBord erTexels, IntRect(IntPoint(), layerSize)); 213 getQuads(quads, sharedStates, tileSize, layerSize, CCLayerTilingData::NoBord erTexels, IntRect(IntPoint(), layerSize));
214 214
215 for (size_t i = 0; i < quads.size(); ++i) { 215 for (size_t i = 0; i < quads.size(); ++i) {
216 ASSERT_EQ(quads[i]->material(), CCDrawQuad::TiledContent) << quadString << i; 216 ASSERT_EQ(quads[i]->material(), CCDrawQuad::TiledContent) << quadString << i;
217 CCTileDrawQuad* quad = static_cast<CCTileDrawQuad*>(quads[i].get()); 217 CCTileDrawQuad* quad = static_cast<CCTileDrawQuad*>(quads[i]);
218 218
219 EXPECT_NE(quad->resourceId(), 0u) << quadString << i; 219 EXPECT_NE(quad->resourceId(), 0u) << quadString << i;
220 EXPECT_EQ(quad->textureOffset(), IntPoint()) << quadString << i; 220 EXPECT_EQ(quad->textureOffset(), IntPoint()) << quadString << i;
221 EXPECT_EQ(quad->textureSize(), tileSize) << quadString << i; 221 EXPECT_EQ(quad->textureSize(), tileSize) << quadString << i;
222 EXPECT_EQ(IntRect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i; 222 EXPECT_EQ(IntRect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i;
223 } 223 }
224 } 224 }
225 225
226 TEST(CCTiledLayerImplTest, tileOpaqueRectForLayerNoBorders) 226 TEST(CCTiledLayerImplTest, tileOpaqueRectForLayerNoBorders)
227 { 227 {
228 DebugScopedSetImplThread scopedImplThread; 228 DebugScopedSetImplThread scopedImplThread;
229 229
230 IntSize tileSize(50, 50); 230 IntSize tileSize(50, 50);
231 IntSize layerSize(250, 250); 231 IntSize layerSize(250, 250);
232 CCQuadList quads; 232 CCQuadList quads;
233 CCSharedQuadStateList sharedStates; 233 CCSharedQuadStateList sharedStates;
234 getQuads(quads, sharedStates, tileSize, layerSize, CCLayerTilingData::NoBord erTexels, IntRect(IntPoint(), layerSize)); 234 getQuads(quads, sharedStates, tileSize, layerSize, CCLayerTilingData::NoBord erTexels, IntRect(IntPoint(), layerSize));
235 235
236 for (size_t i = 0; i < quads.size(); ++i) { 236 for (size_t i = 0; i < quads.size(); ++i) {
237 ASSERT_EQ(quads[i]->material(), CCDrawQuad::TiledContent) << quadString << i; 237 ASSERT_EQ(quads[i]->material(), CCDrawQuad::TiledContent) << quadString << i;
238 CCTileDrawQuad* quad = static_cast<CCTileDrawQuad*>(quads[i].get()); 238 CCTileDrawQuad* quad = static_cast<CCTileDrawQuad*>(quads[i]);
239 239
240 EXPECT_EQ(IntRect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i; 240 EXPECT_EQ(IntRect(0, 0, 1, 1), quad->opaqueRect()) << quadString << i;
241 } 241 }
242 } 242 }
243 243
244 } // namespace 244 } // namespace
OLDNEW
« no previous file with comments | « cc/CCSolidColorLayerImplTest.cpp ('k') | cc/LayerChromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698