| 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 <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 it->second->RemoveRef(); | 93 it->second->RemoveRef(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 CPDF_RenderOptions::CPDF_RenderOptions() | 96 CPDF_RenderOptions::CPDF_RenderOptions() |
| 97 : m_ColorMode(RENDER_COLOR_NORMAL), | 97 : m_ColorMode(RENDER_COLOR_NORMAL), |
| 98 m_Flags(RENDER_CLEARTYPE), | 98 m_Flags(RENDER_CLEARTYPE), |
| 99 m_Interpolation(0), | 99 m_Interpolation(0), |
| 100 m_AddFlags(0), | 100 m_AddFlags(0), |
| 101 m_pOCContext(nullptr), | 101 m_pOCContext(nullptr), |
| 102 m_dwLimitCacheSize(1024 * 1024 * 100), | 102 m_dwLimitCacheSize(1024 * 1024 * 100), |
| 103 m_HalftoneLimit(-1) {} | 103 m_HalftoneLimit(-1), |
| 104 m_bDrawAnnots(false) {} |
| 105 |
| 106 CPDF_RenderOptions::CPDF_RenderOptions(const CPDF_RenderOptions& rhs) |
| 107 : m_ColorMode(rhs.m_ColorMode), |
| 108 m_BackColor(rhs.m_BackColor), |
| 109 m_ForeColor(rhs.m_ForeColor), |
| 110 m_Flags(rhs.m_Flags), |
| 111 m_Interpolation(rhs.m_Interpolation), |
| 112 m_AddFlags(rhs.m_AddFlags), |
| 113 m_pOCContext(rhs.m_pOCContext), |
| 114 m_dwLimitCacheSize(rhs.m_dwLimitCacheSize), |
| 115 m_HalftoneLimit(rhs.m_HalftoneLimit), |
| 116 m_bDrawAnnots(rhs.m_bDrawAnnots) {} |
| 117 |
| 104 FX_ARGB CPDF_RenderOptions::TranslateColor(FX_ARGB argb) const { | 118 FX_ARGB CPDF_RenderOptions::TranslateColor(FX_ARGB argb) const { |
| 105 if (m_ColorMode == RENDER_COLOR_NORMAL) { | 119 if (m_ColorMode == RENDER_COLOR_NORMAL) { |
| 106 return argb; | 120 return argb; |
| 107 } | 121 } |
| 108 if (m_ColorMode == RENDER_COLOR_ALPHA) { | 122 if (m_ColorMode == RENDER_COLOR_ALPHA) { |
| 109 return argb; | 123 return argb; |
| 110 } | 124 } |
| 111 int a, r, g, b; | 125 int a, r, g, b; |
| 112 ArgbDecode(argb, a, r, g, b); | 126 ArgbDecode(argb, a, r, g, b); |
| 113 int gray = FXRGB2GRAY(r, g, b); | 127 int gray = FXRGB2GRAY(r, g, b); |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, | 1290 m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left, |
| 1277 m_Rect.top, m_Rect.Width(), m_Rect.Height()); | 1291 m_Rect.top, m_Rect.Width(), m_Rect.Height()); |
| 1278 } | 1292 } |
| 1279 } | 1293 } |
| 1280 | 1294 |
| 1281 #if defined _SKIA_SUPPORT_ | 1295 #if defined _SKIA_SUPPORT_ |
| 1282 void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const { | 1296 void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const { |
| 1283 m_pDevice->DebugVerifyBitmapIsPreMultiplied(); | 1297 m_pDevice->DebugVerifyBitmapIsPreMultiplied(); |
| 1284 } | 1298 } |
| 1285 #endif | 1299 #endif |
| OLD | NEW |