Chromium Code Reviews| 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 "core/include/fpdfapi/fpdf_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
| 10 #include "core/include/fpdfapi/fpdf_render.h" | 10 #include "core/include/fpdfapi/fpdf_render.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 } | 536 } |
| 537 CFX_GraphStateData graphState(*pPathObj->m_GraphState); | 537 CFX_GraphStateData graphState(*pPathObj->m_GraphState); |
| 538 if (m_Options.m_Flags & RENDER_THINLINE) { | 538 if (m_Options.m_Flags & RENDER_THINLINE) { |
| 539 graphState.m_LineWidth = 0; | 539 graphState.m_LineWidth = 0; |
| 540 } | 540 } |
| 541 return m_pDevice->DrawPath(pPathObj->m_Path, &path_matrix, &graphState, | 541 return m_pDevice->DrawPath(pPathObj->m_Path, &path_matrix, &graphState, |
| 542 fill_argb, stroke_argb, FillType, 0, NULL, | 542 fill_argb, stroke_argb, FillType, 0, NULL, |
| 543 m_curBlend); | 543 m_curBlend); |
| 544 } | 544 } |
| 545 CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const { | 545 CPDF_TransferFunc* CPDF_RenderStatus::GetTransferFunc(CPDF_Object* pObj) const { |
| 546 ASSERT(pObj != NULL); | 546 ASSERT(pObj); |
| 547 CPDF_DocRenderData* pDocCache = m_pContext->m_pDocument->GetRenderData(); | 547 CPDF_DocRenderData* pDocCache = m_pContext->m_pDocument->GetRenderData(); |
| 548 if (!pDocCache) { | 548 if (!pDocCache) { |
|
Tom Sepez
2015/12/14 19:14:08
nit: use ? oper.
Lei Zhang
2015/12/15 01:38:32
Done.
| |
| 549 return NULL; | 549 return NULL; |
| 550 } | 550 } |
| 551 return pDocCache->GetTransferFunc(pObj); | 551 return pDocCache->GetTransferFunc(pObj); |
| 552 } | 552 } |
| 553 FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, | 553 FX_ARGB CPDF_RenderStatus::GetFillArgb(const CPDF_PageObject* pObj, |
| 554 FX_BOOL bType3) const { | 554 FX_BOOL bType3) const { |
| 555 CPDF_ColorStateData* pColorData = | 555 CPDF_ColorStateData* pColorData = |
| 556 (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState; | 556 (CPDF_ColorStateData*)(const CPDF_ColorStateData*)pObj->m_ColorState; |
| 557 if (m_pType3Char && !bType3 && | 557 if (m_pType3Char && !bType3 && |
| 558 (!m_pType3Char->m_bColored || | 558 (!m_pType3Char->m_bColored || |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1348 | 1348 |
| 1349 CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer() {} | 1349 CPDF_ScaledRenderBuffer::~CPDF_ScaledRenderBuffer() {} |
| 1350 | 1350 |
| 1351 #define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024) | 1351 #define _FPDFAPI_IMAGESIZE_LIMIT_ (30 * 1024 * 1024) |
| 1352 FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, | 1352 FX_BOOL CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext, |
| 1353 CFX_RenderDevice* pDevice, | 1353 CFX_RenderDevice* pDevice, |
| 1354 FX_RECT* pRect, | 1354 FX_RECT* pRect, |
| 1355 const CPDF_PageObject* pObj, | 1355 const CPDF_PageObject* pObj, |
| 1356 const CPDF_RenderOptions* pOptions, | 1356 const CPDF_RenderOptions* pOptions, |
| 1357 int max_dpi) { | 1357 int max_dpi) { |
| 1358 FXSYS_assert(pRect != NULL); | 1358 FXSYS_assert(pRect); |
|
Tom Sepez
2015/12/14 21:10:27
meh. Only called in one place with pRect as &local
Lei Zhang
2015/12/15 01:38:32
Done.
| |
| 1359 m_pDevice = pDevice; | 1359 m_pDevice = pDevice; |
| 1360 if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) { | 1360 if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_GET_BITS) { |
| 1361 return TRUE; | 1361 return TRUE; |
| 1362 } | 1362 } |
| 1363 m_pContext = pContext; | 1363 m_pContext = pContext; |
| 1364 m_Rect = *pRect; | 1364 m_Rect = *pRect; |
| 1365 m_pObject = pObj; | 1365 m_pObject = pObj; |
| 1366 m_Matrix.TranslateI(-pRect->left, -pRect->top); | 1366 m_Matrix.TranslateI(-pRect->left, -pRect->top); |
| 1367 int horz_size = pDevice->GetDeviceCaps(FXDC_HORZ_SIZE); | 1367 int horz_size = pDevice->GetDeviceCaps(FXDC_HORZ_SIZE); |
| 1368 int vert_size = pDevice->GetDeviceCaps(FXDC_VERT_SIZE); | 1368 int vert_size = pDevice->GetDeviceCaps(FXDC_VERT_SIZE); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1422 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) { | 1422 item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) { |
| 1423 CPDF_Dictionary* pOCG = | 1423 CPDF_Dictionary* pOCG = |
| 1424 ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); | 1424 ToDictionary(static_cast<CPDF_Object*>(item.GetParam())); |
| 1425 if (!CheckOCGVisible(pOCG)) { | 1425 if (!CheckOCGVisible(pOCG)) { |
| 1426 return FALSE; | 1426 return FALSE; |
| 1427 } | 1427 } |
| 1428 } | 1428 } |
| 1429 } | 1429 } |
| 1430 return TRUE; | 1430 return TRUE; |
| 1431 } | 1431 } |
| OLD | NEW |