| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/image-decoders/ImageDecoder.h" | 5 #include "platform/image-decoders/ImageDecoder.h" |
| 6 #include "wtf/Vector.h" | 6 #include "wtf/Vector.h" |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 class SkBitmap; | 9 class SkBitmap; |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 class ImageDecoder; | 12 class ImageDecoder; |
| 13 class SharedBuffer; | 13 class SharedBuffer; |
| 14 | 14 |
| 15 const char decodersTestingDir[] = "Source/platform/image-decoders/testing"; | 15 const char decodersTestingDir[] = "Source/platform/image-decoders/testing"; |
| 16 | 16 |
| 17 using DecoderCreator = std::unique_ptr<ImageDecoder> (*)(); | 17 using DecoderCreator = std::unique_ptr<ImageDecoder> (*)(); |
| 18 using DecoderCreatorWithAlpha = | 18 using DecoderCreatorWithAlpha = |
| 19 std::unique_ptr<ImageDecoder> (*)(ImageDecoder::AlphaOption); | 19 std::unique_ptr<ImageDecoder> (*)(ImageDecoder::AlphaOption); |
| 20 | 20 |
| 21 PassRefPtr<SharedBuffer> readFile(const char* fileName); | 21 PassRefPtr<SharedBuffer> readFile(const char* fileName); |
| 22 PassRefPtr<SharedBuffer> readFile(const char* dir, const char* fileName); | 22 PassRefPtr<SharedBuffer> readFile(const char* dir, const char* fileName); |
| 23 unsigned hashBitmap(const SkBitmap&); | 23 unsigned hashBitmap(const SkBitmap&); |
| 24 void createDecodingBaseline(DecoderCreator, | 24 void createDecodingBaseline(DecoderCreator, |
| 25 SharedBuffer*, | 25 SharedBuffer*, |
| 26 Vector<unsigned>* baselineHashes); | 26 Vector<unsigned>* baselineHashes); |
| 27 | 27 |
| 28 void testByteByByteDecode(DecoderCreator createDecoder, | 28 void testByteByByteDecode(DecoderCreator createDecoder, |
| 29 SharedBuffer* data, |
| 30 size_t expectedFrameCount, |
| 31 int expectedRepetitionCount); |
| 32 void testByteByByteDecode(DecoderCreator createDecoder, |
| 29 const char* file, | 33 const char* file, |
| 30 size_t expectedFrameCount, | 34 size_t expectedFrameCount, |
| 31 int expectedRepetitionCount); | 35 int expectedRepetitionCount); |
| 32 void testByteByByteDecode(DecoderCreator createDecoder, | 36 void testByteByByteDecode(DecoderCreator createDecoder, |
| 33 const char* dir, | 37 const char* dir, |
| 34 const char* file, | 38 const char* file, |
| 35 size_t expectedFrameCount, | 39 size_t expectedFrameCount, |
| 36 int expectedRepetitionCount); | 40 int expectedRepetitionCount); |
| 37 | 41 |
| 38 void testMergeBuffer(DecoderCreator createDecoder, const char* file); | 42 void testMergeBuffer(DecoderCreator createDecoder, const char* file); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const char* dir, | 102 const char* dir, |
| 99 const char* file); | 103 const char* file); |
| 100 void testResumePartialDecodeAfterClearFrameBufferCache(DecoderCreator, | 104 void testResumePartialDecodeAfterClearFrameBufferCache(DecoderCreator, |
| 101 const char* file); | 105 const char* file); |
| 102 | 106 |
| 103 // Verifies that result of alpha blending is similar for AlphaPremultiplied and | 107 // Verifies that result of alpha blending is similar for AlphaPremultiplied and |
| 104 // AlphaNotPremultiplied cases. | 108 // AlphaNotPremultiplied cases. |
| 105 void testAlphaBlending(DecoderCreatorWithAlpha, const char*); | 109 void testAlphaBlending(DecoderCreatorWithAlpha, const char*); |
| 106 | 110 |
| 107 } // namespace blink | 111 } // namespace blink |
| OLD | NEW |