Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: core/fpdfapi/fpdf_render/fpdf_render_image.cpp

Issue 1861403002: Rename FX_SAFE_DWORD to FX_SAFE_UINT32 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698