| 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 "../../../../third_party/base/nonstd_unique_ptr.h" | |
| 8 #include "../../../../third_party/zlib_v128/zlib.h" | |
| 9 #include "../../../include/fxcodec/fx_codec.h" | 7 #include "../../../include/fxcodec/fx_codec.h" |
| 10 #include "../../../include/fxcodec/fx_codec_flate.h" | 8 #include "../../../include/fxcodec/fx_codec_flate.h" |
| 11 #include "codec_int.h" | 9 #include "codec_int.h" |
| 10 #include "third_party/base/nonstd_unique_ptr.h" |
| 11 #include "third_party/zlib_v128/zlib.h" |
| 12 | 12 |
| 13 extern "C" { | 13 extern "C" { |
| 14 static void* my_alloc_func(void* opaque, | 14 static void* my_alloc_func(void* opaque, |
| 15 unsigned int items, | 15 unsigned int items, |
| 16 unsigned int size) { | 16 unsigned int size) { |
| 17 return FX_Alloc2D(uint8_t, items, size); | 17 return FX_Alloc2D(uint8_t, items, size); |
| 18 } | 18 } |
| 19 static void my_free_func(void* opaque, void* address) { | 19 static void my_free_func(void* opaque, void* address) { |
| 20 FX_Free(address); | 20 FX_Free(address); |
| 21 } | 21 } |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 FX_DWORD src_size, | 986 FX_DWORD src_size, |
| 987 uint8_t*& dest_buf, | 987 uint8_t*& dest_buf, |
| 988 FX_DWORD& dest_size) { | 988 FX_DWORD& dest_size) { |
| 989 dest_size = src_size + src_size / 1000 + 12; | 989 dest_size = src_size + src_size / 1000 + 12; |
| 990 dest_buf = FX_Alloc(uint8_t, dest_size); | 990 dest_buf = FX_Alloc(uint8_t, dest_size); |
| 991 unsigned long temp_size = dest_size; | 991 unsigned long temp_size = dest_size; |
| 992 FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size); | 992 FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size); |
| 993 dest_size = (FX_DWORD)temp_size; | 993 dest_size = (FX_DWORD)temp_size; |
| 994 return TRUE; | 994 return TRUE; |
| 995 } | 995 } |
| OLD | NEW |