| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../../include/fpdfapi/fpdf_module.h" | 7 #include "../../../include/fpdfapi/fpdf_module.h" |
| 8 #include "../../../include/fpdfapi/fpdf_page.h" | 8 #include "../../../include/fpdfapi/fpdf_page.h" |
| 9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
| 10 #include "../../../include/fpdfapi/fpdf_render.h" | 10 #include "../../../include/fpdfapi/fpdf_render.h" |
| 11 #include "../fpdf_page/pageint.h" | 11 #include "../fpdf_page/pageint.h" |
| 12 #include "../fpdf_render/render_int.h" | 12 #include "../fpdf_render/render_int.h" |
| 13 CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size) | 13 CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size) |
| 14 { | 14 { |
| 15 int32_t width; | 15 int32_t width; |
| 16 int32_t height; | 16 int32_t height; |
| 17 int32_t num_comps; | 17 int32_t num_comps; |
| 18 int32_t bits; | 18 int32_t bits; |
| 19 FX_BOOL color_trans; | 19 bool color_trans; |
| 20 if (!CPDF_ModuleMgr::Get()->GetJpegModule()-> | 20 if (!CPDF_ModuleMgr::Get()->GetJpegModule()-> |
| 21 LoadInfo(pData, size, width, height, num_comps, bits, color_trans))
{ | 21 LoadInfo(pData, size, width, height, num_comps, bits, color_trans))
{ |
| 22 return NULL; | 22 return NULL; |
| 23 } | 23 } |
| 24 CPDF_Dictionary* pDict = new CPDF_Dictionary; | 24 CPDF_Dictionary* pDict = new CPDF_Dictionary; |
| 25 pDict->SetAtName("Type", "XObject"); | 25 pDict->SetAtName("Type", "XObject"); |
| 26 pDict->SetAtName("Subtype", "Image"); | 26 pDict->SetAtName("Subtype", "Image"); |
| 27 pDict->SetAtInteger("Width", width); | 27 pDict->SetAtInteger("Width", width); |
| 28 pDict->SetAtInteger("Height", height); | 28 pDict->SetAtInteger("Height", height); |
| 29 const FX_CHAR* csname = NULL; | 29 const FX_CHAR* csname = NULL; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 pDict->SetAt(FX_BSTRC("Decode"), pDecode); | 41 pDict->SetAt(FX_BSTRC("Decode"), pDecode); |
| 42 } | 42 } |
| 43 pDict->SetAtName("ColorSpace", csname); | 43 pDict->SetAtName("ColorSpace", csname); |
| 44 pDict->SetAtInteger("BitsPerComponent", bits); | 44 pDict->SetAtInteger("BitsPerComponent", bits); |
| 45 pDict->SetAtName("Filter", "DCTDecode"); | 45 pDict->SetAtName("Filter", "DCTDecode"); |
| 46 if (!color_trans) { | 46 if (!color_trans) { |
| 47 CPDF_Dictionary* pParms = new CPDF_Dictionary; | 47 CPDF_Dictionary* pParms = new CPDF_Dictionary; |
| 48 pDict->SetAt("DecodeParms", pParms); | 48 pDict->SetAt("DecodeParms", pParms); |
| 49 pParms->SetAtInteger("ColorTransform", 0); | 49 pParms->SetAtInteger("ColorTransform", 0); |
| 50 } | 50 } |
| 51 m_bIsMask = FALSE; | 51 m_bIsMask = false; |
| 52 m_Width = width; | 52 m_Width = width; |
| 53 m_Height = height; | 53 m_Height = height; |
| 54 if (m_pStream == NULL) { | 54 if (m_pStream == NULL) { |
| 55 m_pStream = new CPDF_Stream(NULL, 0, NULL); | 55 m_pStream = new CPDF_Stream(NULL, 0, NULL); |
| 56 } | 56 } |
| 57 return pDict; | 57 return pDict; |
| 58 } | 58 } |
| 59 void CPDF_Image::SetJpegImage(uint8_t* pData, FX_DWORD size) | 59 void CPDF_Image::SetJpegImage(uint8_t* pData, FX_DWORD size) |
| 60 { | 60 { |
| 61 CPDF_Dictionary *pDict = InitJPEG(pData, size); | 61 CPDF_Dictionary *pDict = InitJPEG(pData, size); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 85 FX_Free(pData); | 85 FX_Free(pData); |
| 86 } | 86 } |
| 87 if (!pDict) { | 87 if (!pDict) { |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 m_pStream->InitStream(pFile, pDict); | 90 m_pStream->InitStream(pFile, pDict); |
| 91 } | 91 } |
| 92 void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap,
int quality, uint8_t* &buf, FX_STRSIZE &size) | 92 void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap,
int quality, uint8_t* &buf, FX_STRSIZE &size) |
| 93 { | 93 { |
| 94 } | 94 } |
| 95 void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitma
p, CPDF_Document *pDoc, uint8_t* &buf, FX_STRSIZE &size, FX_BOOL bLossLess) | 95 void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitma
p, CPDF_Document *pDoc, uint8_t* &buf, FX_STRSIZE &size, bool bLossLess) |
| 96 { | 96 { |
| 97 } | 97 } |
| 98 void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
leWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const C
PDF_ImageSetParam* pParam) | 98 void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
leWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const C
PDF_ImageSetParam* pParam) |
| 99 { | 99 { |
| 100 int32_t BitmapWidth = pBitmap->GetWidth(); | 100 int32_t BitmapWidth = pBitmap->GetWidth(); |
| 101 int32_t BitmapHeight = pBitmap->GetHeight(); | 101 int32_t BitmapHeight = pBitmap->GetHeight(); |
| 102 if (BitmapWidth < 1 || BitmapHeight < 1) { | 102 if (BitmapWidth < 1 || BitmapHeight < 1) { |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 uint8_t* src_buf = pBitmap->GetBuffer(); | 105 uint8_t* src_buf = pBitmap->GetBuffer(); |
| 106 int32_t src_pitch = pBitmap->GetPitch(); | 106 int32_t src_pitch = pBitmap->GetPitch(); |
| 107 int32_t bpp = pBitmap->GetBPP(); | 107 int32_t bpp = pBitmap->GetBPP(); |
| 108 FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() =
= FXDIB_Argb); | 108 bool bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == F
XDIB_Argb); |
| 109 CPDF_Dictionary* pDict = new CPDF_Dictionary; | 109 CPDF_Dictionary* pDict = new CPDF_Dictionary; |
| 110 pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject")); | 110 pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject")); |
| 111 pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image")); | 111 pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image")); |
| 112 pDict->SetAtInteger(FX_BSTRC("Width"), BitmapWidth); | 112 pDict->SetAtInteger(FX_BSTRC("Width"), BitmapWidth); |
| 113 pDict->SetAtInteger(FX_BSTRC("Height"), BitmapHeight); | 113 pDict->SetAtInteger(FX_BSTRC("Height"), BitmapHeight); |
| 114 uint8_t* dest_buf = NULL; | 114 uint8_t* dest_buf = NULL; |
| 115 FX_STRSIZE dest_pitch = 0, dest_size = 0, opType = -1; | 115 FX_STRSIZE dest_pitch = 0, dest_size = 0, opType = -1; |
| 116 if (bpp == 1) { | 116 if (bpp == 1) { |
| 117 int32_t reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0; | 117 int32_t reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0; |
| 118 int32_t set_a = 0, set_r = 0, set_g = 0, set_b = 0; | 118 int32_t set_a = 0, set_r = 0, set_g = 0, set_b = 0; |
| 119 if (!pBitmap->IsAlphaMask()) { | 119 if (!pBitmap->IsAlphaMask()) { |
| 120 ArgbDecode(pBitmap->GetPaletteArgb(0), reset_a, reset_r, reset_g, re
set_b); | 120 ArgbDecode(pBitmap->GetPaletteArgb(0), reset_a, reset_r, reset_g, re
set_b); |
| 121 ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b); | 121 ArgbDecode(pBitmap->GetPaletteArgb(1), set_a, set_r, set_g, set_b); |
| 122 } | 122 } |
| 123 if (set_a == 0 || reset_a == 0) { | 123 if (set_a == 0 || reset_a == 0) { |
| 124 pDict->SetAt(FX_BSTRC("ImageMask"), new CPDF_Boolean(TRUE)); | 124 pDict->SetAt(FX_BSTRC("ImageMask"), new CPDF_Boolean(true)); |
| 125 if (reset_a == 0) { | 125 if (reset_a == 0) { |
| 126 CPDF_Array* pArray = new CPDF_Array; | 126 CPDF_Array* pArray = new CPDF_Array; |
| 127 pArray->AddInteger(1); | 127 pArray->AddInteger(1); |
| 128 pArray->AddInteger(0); | 128 pArray->AddInteger(0); |
| 129 pDict->SetAt(FX_BSTRC("Decode"), pArray); | 129 pDict->SetAt(FX_BSTRC("Decode"), pArray); |
| 130 } | 130 } |
| 131 } else { | 131 } else { |
| 132 CPDF_Array* pCS = new CPDF_Array; | 132 CPDF_Array* pCS = new CPDF_Array; |
| 133 pCS->AddName(FX_BSTRC("Indexed")); | 133 pCS->AddName(FX_BSTRC("Indexed")); |
| 134 pCS->AddName(FX_BSTRC("DeviceRGB")); | 134 pCS->AddName(FX_BSTRC("DeviceRGB")); |
| 135 pCS->AddInteger(1); | 135 pCS->AddInteger(1); |
| 136 CFX_ByteString ct; | 136 CFX_ByteString ct; |
| 137 FX_CHAR* pBuf = ct.GetBuffer(6); | 137 FX_CHAR* pBuf = ct.GetBuffer(6); |
| 138 pBuf[0] = (FX_CHAR)reset_r; | 138 pBuf[0] = (FX_CHAR)reset_r; |
| 139 pBuf[1] = (FX_CHAR)reset_g; | 139 pBuf[1] = (FX_CHAR)reset_g; |
| 140 pBuf[2] = (FX_CHAR)reset_b; | 140 pBuf[2] = (FX_CHAR)reset_b; |
| 141 pBuf[3] = (FX_CHAR)set_r; | 141 pBuf[3] = (FX_CHAR)set_r; |
| 142 pBuf[4] = (FX_CHAR)set_g; | 142 pBuf[4] = (FX_CHAR)set_g; |
| 143 pBuf[5] = (FX_CHAR)set_b; | 143 pBuf[5] = (FX_CHAR)set_b; |
| 144 ct.ReleaseBuffer(6); | 144 ct.ReleaseBuffer(6); |
| 145 pCS->Add(CPDF_String::Create(ct, TRUE)); | 145 pCS->Add(CPDF_String::Create(ct, true)); |
| 146 pDict->SetAt(FX_BSTRC("ColorSpace"), pCS); | 146 pDict->SetAt(FX_BSTRC("ColorSpace"), pCS); |
| 147 } | 147 } |
| 148 pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 1); | 148 pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 1); |
| 149 dest_pitch = (BitmapWidth + 7) / 8; | 149 dest_pitch = (BitmapWidth + 7) / 8; |
| 150 if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) { | 150 if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) { |
| 151 opType = 1; | 151 opType = 1; |
| 152 } else { | 152 } else { |
| 153 opType = 0; | 153 opType = 0; |
| 154 } | 154 } |
| 155 } else if (bpp == 8) { | 155 } else if (bpp == 8) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 pDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceRGB")); | 187 pDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceRGB")); |
| 188 pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8); | 188 pDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8); |
| 189 if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) { | 189 if ((iCompress & 0x03) == PDF_IMAGE_NO_COMPRESS) { |
| 190 dest_pitch = BitmapWidth * 3; | 190 dest_pitch = BitmapWidth * 3; |
| 191 opType = 2; | 191 opType = 2; |
| 192 } else { | 192 } else { |
| 193 opType = 0; | 193 opType = 0; |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 const CFX_DIBitmap* pMaskBitmap = NULL; | 196 const CFX_DIBitmap* pMaskBitmap = NULL; |
| 197 FX_BOOL bDeleteMask = FALSE; | 197 bool bDeleteMask = false; |
| 198 if (pBitmap->HasAlpha()) { | 198 if (pBitmap->HasAlpha()) { |
| 199 pMaskBitmap = pBitmap->GetAlphaMask(); | 199 pMaskBitmap = pBitmap->GetAlphaMask(); |
| 200 bDeleteMask = TRUE; | 200 bDeleteMask = true; |
| 201 } | 201 } |
| 202 if (!pMaskBitmap && pMask) { | 202 if (!pMaskBitmap && pMask) { |
| 203 FXDIB_Format maskFormat = pMask->GetFormat(); | 203 FXDIB_Format maskFormat = pMask->GetFormat(); |
| 204 if (maskFormat == FXDIB_1bppMask || maskFormat == FXDIB_8bppMask) { | 204 if (maskFormat == FXDIB_1bppMask || maskFormat == FXDIB_8bppMask) { |
| 205 pMaskBitmap = pMask; | 205 pMaskBitmap = pMask; |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 if (pMaskBitmap) { | 208 if (pMaskBitmap) { |
| 209 int32_t maskWidth = pMaskBitmap->GetWidth(); | 209 int32_t maskWidth = pMaskBitmap->GetWidth(); |
| 210 int32_t maskHeight = pMaskBitmap->GetHeight(); | 210 int32_t maskHeight = pMaskBitmap->GetHeight(); |
| 211 uint8_t* mask_buf = NULL; | 211 uint8_t* mask_buf = NULL; |
| 212 FX_STRSIZE mask_size; | 212 FX_STRSIZE mask_size; |
| 213 CPDF_Dictionary* pMaskDict = new CPDF_Dictionary; | 213 CPDF_Dictionary* pMaskDict = new CPDF_Dictionary; |
| 214 pMaskDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject")); | 214 pMaskDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject")); |
| 215 pMaskDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image")); | 215 pMaskDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image")); |
| 216 pMaskDict->SetAtInteger(FX_BSTRC("Width"), maskWidth); | 216 pMaskDict->SetAtInteger(FX_BSTRC("Width"), maskWidth); |
| 217 pMaskDict->SetAtInteger(FX_BSTRC("Height"), maskHeight); | 217 pMaskDict->SetAtInteger(FX_BSTRC("Height"), maskHeight); |
| 218 pMaskDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceGray")); | 218 pMaskDict->SetAtName(FX_BSTRC("ColorSpace"), FX_BSTRC("DeviceGray")); |
| 219 pMaskDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8); | 219 pMaskDict->SetAtInteger(FX_BSTRC("BitsPerComponent"), 8); |
| 220 if (pMaskBitmap->GetBPP() == 8 && (iCompress & PDF_IMAGE_MASK_LOSSY_COMP
RESS) != 0) { | 220 if (pMaskBitmap->GetBPP() == 8 && (iCompress & PDF_IMAGE_MASK_LOSSY_COMP
RESS) != 0) { |
| 221 _DCTEncodeBitmap(pMaskDict, pMaskBitmap, pParam ? pParam->nQuality :
75, mask_buf, mask_size); | 221 _DCTEncodeBitmap(pMaskDict, pMaskBitmap, pParam ? pParam->nQuality :
75, mask_buf, mask_size); |
| 222 } else if (pMaskBitmap->GetFormat() == FXDIB_1bppMask) { | 222 } else if (pMaskBitmap->GetFormat() == FXDIB_1bppMask) { |
| 223 _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, ma
sk_size, TRUE); | 223 _JBIG2EncodeBitmap(pMaskDict, pMaskBitmap, m_pDocument, mask_buf, ma
sk_size, true); |
| 224 } else { | 224 } else { |
| 225 mask_buf = FX_Alloc2D(uint8_t, maskHeight, maskWidth); | 225 mask_buf = FX_Alloc2D(uint8_t, maskHeight, maskWidth); |
| 226 mask_size = maskHeight * maskWidth; // Safe since checked alloc ret
urned. | 226 mask_size = maskHeight * maskWidth; // Safe since checked alloc ret
urned. |
| 227 for (int32_t a = 0; a < maskHeight; a ++) { | 227 for (int32_t a = 0; a < maskHeight; a ++) { |
| 228 FXSYS_memcpy(mask_buf + a * maskWidth, pMaskBitmap->GetScanline(
a), maskWidth); | 228 FXSYS_memcpy(mask_buf + a * maskWidth, pMaskBitmap->GetScanline(
a), maskWidth); |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 pMaskDict->SetAtInteger(FX_BSTRC("Length"), mask_size); | 231 pMaskDict->SetAtInteger(FX_BSTRC("Length"), mask_size); |
| 232 if (bUseMatte) { | 232 if (bUseMatte) { |
| 233 int a, r, g, b; | 233 int a, r, g, b; |
| 234 ArgbDecode(*(pParam->pMatteColor), a, r, g, b); | 234 ArgbDecode(*(pParam->pMatteColor), a, r, g, b); |
| 235 CPDF_Array* pMatte = new CPDF_Array; | 235 CPDF_Array* pMatte = new CPDF_Array; |
| 236 pMatte->AddInteger(r); | 236 pMatte->AddInteger(r); |
| 237 pMatte->AddInteger(g); | 237 pMatte->AddInteger(g); |
| 238 pMatte->AddInteger(b); | 238 pMatte->AddInteger(b); |
| 239 pMaskDict->SetAt(FX_BSTRC("Matte"), pMatte); | 239 pMaskDict->SetAt(FX_BSTRC("Matte"), pMatte); |
| 240 } | 240 } |
| 241 CPDF_Stream* pMaskStream = new CPDF_Stream(mask_buf, mask_size, pMaskDic
t); | 241 CPDF_Stream* pMaskStream = new CPDF_Stream(mask_buf, mask_size, pMaskDic
t); |
| 242 m_pDocument->AddIndirectObject(pMaskStream); | 242 m_pDocument->AddIndirectObject(pMaskStream); |
| 243 pDict->SetAtReference(FX_BSTRC("SMask"), m_pDocument, pMaskStream); | 243 pDict->SetAtReference(FX_BSTRC("SMask"), m_pDocument, pMaskStream); |
| 244 if (bDeleteMask) { | 244 if (bDeleteMask) { |
| 245 delete pMaskBitmap; | 245 delete pMaskBitmap; |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 FX_BOOL bStream = pFileWrite != NULL && pFileRead != NULL; | 248 bool bStream = pFileWrite != NULL && pFileRead != NULL; |
| 249 if (opType == 0) { | 249 if (opType == 0) { |
| 250 if (iCompress & PDF_IMAGE_LOSSLESS_COMPRESS) { | 250 if (iCompress & PDF_IMAGE_LOSSLESS_COMPRESS) { |
| 251 if (pBitmap->GetBPP() == 1) { | 251 if (pBitmap->GetBPP() == 1) { |
| 252 _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_s
ize, TRUE); | 252 _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_s
ize, true); |
| 253 } | 253 } |
| 254 } else { | 254 } else { |
| 255 if (pBitmap->GetBPP() == 1) { | 255 if (pBitmap->GetBPP() == 1) { |
| 256 _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_s
ize, FALSE); | 256 _JBIG2EncodeBitmap(pDict, pBitmap, m_pDocument, dest_buf, dest_s
ize, false); |
| 257 } else if (pBitmap->GetBPP() >= 8 && pBitmap->GetPalette() != NULL)
{ | 257 } else if (pBitmap->GetBPP() >= 8 && pBitmap->GetPalette() != NULL)
{ |
| 258 CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap(); | 258 CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap(); |
| 259 pNewBitmap->Copy(pBitmap); | 259 pNewBitmap->Copy(pBitmap); |
| 260 pNewBitmap->ConvertFormat(FXDIB_Rgb); | 260 pNewBitmap->ConvertFormat(FXDIB_Rgb); |
| 261 SetImage(pNewBitmap, iCompress, pFileWrite, pFileRead); | 261 SetImage(pNewBitmap, iCompress, pFileWrite, pFileRead); |
| 262 if (pDict) { | 262 if (pDict) { |
| 263 pDict->Release(); | 263 pDict->Release(); |
| 264 pDict = NULL; | 264 pDict = NULL; |
| 265 } | 265 } |
| 266 if (dest_buf) { | 266 if (dest_buf) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 m_Width = BitmapWidth; | 360 m_Width = BitmapWidth; |
| 361 m_Height = BitmapHeight; | 361 m_Height = BitmapHeight; |
| 362 if (dest_buf) { | 362 if (dest_buf) { |
| 363 FX_Free(dest_buf); | 363 FX_Free(dest_buf); |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap) | 366 void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap) |
| 367 { | 367 { |
| 368 pPage->GetRenderCache()->ResetBitmap(m_pStream, pBitmap); | 368 pPage->GetRenderCache()->ResetBitmap(m_pStream, pBitmap); |
| 369 } | 369 } |
| OLD | NEW |