| 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 "core/fpdfapi/fpdf_render/render_int.h" | 7 #include "core/fpdfapi/fpdf_render/render_int.h" |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 pCSObj = NULL; | 924 pCSObj = NULL; |
| 925 pCS = m_pContext->GetDocument()->LoadColorSpace(pCSObj); | 925 pCS = m_pContext->GetDocument()->LoadColorSpace(pCSObj); |
| 926 if (pCS) { | 926 if (pCS) { |
| 927 FX_FLOAT R, G, B; | 927 FX_FLOAT R, G, B; |
| 928 uint32_t comps = 8; | 928 uint32_t comps = 8; |
| 929 if (pCS->CountComponents() > comps) { | 929 if (pCS->CountComponents() > comps) { |
| 930 comps = pCS->CountComponents(); | 930 comps = pCS->CountComponents(); |
| 931 } | 931 } |
| 932 CFX_FixedBufGrow<FX_FLOAT, 8> float_array(comps); | 932 CFX_FixedBufGrow<FX_FLOAT, 8> float_array(comps); |
| 933 FX_FLOAT* pFloats = float_array; | 933 FX_FLOAT* pFloats = float_array; |
| 934 FX_SAFE_DWORD num_floats = comps; | 934 FX_SAFE_UINT32 num_floats = comps; |
| 935 num_floats *= sizeof(FX_FLOAT); | 935 num_floats *= sizeof(FX_FLOAT); |
| 936 if (!num_floats.IsValid()) { | 936 if (!num_floats.IsValid()) { |
| 937 return NULL; | 937 return NULL; |
| 938 } | 938 } |
| 939 FXSYS_memset(pFloats, 0, num_floats.ValueOrDie()); | 939 FXSYS_memset(pFloats, 0, num_floats.ValueOrDie()); |
| 940 int count = pBC->GetCount() > 8 ? 8 : pBC->GetCount(); | 940 int count = pBC->GetCount() > 8 ? 8 : pBC->GetCount(); |
| 941 for (int i = 0; i < count; i++) { | 941 for (int i = 0; i < count; i++) { |
| 942 pFloats[i] = pBC->GetNumberAt(i); | 942 pFloats[i] = pBC->GetNumberAt(i); |
| 943 } | 943 } |
| 944 pCS->GetRGB(pFloats, R, G, B); | 944 pCS->GetRGB(pFloats, R, G, B); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 } else if (pFunc) { | 997 } else if (pFunc) { |
| 998 int size = dest_pitch * height; | 998 int size = dest_pitch * height; |
| 999 for (int i = 0; i < size; i++) { | 999 for (int i = 0; i < size; i++) { |
| 1000 dest_buf[i] = transfers[src_buf[i]]; | 1000 dest_buf[i] = transfers[src_buf[i]]; |
| 1001 } | 1001 } |
| 1002 } else { | 1002 } else { |
| 1003 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 1003 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
| 1004 } | 1004 } |
| 1005 return pMask.release(); | 1005 return pMask.release(); |
| 1006 } | 1006 } |
| OLD | NEW |