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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 status.m_Type3FontCache.Add(pType3Font); | 430 status.m_Type3FontCache.Add(pType3Font); |
431 m_pDevice->SaveState(); | 431 m_pDevice->SaveState(); |
432 status.RenderObjectList(pType3Char->m_pForm.get(), &matrix); | 432 status.RenderObjectList(pType3Char->m_pForm.get(), &matrix); |
433 m_pDevice->RestoreState(false); | 433 m_pDevice->RestoreState(false); |
434 } else { | 434 } else { |
435 CFX_FloatRect rect_f = pType3Char->m_pForm->CalcBoundingBox(); | 435 CFX_FloatRect rect_f = pType3Char->m_pForm->CalcBoundingBox(); |
436 rect_f.Transform(&matrix); | 436 rect_f.Transform(&matrix); |
437 FX_RECT rect = rect_f.GetOutterRect(); | 437 FX_RECT rect = rect_f.GetOutterRect(); |
438 CFX_FxgeDevice bitmap_device; | 438 CFX_FxgeDevice bitmap_device; |
439 if (!bitmap_device.Create((int)(rect.Width() * sa), | 439 if (!bitmap_device.Create((int)(rect.Width() * sa), |
440 (int)(rect.Height() * sd), FXDIB_Argb)) { | 440 (int)(rect.Height() * sd), FXDIB_Argb, |
| 441 nullptr)) { |
441 return TRUE; | 442 return TRUE; |
442 } | 443 } |
443 bitmap_device.GetBitmap()->Clear(0); | 444 bitmap_device.GetBitmap()->Clear(0); |
444 CPDF_RenderStatus status; | 445 CPDF_RenderStatus status; |
445 status.Initialize(m_pContext, &bitmap_device, NULL, NULL, this, pStates, | 446 status.Initialize(m_pContext, &bitmap_device, NULL, NULL, this, pStates, |
446 &Options, pType3Char->m_pForm->m_Transparency, | 447 &Options, pType3Char->m_pForm->m_Transparency, |
447 m_bDropObjects, pFormResource, FALSE, pType3Char, | 448 m_bDropObjects, pFormResource, FALSE, pType3Char, |
448 fill_argb); | 449 fill_argb); |
449 status.m_Type3FontCache.Append(m_Type3FontCache); | 450 status.m_Type3FontCache.Append(m_Type3FontCache); |
450 status.m_Type3FontCache.Add(pType3Font); | 451 status.m_Type3FontCache.Add(pType3Font); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, | 777 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, |
777 charpos.m_OriginY); | 778 charpos.m_OriginY); |
778 path.m_Path.New()->Append(pPath, &matrix); | 779 path.m_Path.New()->Append(pPath, &matrix); |
779 path.m_Matrix = *pTextMatrix; | 780 path.m_Matrix = *pTextMatrix; |
780 path.m_bStroke = bStroke; | 781 path.m_bStroke = bStroke; |
781 path.m_FillType = bFill ? FXFILL_WINDING : 0; | 782 path.m_FillType = bFill ? FXFILL_WINDING : 0; |
782 path.CalcBoundingBox(); | 783 path.CalcBoundingBox(); |
783 ProcessPath(&path, pObj2Device); | 784 ProcessPath(&path, pObj2Device); |
784 } | 785 } |
785 } | 786 } |
OLD | NEW |