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 "cc/draw_quad.h" | 7 #include "cc/draw_quad.h" |
8 | 8 |
9 #include "cc/checkerboard_draw_quad.h" | 9 #include "cc/checkerboard_draw_quad.h" |
10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 EXPECT_EQ(textureFilter, copyQuad->textureFilter()); | 271 EXPECT_EQ(textureFilter, copyQuad->textureFilter()); |
272 EXPECT_EQ(swizzleContents, copyQuad->swizzleContents()); | 272 EXPECT_EQ(swizzleContents, copyQuad->swizzleContents()); |
273 EXPECT_EQ(leftEdgeAA, copyQuad->leftEdgeAA()); | 273 EXPECT_EQ(leftEdgeAA, copyQuad->leftEdgeAA()); |
274 EXPECT_EQ(topEdgeAA, copyQuad->topEdgeAA()); | 274 EXPECT_EQ(topEdgeAA, copyQuad->topEdgeAA()); |
275 EXPECT_EQ(rightEdgeAA, copyQuad->rightEdgeAA()); | 275 EXPECT_EQ(rightEdgeAA, copyQuad->rightEdgeAA()); |
276 EXPECT_EQ(bottomEdgeAA, copyQuad->bottomEdgeAA()); | 276 EXPECT_EQ(bottomEdgeAA, copyQuad->bottomEdgeAA()); |
277 } | 277 } |
278 | 278 |
279 TEST(DrawQuadTest, copyYUVVideoDrawQuad) | 279 TEST(DrawQuadTest, copyYUVVideoDrawQuad) |
280 { | 280 { |
| 281 gfx::SizeF texScale(0.75, 0.5); |
281 VideoLayerImpl::FramePlane yPlane; | 282 VideoLayerImpl::FramePlane yPlane; |
282 yPlane.resourceId = 45; | 283 yPlane.resourceId = 45; |
283 yPlane.size = gfx::Size(34, 23); | 284 yPlane.size = gfx::Size(34, 23); |
284 yPlane.format = 8; | 285 yPlane.format = 8; |
285 yPlane.visibleSize = gfx::Size(623, 235); | |
286 VideoLayerImpl::FramePlane uPlane; | 286 VideoLayerImpl::FramePlane uPlane; |
287 uPlane.resourceId = 532; | 287 uPlane.resourceId = 532; |
288 uPlane.size = gfx::Size(134, 16); | 288 uPlane.size = gfx::Size(134, 16); |
289 uPlane.format = 2; | 289 uPlane.format = 2; |
290 uPlane.visibleSize = gfx::Size(126, 27); | |
291 VideoLayerImpl::FramePlane vPlane; | 290 VideoLayerImpl::FramePlane vPlane; |
292 vPlane.resourceId = 4; | 291 vPlane.resourceId = 4; |
293 vPlane.size = gfx::Size(456, 486); | 292 vPlane.size = gfx::Size(456, 486); |
294 vPlane.format = 46; | 293 vPlane.format = 46; |
295 vPlane.visibleSize = gfx::Size(19, 45); | |
296 | 294 |
297 CREATE_SHARED_STATE(); | 295 CREATE_SHARED_STATE(); |
298 CREATE_QUAD_3(YUVVideoDrawQuad, yPlane, uPlane, vPlane); | 296 CREATE_QUAD_4(YUVVideoDrawQuad, texScale, yPlane, uPlane, vPlane); |
| 297 EXPECT_EQ(texScale, copyQuad->texScale()); |
299 EXPECT_EQ(yPlane.resourceId, copyQuad->yPlane().resourceId); | 298 EXPECT_EQ(yPlane.resourceId, copyQuad->yPlane().resourceId); |
300 EXPECT_EQ(yPlane.size, copyQuad->yPlane().size); | 299 EXPECT_EQ(yPlane.size, copyQuad->yPlane().size); |
301 EXPECT_EQ(yPlane.format, copyQuad->yPlane().format); | 300 EXPECT_EQ(yPlane.format, copyQuad->yPlane().format); |
302 EXPECT_EQ(yPlane.visibleSize, copyQuad->yPlane().visibleSize); | |
303 EXPECT_EQ(uPlane.resourceId, copyQuad->uPlane().resourceId); | 301 EXPECT_EQ(uPlane.resourceId, copyQuad->uPlane().resourceId); |
304 EXPECT_EQ(uPlane.size, copyQuad->uPlane().size); | 302 EXPECT_EQ(uPlane.size, copyQuad->uPlane().size); |
305 EXPECT_EQ(uPlane.format, copyQuad->uPlane().format); | 303 EXPECT_EQ(uPlane.format, copyQuad->uPlane().format); |
306 EXPECT_EQ(uPlane.visibleSize, copyQuad->uPlane().visibleSize); | |
307 EXPECT_EQ(vPlane.resourceId, copyQuad->vPlane().resourceId); | 304 EXPECT_EQ(vPlane.resourceId, copyQuad->vPlane().resourceId); |
308 EXPECT_EQ(vPlane.size, copyQuad->vPlane().size); | 305 EXPECT_EQ(vPlane.size, copyQuad->vPlane().size); |
309 EXPECT_EQ(vPlane.format, copyQuad->vPlane().format); | 306 EXPECT_EQ(vPlane.format, copyQuad->vPlane().format); |
310 EXPECT_EQ(vPlane.visibleSize, copyQuad->vPlane().visibleSize); | |
311 } | 307 } |
312 | 308 |
313 } // anonymous namespace | 309 } // anonymous namespace |
OLD | NEW |