1 // Copyright 2020 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXCODEC_GIF_GIF_PROGRESSIVE_DECODER_H_ 8 #define CORE_FXCODEC_GIF_GIF_PROGRESSIVE_DECODER_H_ 9 10 #include "core/fxcodec/progressive_decoder_iface.h" 11 12 #ifndef PDF_ENABLE_XFA_GIF 13 #error "GIF must be enabled" 14 #endif 15 16 namespace fxcodec { 17 18 class GifProgressiveDecoder final : public ProgressiveDecoderIface { 19 public: 20 static void InitializeGlobals(); 21 static void DestroyGlobals(); 22 23 static GifProgressiveDecoder* GetInstance(); 24 25 // ProgressiveDecoderIface: 26 FX_FILESIZE GetAvailInput(Context* context) const override; 27 bool Input(Context* context, 28 RetainPtr<CFX_CodecMemory> codec_memory) override; 29 30 private: 31 GifProgressiveDecoder(); 32 ~GifProgressiveDecoder() override; 33 }; 34 35 } // namespace fxcodec 36 37 using GifProgressiveDecoder = fxcodec::GifProgressiveDecoder; 38 39 #endif // CORE_FXCODEC_GIF_GIF_PROGRESSIVE_DECODER_H_ 40