Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef ImageFrameGenerator_h | 26 #ifndef ImageFrameGenerator_h |
| 27 #define ImageFrameGenerator_h | 27 #define ImageFrameGenerator_h |
| 28 | 28 |
| 29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
| 30 #include "platform/graphics/ThreadSafeDataTransport.h" | 30 #include "platform/graphics/ThreadSafeDataTransport.h" |
| 31 #include "third_party/skia/include/core/SkBitmap.h" | 31 #include "third_party/skia/include/core/SkBitmap.h" |
| 32 #include "third_party/skia/include/core/SkSize.h" | 32 #include "third_party/skia/include/core/SkSize.h" |
| 33 #include "third_party/skia/include/core/SkTypes.h" | 33 #include "third_party/skia/include/core/SkTypes.h" |
| 34 #include "third_party/skia/include/core/SkYUVSizeInfo.h" | |
| 34 #include "wtf/Allocator.h" | 35 #include "wtf/Allocator.h" |
| 35 #include "wtf/Noncopyable.h" | 36 #include "wtf/Noncopyable.h" |
| 36 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
| 37 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
| 39 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
| 40 #include "wtf/ThreadSafeRefCounted.h" | 41 #include "wtf/ThreadSafeRefCounted.h" |
| 41 #include "wtf/ThreadingPrimitives.h" | 42 #include "wtf/ThreadingPrimitives.h" |
| 42 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
| 43 | 44 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 73 // according to the contract SkImageGenerator::refEncodedData. Returns null if | 74 // according to the contract SkImageGenerator::refEncodedData. Returns null if |
| 74 // the data is has not been fully received. | 75 // the data is has not been fully received. |
| 75 SkData* refEncodedData(); | 76 SkData* refEncodedData(); |
| 76 | 77 |
| 77 // Decodes and scales the specified frame at |index|. The dimensions and out put | 78 // Decodes and scales the specified frame at |index|. The dimensions and out put |
| 78 // format are given in SkImageInfo. Decoded pixels are written into |pixels| with | 79 // format are given in SkImageInfo. Decoded pixels are written into |pixels| with |
| 79 // a stride of |rowBytes|. Returns true if decoding was successful. | 80 // a stride of |rowBytes|. Returns true if decoding was successful. |
| 80 bool decodeAndScale(size_t index, const SkImageInfo&, void* pixels, size_t r owBytes); | 81 bool decodeAndScale(size_t index, const SkImageInfo&, void* pixels, size_t r owBytes); |
| 81 | 82 |
| 82 // Decodes YUV components directly into the provided memory planes. | 83 // Decodes YUV components directly into the provided memory planes. |
| 83 bool decodeToYUV(size_t index, SkISize componentSizes[3], void* planes[3], s ize_t rowBytes[3]); | 84 bool decodeToYUV(size_t index, const SkISize componentSizes[3], void* planes [3], const size_t rowBytes[3]); |
|
Noel Gordon
2016/03/03 01:25:28
Not really to do with your CL, but would it make s
msarett
2016/03/04 19:49:08
I don't disagree with you...
But on the other han
| |
| 84 | 85 |
| 85 const SkISize& getFullSize() const { return m_fullSize; } | 86 const SkISize& getFullSize() const { return m_fullSize; } |
| 86 | 87 |
| 87 bool isMultiFrame() const { return m_isMultiFrame; } | 88 bool isMultiFrame() const { return m_isMultiFrame; } |
| 88 bool decodeFailed() const { return m_decodeFailed; } | 89 bool decodeFailed() const { return m_decodeFailed; } |
| 89 | 90 |
| 90 bool hasAlpha(size_t index); | 91 bool hasAlpha(size_t index); |
| 91 | 92 |
| 92 bool getYUVComponentSizes(SkISize componentSizes[3]); | 93 bool getYUVComponentSizes(SkYUVSizeInfo*); |
| 93 | 94 |
| 94 private: | 95 private: |
| 95 ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer>, bool allDataReceived, bool isMultiFrame); | 96 ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer>, bool allDataReceived, bool isMultiFrame); |
| 96 | 97 |
| 97 friend class ImageFrameGeneratorTest; | 98 friend class ImageFrameGeneratorTest; |
| 98 friend class DeferredImageDecoderTest; | 99 friend class DeferredImageDecoderTest; |
| 99 // For testing. |factory| will overwrite the default ImageDecoder creation l ogic if |factory->create()| returns non-zero. | 100 // For testing. |factory| will overwrite the default ImageDecoder creation l ogic if |factory->create()| returns non-zero. |
| 100 void setImageDecoderFactory(PassOwnPtr<ImageDecoderFactory> factory) { m_ima geDecoderFactory = std::move(factory); } | 101 void setImageDecoderFactory(PassOwnPtr<ImageDecoderFactory> factory) { m_ima geDecoderFactory = std::move(factory); } |
| 101 | 102 |
| 102 void setHasAlpha(size_t index, bool hasAlpha); | 103 void setHasAlpha(size_t index, bool hasAlpha); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 132 SkData* m_encodedData; | 133 SkData* m_encodedData; |
| 133 | 134 |
| 134 #if COMPILER(MSVC) | 135 #if COMPILER(MSVC) |
| 135 friend struct ::WTF::OwnedPtrDeleter<ExternalMemoryAllocator>; | 136 friend struct ::WTF::OwnedPtrDeleter<ExternalMemoryAllocator>; |
| 136 #endif | 137 #endif |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 } // namespace blink | 140 } // namespace blink |
| 140 | 141 |
| 141 #endif | 142 #endif |
| OLD | NEW |