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 | 41 |
42 class ImageFrameGenerator; | 42 class ImageFrameGenerator; |
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 // Make kNeedNeedNewImageUniqueID accessible. | |
Peter Kasting
2016/05/04 03:01:07
Extra "need". Also, you should qualify this with
aleksandar.stojiljkovic
2016/05/04 20:56:29
Done.
Peter Kasting
2016/05/07 01:58:29
Any comment on the idea of exposing SkImageGenerat
aleksandar.stojiljkovic
2016/05/07 19:50:52
I think SkImageGenerator should stay as it is now
| |
52 enum { | |
53 NeedNewImageUniqueID = kNeedNewImageUniqueID | |
Peter Kasting
2016/05/04 03:01:07
This should still be named with a leading k. Use
aleksandar.stojiljkovic
2016/05/04 20:56:29
Done.
| |
54 }; | |
55 | |
51 static SkImageGenerator* create(SkData*); | 56 static SkImageGenerator* create(SkData*); |
52 | 57 |
53 DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&, PassRefPtr<SegmentReader>, bool allDataReceived, size_t index); | 58 DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>, const SkImageInfo&, PassRefPtr<SegmentReader>, bool allDataReceived, size_t index, uint32_t uniqueID = NeedNewImageUniqueID); |
54 ~DecodingImageGenerator() override; | 59 ~DecodingImageGenerator() override; |
55 | 60 |
56 void setCanYUVDecode(bool yes) { m_canYUVDecode = yes; } | 61 void setCanYUVDecode(bool yes) { m_canYUVDecode = yes; } |
57 | 62 |
58 protected: | 63 protected: |
59 SkData* onRefEncodedData(GrContext* ctx) override; | 64 SkData* onRefEncodedData(GrContext* ctx) override; |
60 | 65 |
61 bool onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes, SkPMColo r table[], int* tableCount) override; | 66 bool onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes, SkPMColo r table[], int* tableCount) override; |
62 | 67 |
63 bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const override; | 68 bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const override; |
64 | 69 |
65 bool onGetYUV8Planes(const SkYUVSizeInfo&, void* planes[3]) override; | 70 bool onGetYUV8Planes(const SkYUVSizeInfo&, void* planes[3]) override; |
66 | 71 |
67 private: | 72 private: |
68 RefPtr<ImageFrameGenerator> m_frameGenerator; | 73 RefPtr<ImageFrameGenerator> m_frameGenerator; |
69 const RefPtr<SegmentReader> m_data; // Data source. | 74 const RefPtr<SegmentReader> m_data; // Data source. |
70 const bool m_allDataReceived; | 75 const bool m_allDataReceived; |
71 const size_t m_frameIndex; | 76 const size_t m_frameIndex; |
72 bool m_canYUVDecode; | 77 bool m_canYUVDecode; |
73 }; | 78 }; |
74 | 79 |
75 } // namespace blink | 80 } // namespace blink |
76 | 81 |
77 #endif // DecodingImageGenerator_h_ | 82 #endif // DecodingImageGenerator_h_ |
OLD | NEW |