| 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 "codec_int.h" | 7 #include "core/src/fxcodec/codec/codec_int.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "core/include/fxcodec/fx_codec.h" | 12 #include "core/include/fxcodec/fx_codec.h" |
| 13 #include "core/include/fxcodec/fx_codec_flate.h" | 13 #include "core/include/fxcodec/fx_codec_flate.h" |
| 14 #include "third_party/zlib_v128/zlib.h" | 14 #include "third_party/zlib_v128/zlib.h" |
| 15 | 15 |
| 16 extern "C" { | 16 extern "C" { |
| 17 static void* my_alloc_func(void* opaque, | 17 static void* my_alloc_func(void* opaque, |
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 FX_DWORD src_size, | 998 FX_DWORD src_size, |
| 999 uint8_t*& dest_buf, | 999 uint8_t*& dest_buf, |
| 1000 FX_DWORD& dest_size) { | 1000 FX_DWORD& dest_size) { |
| 1001 dest_size = src_size + src_size / 1000 + 12; | 1001 dest_size = src_size + src_size / 1000 + 12; |
| 1002 dest_buf = FX_Alloc(uint8_t, dest_size); | 1002 dest_buf = FX_Alloc(uint8_t, dest_size); |
| 1003 unsigned long temp_size = dest_size; | 1003 unsigned long temp_size = dest_size; |
| 1004 FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size); | 1004 FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size); |
| 1005 dest_size = (FX_DWORD)temp_size; | 1005 dest_size = (FX_DWORD)temp_size; |
| 1006 return TRUE; | 1006 return TRUE; |
| 1007 } | 1007 } |
| OLD | NEW |