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 "cc/draw_quad.h" | 5 #include "cc/draw_quad.h" |
6 | 6 |
7 #include "cc/checkerboard_draw_quad.h" | 7 #include "cc/checkerboard_draw_quad.h" |
8 #include "cc/debug_border_draw_quad.h" | 8 #include "cc/debug_border_draw_quad.h" |
9 #include "cc/io_surface_draw_quad.h" | 9 #include "cc/io_surface_draw_quad.h" |
10 #include "cc/math_util.h" | 10 #include "cc/math_util.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 EXPECT_EQ(filters, copyQuad->filters); | 322 EXPECT_EQ(filters, copyQuad->filters); |
323 EXPECT_EQ(filter, copyQuad->filter); | 323 EXPECT_EQ(filter, copyQuad->filter); |
324 EXPECT_EQ(background_filters, copyQuad->background_filters); | 324 EXPECT_EQ(background_filters, copyQuad->background_filters); |
325 } | 325 } |
326 | 326 |
327 TEST(DrawQuadTest, copySolidColorDrawQuad) | 327 TEST(DrawQuadTest, copySolidColorDrawQuad) |
328 { | 328 { |
329 SkColor color = 0x49494949; | 329 SkColor color = 0x49494949; |
330 CREATE_SHARED_STATE(); | 330 CREATE_SHARED_STATE(); |
331 | 331 |
332 CREATE_QUAD_1_NEW(SolidColorDrawQuad, color); | 332 CREATE_QUAD_2_NEW(SolidColorDrawQuad, DrawQuad::AntiAliasing(), color); |
333 EXPECT_EQ(DrawQuad::SOLID_COLOR, copyQuad->material); | 333 EXPECT_EQ(DrawQuad::SOLID_COLOR, copyQuad->material); |
334 EXPECT_EQ(color, copyQuad->color); | 334 EXPECT_EQ(color, copyQuad->color); |
335 | 335 |
336 CREATE_QUAD_1_ALL(SolidColorDrawQuad, color); | 336 CREATE_QUAD_2_ALL(SolidColorDrawQuad, DrawQuad::AntiAliasing(), color); |
337 EXPECT_EQ(DrawQuad::SOLID_COLOR, copyQuad->material); | 337 EXPECT_EQ(DrawQuad::SOLID_COLOR, copyQuad->material); |
338 EXPECT_EQ(color, copyQuad->color); | 338 EXPECT_EQ(color, copyQuad->color); |
339 } | 339 } |
340 | 340 |
341 TEST(DrawQuadTest, copyStreamVideoDrawQuad) | 341 TEST(DrawQuadTest, copyStreamVideoDrawQuad) |
342 { | 342 { |
343 gfx::Rect opaqueRect(3, 7, 10, 12); | 343 gfx::Rect opaqueRect(3, 7, 10, 12); |
344 unsigned textureId = 64; | 344 unsigned textureId = 64; |
345 gfx::Transform matrix = MathUtil::createGfxTransform(0.5, 1, 0.25, 0.75, 0,
1); | 345 gfx::Transform matrix = MathUtil::createGfxTransform(0.5, 1, 0.25, 0.75, 0,
1); |
346 CREATE_SHARED_STATE(); | 346 CREATE_SHARED_STATE(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 unsigned resourceId = 104; | 391 unsigned resourceId = 104; |
392 gfx::RectF texCoordRect(31, 12, 54, 20); | 392 gfx::RectF texCoordRect(31, 12, 54, 20); |
393 gfx::Size textureSize(85, 32); | 393 gfx::Size textureSize(85, 32); |
394 bool swizzleContents = true; | 394 bool swizzleContents = true; |
395 bool leftEdgeAA = true; | 395 bool leftEdgeAA = true; |
396 bool topEdgeAA = true; | 396 bool topEdgeAA = true; |
397 bool rightEdgeAA = false; | 397 bool rightEdgeAA = false; |
398 bool bottomEdgeAA = true; | 398 bool bottomEdgeAA = true; |
399 CREATE_SHARED_STATE(); | 399 CREATE_SHARED_STATE(); |
400 | 400 |
401 CREATE_QUAD_9_NEW(TileDrawQuad, opaqueRect, resourceId, texCoordRect, textur
eSize, swizzleContents, leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA); | 401 CREATE_QUAD_6_NEW(TileDrawQuad, opaqueRect, DrawQuad::AntiAliasing(leftEdgeA
A, topEdgeAA, rightEdgeAA, bottomEdgeAA), resourceId, texCoordRect, textureSize,
swizzleContents); |
402 EXPECT_EQ(DrawQuad::TILED_CONTENT, copyQuad->material); | 402 EXPECT_EQ(DrawQuad::TILED_CONTENT, copyQuad->material); |
403 EXPECT_RECT_EQ(opaqueRect, copyQuad->opaque_rect); | 403 EXPECT_RECT_EQ(opaqueRect, copyQuad->opaque_rect); |
404 EXPECT_EQ(resourceId, copyQuad->resource_id); | 404 EXPECT_EQ(resourceId, copyQuad->resource_id); |
405 EXPECT_EQ(texCoordRect, copyQuad->tex_coord_rect); | 405 EXPECT_EQ(texCoordRect, copyQuad->tex_coord_rect); |
406 EXPECT_EQ(textureSize, copyQuad->texture_size); | 406 EXPECT_EQ(textureSize, copyQuad->texture_size); |
407 EXPECT_EQ(swizzleContents, copyQuad->swizzle_contents); | 407 EXPECT_EQ(swizzleContents, copyQuad->swizzle_contents); |
408 EXPECT_EQ(leftEdgeAA, copyQuad->left_edge_aa); | 408 EXPECT_EQ(leftEdgeAA, copyQuad->anti_aliasing.left_edge); |
409 EXPECT_EQ(topEdgeAA, copyQuad->top_edge_aa); | 409 EXPECT_EQ(topEdgeAA, copyQuad->anti_aliasing.top_edge); |
410 EXPECT_EQ(rightEdgeAA, copyQuad->right_edge_aa); | 410 EXPECT_EQ(rightEdgeAA, copyQuad->anti_aliasing.right_edge); |
411 EXPECT_EQ(bottomEdgeAA, copyQuad->bottom_edge_aa); | 411 EXPECT_EQ(bottomEdgeAA, copyQuad->anti_aliasing.bottom_edge); |
412 | 412 |
413 CREATE_QUAD_8_ALL(TileDrawQuad, resourceId, texCoordRect, textureSize, swizz
leContents, leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA); | 413 CREATE_QUAD_5_ALL(TileDrawQuad, DrawQuad::AntiAliasing(leftEdgeAA, topEdgeAA
, rightEdgeAA, bottomEdgeAA), resourceId, texCoordRect, textureSize, swizzleCont
ents); |
414 EXPECT_EQ(DrawQuad::TILED_CONTENT, copyQuad->material); | 414 EXPECT_EQ(DrawQuad::TILED_CONTENT, copyQuad->material); |
415 EXPECT_EQ(resourceId, copyQuad->resource_id); | 415 EXPECT_EQ(resourceId, copyQuad->resource_id); |
416 EXPECT_EQ(texCoordRect, copyQuad->tex_coord_rect); | 416 EXPECT_EQ(texCoordRect, copyQuad->tex_coord_rect); |
417 EXPECT_EQ(textureSize, copyQuad->texture_size); | 417 EXPECT_EQ(textureSize, copyQuad->texture_size); |
418 EXPECT_EQ(swizzleContents, copyQuad->swizzle_contents); | 418 EXPECT_EQ(swizzleContents, copyQuad->swizzle_contents); |
419 EXPECT_EQ(leftEdgeAA, copyQuad->left_edge_aa); | 419 EXPECT_EQ(leftEdgeAA, copyQuad->anti_aliasing.left_edge); |
420 EXPECT_EQ(topEdgeAA, copyQuad->top_edge_aa); | 420 EXPECT_EQ(topEdgeAA, copyQuad->anti_aliasing.top_edge); |
421 EXPECT_EQ(rightEdgeAA, copyQuad->right_edge_aa); | 421 EXPECT_EQ(rightEdgeAA, copyQuad->anti_aliasing.right_edge); |
422 EXPECT_EQ(bottomEdgeAA, copyQuad->bottom_edge_aa); | 422 EXPECT_EQ(bottomEdgeAA, copyQuad->anti_aliasing.bottom_edge); |
423 } | 423 } |
424 | 424 |
425 TEST(DrawQuadTest, copyYUVVideoDrawQuad) | 425 TEST(DrawQuadTest, copyYUVVideoDrawQuad) |
426 { | 426 { |
427 gfx::Rect opaqueRect(3, 7, 10, 12); | 427 gfx::Rect opaqueRect(3, 7, 10, 12); |
428 gfx::SizeF texScale(0.75, 0.5); | 428 gfx::SizeF texScale(0.75, 0.5); |
429 VideoLayerImpl::FramePlane yPlane; | 429 VideoLayerImpl::FramePlane yPlane; |
430 yPlane.resourceId = 45; | 430 yPlane.resourceId = 45; |
431 yPlane.size = gfx::Size(34, 23); | 431 yPlane.size = gfx::Size(34, 23); |
432 yPlane.format = 8; | 432 yPlane.format = 8; |
(...skipping 30 matching lines...) Expand all Loading... |
463 EXPECT_EQ(uPlane.resourceId, copyQuad->u_plane.resourceId); | 463 EXPECT_EQ(uPlane.resourceId, copyQuad->u_plane.resourceId); |
464 EXPECT_EQ(uPlane.size, copyQuad->u_plane.size); | 464 EXPECT_EQ(uPlane.size, copyQuad->u_plane.size); |
465 EXPECT_EQ(uPlane.format, copyQuad->u_plane.format); | 465 EXPECT_EQ(uPlane.format, copyQuad->u_plane.format); |
466 EXPECT_EQ(vPlane.resourceId, copyQuad->v_plane.resourceId); | 466 EXPECT_EQ(vPlane.resourceId, copyQuad->v_plane.resourceId); |
467 EXPECT_EQ(vPlane.size, copyQuad->v_plane.size); | 467 EXPECT_EQ(vPlane.size, copyQuad->v_plane.size); |
468 EXPECT_EQ(vPlane.format, copyQuad->v_plane.format); | 468 EXPECT_EQ(vPlane.format, copyQuad->v_plane.format); |
469 } | 469 } |
470 | 470 |
471 } // namespace | 471 } // namespace |
472 } // namespace cc | 472 } // namespace cc |
OLD | NEW |