OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/graphics/DeferredImageDecoder.h" | 5 #include "platform/graphics/DeferredImageDecoder.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "platform/SharedBuffer.h" | 8 #include "platform/SharedBuffer.h" |
8 #include "platform/image-decoders/ImageDecoderTestHelpers.h" | 9 #include "platform/image-decoders/ImageDecoderTestHelpers.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/skia/include/core/SkCanvas.h" | 11 #include "third_party/skia/include/core/SkCanvas.h" |
11 #include "third_party/skia/include/core/SkImage.h" | 12 #include "third_party/skia/include/core/SkImage.h" |
12 #include "third_party/skia/include/core/SkSurface.h" | 13 #include "third_party/skia/include/core/SkSurface.h" |
13 #include "wtf/RefPtr.h" | 14 #include "wtf/RefPtr.h" |
14 #include <memory> | |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 /** | 18 /** |
19 * Used to test decoding SkImages out of order. | 19 * Used to test decoding SkImages out of order. |
20 * e.g. | 20 * e.g. |
21 * SkImage* imageA = decoder.createFrameAtIndex(0); | 21 * SkImage* imageA = decoder.createFrameAtIndex(0); |
22 * // supply more (but not all) data to the decoder | 22 * // supply more (but not all) data to the decoder |
23 * SkImage* imageB = decoder.createFrameAtIndex(laterFrame); | 23 * SkImage* imageB = decoder.createFrameAtIndex(laterFrame); |
24 * draw(imageB); | 24 * draw(imageB); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 std::unique_ptr<DeferredImageDecoder> decoder = | 115 std::unique_ptr<DeferredImageDecoder> decoder = |
116 DeferredImageDecoder::create(buffer, false, | 116 DeferredImageDecoder::create(buffer, false, |
117 ImageDecoder::AlphaPremultiplied, | 117 ImageDecoder::AlphaPremultiplied, |
118 ColorBehavior::ignore()); | 118 ColorBehavior::ignore()); |
119 ASSERT_NE(decoder, nullptr); | 119 ASSERT_NE(decoder, nullptr); |
120 EXPECT_TRUE(String(testFiles[i]).endsWith(decoder->filenameExtension())); | 120 EXPECT_TRUE(String(testFiles[i]).endsWith(decoder->filenameExtension())); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 } // namespace blink | 124 } // namespace blink |
OLD | NEW |