| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Implements SkImageGenerator, used by SkPixelRef to populate a discardable mem
ory | 44 // Implements SkImageGenerator, used by SkPixelRef to populate a discardable mem
ory |
| 45 // with a decoded image frame. ImageFrameGenerator does the actual decoding. | 45 // with a decoded image frame. ImageFrameGenerator does the actual decoding. |
| 46 // | 46 // |
| 47 class PLATFORM_EXPORT DecodingImageGenerator final : public SkImageGenerator { | 47 class PLATFORM_EXPORT DecodingImageGenerator final : public SkImageGenerator { |
| 48 USING_FAST_MALLOC(DecodingImageGenerator); | 48 USING_FAST_MALLOC(DecodingImageGenerator); |
| 49 WTF_MAKE_NONCOPYABLE(DecodingImageGenerator); | 49 WTF_MAKE_NONCOPYABLE(DecodingImageGenerator); |
| 50 public: | 50 public: |
| 51 static SkImageGenerator* create(SkData*); | 51 static SkImageGenerator* create(SkData*); |
| 52 | 52 |
| 53 DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&,
PassRefPtr<SegmentReader>, bool allDataReceived, size_t index); | 53 DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&,
PassRefPtr<SegmentReader>, bool allDataReceived, size_t index, uint32_t uniqueID
= kNeedNewImageUniqueID); |
| 54 ~DecodingImageGenerator() override; | 54 ~DecodingImageGenerator() override; |
| 55 | 55 |
| 56 void setCanYUVDecode(bool yes) { m_canYUVDecode = yes; } | 56 void setCanYUVDecode(bool yes) { m_canYUVDecode = yes; } |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 SkData* onRefEncodedData(GrContext* ctx) override; | 59 SkData* onRefEncodedData(GrContext* ctx) override; |
| 60 | 60 |
| 61 bool onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes, SkPMColo
r table[], int* tableCount) override; | 61 bool onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes, SkPMColo
r table[], int* tableCount) override; |
| 62 | 62 |
| 63 bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const override; | 63 bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const override; |
| 64 | 64 |
| 65 bool onGetYUV8Planes(const SkYUVSizeInfo&, void* planes[3]) override; | 65 bool onGetYUV8Planes(const SkYUVSizeInfo&, void* planes[3]) override; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 RefPtr<ImageFrameGenerator> m_frameGenerator; | 68 RefPtr<ImageFrameGenerator> m_frameGenerator; |
| 69 const RefPtr<SegmentReader> m_data; // Data source. | 69 const RefPtr<SegmentReader> m_data; // Data source. |
| 70 const bool m_allDataReceived; | 70 const bool m_allDataReceived; |
| 71 const size_t m_frameIndex; | 71 const size_t m_frameIndex; |
| 72 bool m_canYUVDecode; | 72 bool m_canYUVDecode; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| 76 | 76 |
| 77 #endif // DecodingImageGenerator_h_ | 77 #endif // DecodingImageGenerator_h_ |
| OLD | NEW |