| 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 30 matching lines...) Expand all Loading... |
| 41 // Implements SkImageGenerator and used by SkPixelRef to populate a discardable | 41 // Implements SkImageGenerator and used by SkPixelRef to populate a discardable |
| 42 // memory with decoded pixels. | 42 // memory with decoded pixels. |
| 43 // | 43 // |
| 44 // This class does not own an ImageDecode. It does not own encoded data. It serv
es | 44 // This class does not own an ImageDecode. It does not own encoded data. It serv
es |
| 45 // as and adapter to ImageFrameGenerator which actually performs decoding. | 45 // as and adapter to ImageFrameGenerator which actually performs decoding. |
| 46 class PLATFORM_EXPORT DecodingImageGenerator final : public SkImageGenerator { | 46 class PLATFORM_EXPORT DecodingImageGenerator final : public SkImageGenerator { |
| 47 public: | 47 public: |
| 48 static SkImageGenerator* create(SkData*); | 48 static SkImageGenerator* create(SkData*); |
| 49 | 49 |
| 50 DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&,
size_t index); | 50 DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&,
size_t index); |
| 51 virtual ~DecodingImageGenerator(); | 51 ~DecodingImageGenerator() override; |
| 52 | 52 |
| 53 void setGenerationId(size_t id) { m_generationId = id; } | 53 void setGenerationId(size_t id) { m_generationId = id; } |
| 54 | 54 |
| 55 protected: | 55 protected: |
| 56 virtual SkData* onRefEncodedData() override; | 56 SkData* onRefEncodedData() override; |
| 57 virtual Result onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes
, const Options&, SkPMColor ctable[], int* ctableCount) override; | 57 Result onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes, const
Options&, SkPMColor ctable[], int* ctableCount) override; |
| 58 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], SkYUVColorSpace*) override; | 58 bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
SkYUVColorSpace*) override; |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 RefPtr<ImageFrameGenerator> m_frameGenerator; | 61 RefPtr<ImageFrameGenerator> m_frameGenerator; |
| 62 size_t m_frameIndex; | 62 size_t m_frameIndex; |
| 63 size_t m_generationId; | 63 size_t m_generationId; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| 67 | 67 |
| 68 #endif // DecodingImageGenerator_h_ | 68 #endif // DecodingImageGenerator_h_ |
| OLD | NEW |