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

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

Issue 1542213002: Merge to XFA: Start using allowed C++11 features. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: fix mac/win Created 4 years, 12 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 "render_int.h" 7 #include "render_int.h"
8 8
9 #include <utility>
10 #include <vector>
11
9 #include "core/include/fpdfapi/fpdf_module.h" 12 #include "core/include/fpdfapi/fpdf_module.h"
10 #include "core/include/fpdfapi/fpdf_pageobj.h" 13 #include "core/include/fpdfapi/fpdf_pageobj.h"
11 #include "core/include/fpdfapi/fpdf_render.h" 14 #include "core/include/fpdfapi/fpdf_render.h"
12 #include "core/include/fxcodec/fx_codec.h" 15 #include "core/include/fxcodec/fx_codec.h"
13 #include "core/include/fxcrt/fx_safe_types.h" 16 #include "core/include/fxcrt/fx_safe_types.h"
14 #include "core/include/fxge/fx_ge.h" 17 #include "core/include/fxge/fx_ge.h"
15 #include "core/src/fpdfapi/fpdf_page/pageint.h" 18 #include "core/src/fpdfapi/fpdf_page/pageint.h"
16 19
17 FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, 20 FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj,
18 const CFX_Matrix* pObj2Device) { 21 const CFX_Matrix* pObj2Device) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), 122 pDIBitmap->GetWidth(), pDIBitmap->GetHeight(),
120 pDIBitmap, mask_argb, 0, 0, blend_mode); 123 pDIBitmap, mask_argb, 0, 0, blend_mode);
121 } 124 }
122 125
123 nonstd::unique_ptr<CFX_DIBitmap> pBackdrop1(new CFX_DIBitmap); 126 nonstd::unique_ptr<CFX_DIBitmap> pBackdrop1(new CFX_DIBitmap);
124 pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(), 127 pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(),
125 FXDIB_Rgb32); 128 FXDIB_Rgb32);
126 pBackdrop1->Clear((FX_DWORD)-1); 129 pBackdrop1->Clear((FX_DWORD)-1);
127 pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(), 130 pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(),
128 pBackdrop->GetHeight(), pBackdrop.get(), 0, 0); 131 pBackdrop->GetHeight(), pBackdrop.get(), 0, 0);
129 pBackdrop = nonstd::move(pBackdrop1); 132 pBackdrop = std::move(pBackdrop1);
130 m_pDevice->SetDIBits(pBackdrop.get(), back_left, back_top); 133 m_pDevice->SetDIBits(pBackdrop.get(), back_left, back_top);
131 } 134 }
132 135
133 CPDF_TransferFunc::CPDF_TransferFunc(CPDF_Document* pDoc) : m_pPDFDoc(pDoc) {} 136 CPDF_TransferFunc::CPDF_TransferFunc(CPDF_Document* pDoc) : m_pPDFDoc(pDoc) {}
134 137
135 FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb) const { 138 FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb) const {
136 return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], 139 return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)],
137 m_Samples[256 + FXSYS_GetGValue(rgb)], 140 m_Samples[256 + FXSYS_GetGValue(rgb)],
138 m_Samples[512 + FXSYS_GetBValue(rgb)]); 141 m_Samples[512 + FXSYS_GetBValue(rgb)]);
139 } 142 }
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 } else if (pFunc) { 982 } else if (pFunc) {
980 int size = dest_pitch * height; 983 int size = dest_pitch * height;
981 for (int i = 0; i < size; i++) { 984 for (int i = 0; i < size; i++) {
982 dest_buf[i] = transfers[src_buf[i]]; 985 dest_buf[i] = transfers[src_buf[i]];
983 } 986 }
984 } else { 987 } else {
985 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); 988 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height);
986 } 989 }
987 return pMask.release(); 990 return pMask.release();
988 } 991 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fxcodec/codec/fx_codec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698