diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-27 15:39:26 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-27 19:56:53 +0000 |
commit | 36a155d1f3a9d9f315655a20d583c13644ef1f3e (patch) | |
tree | 66e8a87c0b35f3d6c71460f3a0c4ce68a15b51f0 /core/fxcodec/codec/ccodec_gifmodule.cpp | |
parent | dd17a14f060c39f50ca24522b202ffef5436dd43 (diff) | |
download | pdfium-36a155d1f3a9d9f315655a20d583c13644ef1f3e.tar.xz |
Cleaning up naming of GIF files/classes/variables
Moved everything from core/fxcodec/lgif to core/fxcodec/gif
Converted CGifContext -> CFX_GifContext
Removed _ptr suffixes from CXF_GifContext
Movef fx_gif.* -> cfx_gif.*
Renamed structs in cfx_gif.h
Renamed members of CFX_GifImage
Renamed members of CFX_GifContext
Renamed CFX_LZWDecoder -> CFX_LZWDecompressor
BUG=pdfium:903
Change-Id: I537e905e935da26832e6bbdc03e0373ed5500bcb
Reviewed-on: https://pdfium-review.googlesource.com/14990
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_gifmodule.cpp')
-rw-r--r-- | core/fxcodec/codec/ccodec_gifmodule.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/core/fxcodec/codec/ccodec_gifmodule.cpp b/core/fxcodec/codec/ccodec_gifmodule.cpp index b7e55d5208..0567af06ea 100644 --- a/core/fxcodec/codec/ccodec_gifmodule.cpp +++ b/core/fxcodec/codec/ccodec_gifmodule.cpp @@ -8,8 +8,8 @@ #include "core/fxcodec/codec/codec_int.h" #include "core/fxcodec/fx_codec.h" -#include "core/fxcodec/lgif/cgifcontext.h" -#include "core/fxcodec/lgif/fx_gif.h" +#include "core/fxcodec/gif/cfx_gif.h" +#include "core/fxcodec/gif/cfx_gifcontext.h" #include "core/fxge/fx_dib.h" #include "third_party/base/ptr_util.h" @@ -19,55 +19,55 @@ CCodec_GifModule::~CCodec_GifModule() {} std::unique_ptr<CCodec_GifModule::Context> CCodec_GifModule::Start( Delegate* pDelegate) { - return pdfium::MakeUnique<CGifContext>(this, pDelegate); + return pdfium::MakeUnique<CFX_GifContext>(this, pDelegate); } -GifDecodeStatus CCodec_GifModule::ReadHeader(Context* pContext, - int* width, - int* height, - int* pal_num, - void** pal_pp, - int* bg_index, - CFX_DIBAttribute* pAttribute) { - auto* context = static_cast<CGifContext*>(pContext); - GifDecodeStatus ret = context->ReadHeader(); - if (ret != GifDecodeStatus::Success) +CFX_GifDecodeStatus CCodec_GifModule::ReadHeader(Context* pContext, + int* width, + int* height, + int* pal_num, + void** pal_pp, + int* bg_index, + CFX_DIBAttribute* pAttribute) { + auto* context = static_cast<CFX_GifContext*>(pContext); + CFX_GifDecodeStatus ret = context->ReadHeader(); + if (ret != CFX_GifDecodeStatus::Success) return ret; - *width = context->width; - *height = context->height; - *pal_num = (2 << context->global_pal_exp); - *pal_pp = context->m_GlobalPalette.empty() ? nullptr - : context->m_GlobalPalette.data(); - *bg_index = context->bc_index; - return GifDecodeStatus::Success; + *width = context->width_; + *height = context->height_; + *pal_num = (2 << context->global_pal_exp_); + *pal_pp = context->global_palette_.empty() ? nullptr + : context->global_palette_.data(); + *bg_index = context->bc_index_; + return CFX_GifDecodeStatus::Success; } -GifDecodeStatus CCodec_GifModule::LoadFrameInfo(Context* pContext, - int* frame_num) { - auto* context = static_cast<CGifContext*>(pContext); - GifDecodeStatus ret = context->GetFrame(); - if (ret != GifDecodeStatus::Success) +CFX_GifDecodeStatus CCodec_GifModule::LoadFrameInfo(Context* pContext, + int* frame_num) { + auto* context = static_cast<CFX_GifContext*>(pContext); + CFX_GifDecodeStatus ret = context->GetFrame(); + if (ret != CFX_GifDecodeStatus::Success) return ret; *frame_num = context->GetFrameNum(); - return GifDecodeStatus::Success; + return CFX_GifDecodeStatus::Success; } -GifDecodeStatus CCodec_GifModule::LoadFrame(Context* pContext, - int frame_num, - CFX_DIBAttribute* pAttribute) { - auto* context = static_cast<CGifContext*>(pContext); - GifDecodeStatus ret = context->LoadFrame(frame_num); - if (ret != GifDecodeStatus::Success || !pAttribute) +CFX_GifDecodeStatus CCodec_GifModule::LoadFrame(Context* pContext, + int frame_num, + CFX_DIBAttribute* pAttribute) { + auto* context = static_cast<CFX_GifContext*>(pContext); + CFX_GifDecodeStatus ret = context->LoadFrame(frame_num); + if (ret != CFX_GifDecodeStatus::Success || !pAttribute) return ret; - pAttribute->m_nGifLeft = context->m_Images[frame_num]->m_ImageInfo.left; - pAttribute->m_nGifTop = context->m_Images[frame_num]->m_ImageInfo.top; - pAttribute->m_fAspectRatio = context->pixel_aspect; + pAttribute->m_nGifLeft = context->images_[frame_num]->image_info.left; + pAttribute->m_nGifTop = context->images_[frame_num]->image_info.top; + pAttribute->m_fAspectRatio = context->pixel_aspect_; const uint8_t* buf = - reinterpret_cast<const uint8_t*>(context->cmt_data.GetBuffer(0)); - uint32_t len = context->cmt_data.GetLength(); + reinterpret_cast<const uint8_t*>(context->cmt_data_.GetBuffer(0)); + uint32_t len = context->cmt_data_.GetLength(); if (len > 21) { uint8_t size = *buf++; if (size != 0) @@ -75,18 +75,18 @@ GifDecodeStatus CCodec_GifModule::LoadFrame(Context* pContext, else pAttribute->m_strAuthor.clear(); } - return GifDecodeStatus::Success; + return CFX_GifDecodeStatus::Success; } uint32_t CCodec_GifModule::GetAvailInput(Context* pContext, uint8_t** avail_buf_ptr) { - auto* context = static_cast<CGifContext*>(pContext); + auto* context = static_cast<CFX_GifContext*>(pContext); return context->GetAvailInput(avail_buf_ptr); } void CCodec_GifModule::Input(Context* pContext, const uint8_t* src_buf, uint32_t src_size) { - auto* context = static_cast<CGifContext*>(pContext); + auto* context = static_cast<CFX_GifContext*>(pContext); context->SetInputBuffer((uint8_t*)src_buf, src_size); } |