• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "core/fxcodec/gif/gif_progressive_decoder.h"
8 
9 #include "core/fxcodec/cfx_codec_memory.h"
10 #include "core/fxcodec/gif/gif_decoder.h"
11 #include "core/fxcrt/check.h"
12 
13 namespace fxcodec {
14 
15 namespace {
16 
17 GifProgressiveDecoder* g_gif_decoder = nullptr;
18 
19 }  // namespace
20 
21 // static
InitializeGlobals()22 void GifProgressiveDecoder::InitializeGlobals() {
23   CHECK(!g_gif_decoder);
24   g_gif_decoder = new GifProgressiveDecoder();
25 }
26 
27 // static
DestroyGlobals()28 void GifProgressiveDecoder::DestroyGlobals() {
29   delete g_gif_decoder;
30   g_gif_decoder = nullptr;
31 }
32 
33 // static
GetInstance()34 GifProgressiveDecoder* GifProgressiveDecoder::GetInstance() {
35   return g_gif_decoder;
36 }
37 
38 GifProgressiveDecoder::GifProgressiveDecoder() = default;
39 
40 GifProgressiveDecoder::~GifProgressiveDecoder() = default;
41 
GetAvailInput(Context * context) const42 FX_FILESIZE GifProgressiveDecoder::GetAvailInput(Context* context) const {
43   return GifDecoder::GetAvailInput(context);
44 }
45 
Input(Context * context,RetainPtr<CFX_CodecMemory> codec_memory)46 bool GifProgressiveDecoder::Input(Context* context,
47                                   RetainPtr<CFX_CodecMemory> codec_memory) {
48   return GifDecoder::Input(context, codec_memory);
49 }
50 
51 }  // namespace fxcodec
52