summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fxcodec/bmp/fx_bmp.cpp40
-rw-r--r--core/fxcodec/bmp/fx_bmp.h15
-rw-r--r--core/fxcodec/codec/ccodec_bmpmodule.cpp19
3 files changed, 37 insertions, 37 deletions
diff --git a/core/fxcodec/bmp/fx_bmp.cpp b/core/fxcodec/bmp/fx_bmp.cpp
index 31a93287f1..910e0a6c3d 100644
--- a/core/fxcodec/bmp/fx_bmp.cpp
+++ b/core/fxcodec/bmp/fx_bmp.cpp
@@ -28,7 +28,7 @@ uint8_t HalfRoundUp(uint8_t value) {
} // namespace
-BMPDecompressor::BMPDecompressor()
+CFX_BmpDecompressor::CFX_BmpDecompressor()
: context_ptr_(nullptr),
next_in_(nullptr),
header_offset_(0),
@@ -57,24 +57,24 @@ BMPDecompressor::BMPDecompressor()
skip_size_(0),
decode_status_(BMP_D_STATUS_HEADER) {}
-BMPDecompressor::~BMPDecompressor() {}
+CFX_BmpDecompressor::~CFX_BmpDecompressor() {}
-void BMPDecompressor::Error() {
+void CFX_BmpDecompressor::Error() {
longjmp(jmpbuf_, 1);
}
-void BMPDecompressor::ReadScanline(uint32_t row_num_,
- const std::vector<uint8_t>& row_buf) {
- auto* p = reinterpret_cast<CBmpContext*>(context_ptr_);
+void CFX_BmpDecompressor::ReadScanline(uint32_t row_num_,
+ const std::vector<uint8_t>& row_buf) {
+ auto* p = reinterpret_cast<CFX_BmpContext*>(context_ptr_);
p->m_pDelegate->BmpReadScanline(row_num_, row_buf);
}
-bool BMPDecompressor::GetDataPosition(uint32_t rcd_pos) {
- auto* p = reinterpret_cast<CBmpContext*>(context_ptr_);
+bool CFX_BmpDecompressor::GetDataPosition(uint32_t rcd_pos) {
+ auto* p = reinterpret_cast<CFX_BmpContext*>(context_ptr_);
return p->m_pDelegate->BmpInputImagePositionBuf(rcd_pos);
}
-int32_t BMPDecompressor::ReadHeader() {
+int32_t CFX_BmpDecompressor::ReadHeader() {
uint32_t skip_size_org = skip_size_;
if (decode_status_ == BMP_D_STATUS_HEADER) {
BmpFileHeader* pBmp_header = nullptr;
@@ -291,7 +291,7 @@ int32_t BMPDecompressor::ReadHeader() {
return 1;
}
-bool BMPDecompressor::ValidateFlag() const {
+bool CFX_BmpDecompressor::ValidateFlag() const {
switch (compress_flag_) {
case BMP_RGB:
case BMP_BITFIELDS:
@@ -303,7 +303,7 @@ bool BMPDecompressor::ValidateFlag() const {
}
}
-int32_t BMPDecompressor::DecodeImage() {
+int32_t CFX_BmpDecompressor::DecodeImage() {
if (decode_status_ == BMP_D_STATUS_DATA_PRE) {
avail_in_ = 0;
if (!GetDataPosition(header_offset_)) {
@@ -331,7 +331,7 @@ int32_t BMPDecompressor::DecodeImage() {
}
}
-bool BMPDecompressor::ValidateColorIndex(uint8_t val) {
+bool CFX_BmpDecompressor::ValidateColorIndex(uint8_t val) {
if (val >= pal_num_) {
Error();
NOTREACHED();
@@ -339,7 +339,7 @@ bool BMPDecompressor::ValidateColorIndex(uint8_t val) {
return true;
}
-int32_t BMPDecompressor::DecodeRGB() {
+int32_t CFX_BmpDecompressor::DecodeRGB() {
uint8_t* des_buf = nullptr;
while (row_num_ < height_) {
size_t idx = 0;
@@ -408,7 +408,7 @@ int32_t BMPDecompressor::DecodeRGB() {
return 1;
}
-int32_t BMPDecompressor::DecodeRLE8() {
+int32_t CFX_BmpDecompressor::DecodeRLE8() {
uint8_t* first_byte_ptr = nullptr;
uint8_t* second_byte_ptr = nullptr;
col_num_ = 0;
@@ -511,7 +511,7 @@ int32_t BMPDecompressor::DecodeRLE8() {
NOTREACHED();
}
-int32_t BMPDecompressor::DecodeRLE4() {
+int32_t CFX_BmpDecompressor::DecodeRLE4() {
uint8_t* first_byte_ptr = nullptr;
uint8_t* second_byte_ptr = nullptr;
col_num_ = 0;
@@ -630,7 +630,7 @@ int32_t BMPDecompressor::DecodeRLE4() {
NOTREACHED();
}
-uint8_t* BMPDecompressor::ReadData(uint8_t** des_buf, uint32_t data_size_) {
+uint8_t* CFX_BmpDecompressor::ReadData(uint8_t** des_buf, uint32_t data_size_) {
if (avail_in_ < skip_size_ + data_size_)
return nullptr;
@@ -639,20 +639,20 @@ uint8_t* BMPDecompressor::ReadData(uint8_t** des_buf, uint32_t data_size_) {
return *des_buf;
}
-void BMPDecompressor::SaveDecodingStatus(int32_t status) {
+void CFX_BmpDecompressor::SaveDecodingStatus(int32_t status) {
decode_status_ = status;
next_in_ += skip_size_;
avail_in_ -= skip_size_;
skip_size_ = 0;
}
-void BMPDecompressor::SetInputBuffer(uint8_t* src_buf, uint32_t src_size) {
+void CFX_BmpDecompressor::SetInputBuffer(uint8_t* src_buf, uint32_t src_size) {
next_in_ = src_buf;
avail_in_ = src_size;
skip_size_ = 0;
}
-uint32_t BMPDecompressor::GetAvailInput(uint8_t** avail_buf) {
+uint32_t CFX_BmpDecompressor::GetAvailInput(uint8_t** avail_buf) {
if (avail_buf) {
*avail_buf = nullptr;
if (avail_in_ > 0)
@@ -661,7 +661,7 @@ uint32_t BMPDecompressor::GetAvailInput(uint8_t** avail_buf) {
return avail_in_;
}
-void BMPDecompressor::SetHeight(int32_t signed_height) {
+void CFX_BmpDecompressor::SetHeight(int32_t signed_height) {
if (signed_height >= 0) {
height_ = signed_height;
return;
diff --git a/core/fxcodec/bmp/fx_bmp.h b/core/fxcodec/bmp/fx_bmp.h
index 4033e510a6..d81b97ea7e 100644
--- a/core/fxcodec/bmp/fx_bmp.h
+++ b/core/fxcodec/bmp/fx_bmp.h
@@ -64,10 +64,10 @@ typedef struct tagBmpInfoHeader {
} BmpInfoHeader;
#pragma pack()
-class BMPDecompressor {
+class CFX_BmpDecompressor {
public:
- BMPDecompressor();
- ~BMPDecompressor();
+ CFX_BmpDecompressor();
+ ~CFX_BmpDecompressor();
void Error();
int32_t DecodeImage();
@@ -123,12 +123,13 @@ class BMPDecompressor {
void SetHeight(int32_t signed_height);
};
-class CBmpContext : public CCodec_BmpModule::Context {
+class CFX_BmpContext : public CCodec_BmpModule::Context {
public:
- CBmpContext(CCodec_BmpModule* pModule, CCodec_BmpModule::Delegate* pDelegate);
- ~CBmpContext() override;
+ CFX_BmpContext(CCodec_BmpModule* pModule,
+ CCodec_BmpModule::Delegate* pDelegate);
+ ~CFX_BmpContext() override;
- BMPDecompressor m_Bmp;
+ CFX_BmpDecompressor m_Bmp;
UnownedPtr<CCodec_BmpModule> const m_pModule;
UnownedPtr<CCodec_BmpModule::Delegate> const m_pDelegate;
};
diff --git a/core/fxcodec/codec/ccodec_bmpmodule.cpp b/core/fxcodec/codec/ccodec_bmpmodule.cpp
index 9fbb557008..260ebbd451 100644
--- a/core/fxcodec/codec/ccodec_bmpmodule.cpp
+++ b/core/fxcodec/codec/ccodec_bmpmodule.cpp
@@ -13,12 +13,11 @@
#include "core/fxge/fx_dib.h"
#include "third_party/base/ptr_util.h"
-CBmpContext::CBmpContext(CCodec_BmpModule* pModule,
- CCodec_BmpModule::Delegate* pDelegate)
- : m_pModule(pModule), m_pDelegate(pDelegate) {
-}
+CFX_BmpContext::CFX_BmpContext(CCodec_BmpModule* pModule,
+ CCodec_BmpModule::Delegate* pDelegate)
+ : m_pModule(pModule), m_pDelegate(pDelegate) {}
-CBmpContext::~CBmpContext() {}
+CFX_BmpContext::~CFX_BmpContext() {}
CCodec_BmpModule::CCodec_BmpModule() {}
@@ -26,7 +25,7 @@ CCodec_BmpModule::~CCodec_BmpModule() {}
std::unique_ptr<CCodec_BmpModule::Context> CCodec_BmpModule::Start(
Delegate* pDelegate) {
- auto p = pdfium::MakeUnique<CBmpContext>(this, pDelegate);
+ auto p = pdfium::MakeUnique<CFX_BmpContext>(this, pDelegate);
p->m_Bmp.context_ptr_ = p.get();
return p;
}
@@ -39,7 +38,7 @@ int32_t CCodec_BmpModule::ReadHeader(Context* pContext,
int32_t* pal_num,
std::vector<uint32_t>* palette,
CFX_DIBAttribute* pAttribute) {
- auto* ctx = static_cast<CBmpContext*>(pContext);
+ auto* ctx = static_cast<CFX_BmpContext*>(pContext);
if (setjmp(ctx->m_Bmp.jmpbuf_))
return 0;
@@ -63,7 +62,7 @@ int32_t CCodec_BmpModule::ReadHeader(Context* pContext,
}
int32_t CCodec_BmpModule::LoadImage(Context* pContext) {
- auto* ctx = static_cast<CBmpContext*>(pContext);
+ auto* ctx = static_cast<CFX_BmpContext*>(pContext);
if (setjmp(ctx->m_Bmp.jmpbuf_))
return 0;
@@ -72,13 +71,13 @@ int32_t CCodec_BmpModule::LoadImage(Context* pContext) {
uint32_t CCodec_BmpModule::GetAvailInput(Context* pContext,
uint8_t** avail_buf_ptr) {
- auto* ctx = static_cast<CBmpContext*>(pContext);
+ auto* ctx = static_cast<CFX_BmpContext*>(pContext);
return ctx->m_Bmp.GetAvailInput(avail_buf_ptr);
}
void CCodec_BmpModule::Input(Context* pContext,
const uint8_t* src_buf,
uint32_t src_size) {
- auto* ctx = static_cast<CBmpContext*>(pContext);
+ auto* ctx = static_cast<CFX_BmpContext*>(pContext);
ctx->m_Bmp.SetInputBuffer(const_cast<uint8_t*>(src_buf), src_size);
}