OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 ASSERT_TRUE(unpremulDecoder->frameCount()); | 384 ASSERT_TRUE(unpremulDecoder->frameCount()); |
385 ImageFrame* premulFrame = premulDecoder->frameBufferAtIndex(0); | 385 ImageFrame* premulFrame = premulDecoder->frameBufferAtIndex(0); |
386 EXPECT_TRUE(premulFrame && | 386 EXPECT_TRUE(premulFrame && |
387 premulFrame->getStatus() != ImageFrame::FrameComplete); | 387 premulFrame->getStatus() != ImageFrame::FrameComplete); |
388 EXPECT_EQ(premulFrame->bitmap().alphaType(), kPremul_SkAlphaType); | 388 EXPECT_EQ(premulFrame->bitmap().alphaType(), kPremul_SkAlphaType); |
389 ImageFrame* unpremulFrame = unpremulDecoder->frameBufferAtIndex(0); | 389 ImageFrame* unpremulFrame = unpremulDecoder->frameBufferAtIndex(0); |
390 EXPECT_TRUE(unpremulFrame && | 390 EXPECT_TRUE(unpremulFrame && |
391 unpremulFrame->getStatus() != ImageFrame::FrameComplete); | 391 unpremulFrame->getStatus() != ImageFrame::FrameComplete); |
392 EXPECT_EQ(unpremulFrame->bitmap().alphaType(), kUnpremul_SkAlphaType); | 392 EXPECT_EQ(unpremulFrame->bitmap().alphaType(), kUnpremul_SkAlphaType); |
393 | 393 |
394 // Fully decoded frame => the frame alpha type is known (opaque). | 394 // Fully decoded frame |
395 premulDecoder->setData(fullData.get(), true); | 395 premulDecoder->setData(fullData.get(), true); |
396 ASSERT_TRUE(premulDecoder->frameCount()); | 396 ASSERT_TRUE(premulDecoder->frameCount()); |
397 unpremulDecoder->setData(fullData.get(), true); | 397 unpremulDecoder->setData(fullData.get(), true); |
398 ASSERT_TRUE(unpremulDecoder->frameCount()); | 398 ASSERT_TRUE(unpremulDecoder->frameCount()); |
399 premulFrame = premulDecoder->frameBufferAtIndex(0); | 399 premulFrame = premulDecoder->frameBufferAtIndex(0); |
400 EXPECT_TRUE(premulFrame && | 400 EXPECT_TRUE(premulFrame && |
401 premulFrame->getStatus() == ImageFrame::FrameComplete); | 401 premulFrame->getStatus() == ImageFrame::FrameComplete); |
402 EXPECT_EQ(premulFrame->bitmap().alphaType(), kOpaque_SkAlphaType); | 402 EXPECT_EQ(premulFrame->bitmap().alphaType(), kOpaque_SkAlphaType); |
403 unpremulFrame = unpremulDecoder->frameBufferAtIndex(0); | 403 unpremulFrame = unpremulDecoder->frameBufferAtIndex(0); |
404 EXPECT_TRUE(unpremulFrame && | 404 EXPECT_TRUE(unpremulFrame && |
(...skipping 25 matching lines...) Expand all Loading... |
430 EXPECT_EQ(1u, decoder->frameCount()); | 430 EXPECT_EQ(1u, decoder->frameCount()); |
431 ImageFrame* frame = decoder->frameBufferAtIndex(0); | 431 ImageFrame* frame = decoder->frameBufferAtIndex(0); |
432 decoder->setMemoryAllocator(nullptr); | 432 decoder->setMemoryAllocator(nullptr); |
433 | 433 |
434 ASSERT_TRUE(frame); | 434 ASSERT_TRUE(frame); |
435 EXPECT_EQ(IntRect(IntPoint(), decoder->size()), frame->originalFrameRect()); | 435 EXPECT_EQ(IntRect(IntPoint(), decoder->size()), frame->originalFrameRect()); |
436 EXPECT_FALSE(frame->hasAlpha()); | 436 EXPECT_FALSE(frame->hasAlpha()); |
437 } | 437 } |
438 | 438 |
439 } // namespace blink | 439 } // namespace blink |
OLD | NEW |