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 "render_int.h" | 7 #include "render_int.h" |
8 | 8 |
| 9 #include <utility> |
| 10 |
9 #include "core/include/fpdfapi/fpdf_module.h" | 11 #include "core/include/fpdfapi/fpdf_module.h" |
10 #include "core/include/fpdfapi/fpdf_pageobj.h" | 12 #include "core/include/fpdfapi/fpdf_pageobj.h" |
11 #include "core/include/fpdfapi/fpdf_render.h" | 13 #include "core/include/fpdfapi/fpdf_render.h" |
12 #include "core/include/fxcodec/fx_codec.h" | 14 #include "core/include/fxcodec/fx_codec.h" |
13 #include "core/include/fxcrt/fx_safe_types.h" | 15 #include "core/include/fxcrt/fx_safe_types.h" |
14 #include "core/include/fxge/fx_ge.h" | 16 #include "core/include/fxge/fx_ge.h" |
15 #include "core/src/fpdfapi/fpdf_page/pageint.h" | 17 #include "core/src/fpdfapi/fpdf_page/pageint.h" |
16 | 18 |
17 FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, | 19 FX_BOOL CPDF_RenderStatus::ProcessImage(CPDF_ImageObject* pImageObj, |
18 const CFX_Matrix* pObj2Device) { | 20 const CFX_Matrix* pObj2Device) { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), | 121 pDIBitmap->GetWidth(), pDIBitmap->GetHeight(), |
120 pDIBitmap, mask_argb, 0, 0, blend_mode); | 122 pDIBitmap, mask_argb, 0, 0, blend_mode); |
121 } | 123 } |
122 | 124 |
123 nonstd::unique_ptr<CFX_DIBitmap> pBackdrop1(new CFX_DIBitmap); | 125 nonstd::unique_ptr<CFX_DIBitmap> pBackdrop1(new CFX_DIBitmap); |
124 pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(), | 126 pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(), |
125 FXDIB_Rgb32); | 127 FXDIB_Rgb32); |
126 pBackdrop1->Clear((FX_DWORD)-1); | 128 pBackdrop1->Clear((FX_DWORD)-1); |
127 pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(), | 129 pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(), |
128 pBackdrop->GetHeight(), pBackdrop.get(), 0, 0); | 130 pBackdrop->GetHeight(), pBackdrop.get(), 0, 0); |
129 pBackdrop = nonstd::move(pBackdrop1); | 131 pBackdrop = std::move(pBackdrop1); |
130 m_pDevice->SetDIBits(pBackdrop.get(), back_left, back_top); | 132 m_pDevice->SetDIBits(pBackdrop.get(), back_left, back_top); |
131 } | 133 } |
132 | 134 |
133 CPDF_TransferFunc::CPDF_TransferFunc(CPDF_Document* pDoc) : m_pPDFDoc(pDoc) {} | 135 CPDF_TransferFunc::CPDF_TransferFunc(CPDF_Document* pDoc) : m_pPDFDoc(pDoc) {} |
134 | 136 |
135 FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb) const { | 137 FX_COLORREF CPDF_TransferFunc::TranslateColor(FX_COLORREF rgb) const { |
136 return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], | 138 return FXSYS_RGB(m_Samples[FXSYS_GetRValue(rgb)], |
137 m_Samples[256 + FXSYS_GetGValue(rgb)], | 139 m_Samples[256 + FXSYS_GetGValue(rgb)], |
138 m_Samples[512 + FXSYS_GetBValue(rgb)]); | 140 m_Samples[512 + FXSYS_GetBValue(rgb)]); |
139 } | 141 } |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 } else if (pFunc) { | 981 } else if (pFunc) { |
980 int size = dest_pitch * height; | 982 int size = dest_pitch * height; |
981 for (int i = 0; i < size; i++) { | 983 for (int i = 0; i < size; i++) { |
982 dest_buf[i] = transfers[src_buf[i]]; | 984 dest_buf[i] = transfers[src_buf[i]]; |
983 } | 985 } |
984 } else { | 986 } else { |
985 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 987 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
986 } | 988 } |
987 return pMask.release(); | 989 return pMask.release(); |
988 } | 990 } |
OLD | NEW |