| 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 "wtf/Vector.h" | 6 #include "wtf/Vector.h" |
| 6 #include <memory> | 7 #include <memory> |
| 7 | 8 |
| 8 class SkBitmap; | 9 class SkBitmap; |
| 9 | 10 |
| 10 namespace blink { | 11 namespace blink { |
| 11 class ImageDecoder; | 12 class ImageDecoder; |
| 12 class SharedBuffer; | 13 class SharedBuffer; |
| 13 | 14 |
| 14 const char decodersTestingDir[] = "Source/platform/image-decoders/testing"; | 15 const char decodersTestingDir[] = "Source/platform/image-decoders/testing"; |
| 15 | 16 |
| 16 using DecoderCreator = std::unique_ptr<ImageDecoder> (*)(); | 17 using DecoderCreator = std::unique_ptr<ImageDecoder> (*)(); |
| 18 using DecoderCreatorWithAlpha = |
| 19 std::unique_ptr<ImageDecoder> (*)(ImageDecoder::AlphaOption); |
| 20 |
| 17 PassRefPtr<SharedBuffer> readFile(const char* fileName); | 21 PassRefPtr<SharedBuffer> readFile(const char* fileName); |
| 18 PassRefPtr<SharedBuffer> readFile(const char* dir, const char* fileName); | 22 PassRefPtr<SharedBuffer> readFile(const char* dir, const char* fileName); |
| 19 unsigned hashBitmap(const SkBitmap&); | 23 unsigned hashBitmap(const SkBitmap&); |
| 20 void createDecodingBaseline(DecoderCreator, | 24 void createDecodingBaseline(DecoderCreator, |
| 21 SharedBuffer*, | 25 SharedBuffer*, |
| 22 Vector<unsigned>* baselineHashes); | 26 Vector<unsigned>* baselineHashes); |
| 23 | 27 |
| 24 void testByteByByteDecode(DecoderCreator createDecoder, | 28 void testByteByByteDecode(DecoderCreator createDecoder, |
| 25 const char* file, | 29 const char* file, |
| 26 size_t expectedFrameCount, | 30 size_t expectedFrameCount, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 80 |
| 77 // Data is provided in chunks of length |increment| to the decoder. This value | 81 // Data is provided in chunks of length |increment| to the decoder. This value |
| 78 // can be increased to reduce processing time. | 82 // can be increased to reduce processing time. |
| 79 void testProgressiveDecoding(DecoderCreator, | 83 void testProgressiveDecoding(DecoderCreator, |
| 80 const char* file, | 84 const char* file, |
| 81 size_t increment = 1); | 85 size_t increment = 1); |
| 82 void testProgressiveDecoding(DecoderCreator, | 86 void testProgressiveDecoding(DecoderCreator, |
| 83 const char* dir, | 87 const char* dir, |
| 84 const char* file, | 88 const char* file, |
| 85 size_t increment = 1); | 89 size_t increment = 1); |
| 90 |
| 91 void testUpdateRequiredPreviousFrameAfterFirstDecode(DecoderCreator, |
| 92 const char* dir, |
| 93 const char* file); |
| 94 void testUpdateRequiredPreviousFrameAfterFirstDecode(DecoderCreator, |
| 95 const char* file); |
| 96 |
| 97 void testResumePartialDecodeAfterClearFrameBufferCache(DecoderCreator, |
| 98 const char* dir, |
| 99 const char* file); |
| 100 void testResumePartialDecodeAfterClearFrameBufferCache(DecoderCreator, |
| 101 const char* file); |
| 102 |
| 103 // Verifies that result of alpha blending is similar for AlphaPremultiplied and |
| 104 // AlphaNotPremultiplied cases. |
| 105 void testAlphaBlending(DecoderCreatorWithAlpha, const char*); |
| 106 |
| 86 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |