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

Side by Side Diff: core/fpdfapi/fpdf_render/fpdf_render_text.cpp

Issue 2305103002: Make CPDF_Path have a CFX_Path rather than inheriting (Closed)
Patch Set: rebase Created 4 years, 3 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
« no previous file with comments | « core/fpdfapi/fpdf_page/include/cpdf_path.h ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 FX_BOOL bFill, 611 FX_BOOL bFill,
612 FX_BOOL bStroke) { 612 FX_BOOL bStroke) {
613 if (!bStroke) { 613 if (!bStroke) {
614 CPDF_PathObject path; 614 CPDF_PathObject path;
615 std::vector<std::unique_ptr<CPDF_TextObject>> pCopy; 615 std::vector<std::unique_ptr<CPDF_TextObject>> pCopy;
616 pCopy.push_back(std::unique_ptr<CPDF_TextObject>(textobj->Clone())); 616 pCopy.push_back(std::unique_ptr<CPDF_TextObject>(textobj->Clone()));
617 path.m_bStroke = FALSE; 617 path.m_bStroke = FALSE;
618 path.m_FillType = FXFILL_WINDING; 618 path.m_FillType = FXFILL_WINDING;
619 path.m_ClipPath.AppendTexts(&pCopy); 619 path.m_ClipPath.AppendTexts(&pCopy);
620 path.m_ColorState = textobj->m_ColorState; 620 path.m_ColorState = textobj->m_ColorState;
621 path.m_Path.Emplace()->AppendRect(textobj->m_Left, textobj->m_Bottom, 621 path.m_Path.AppendRect(textobj->m_Left, textobj->m_Bottom, textobj->m_Right,
622 textobj->m_Right, textobj->m_Top); 622 textobj->m_Top);
623 path.m_Left = textobj->m_Left; 623 path.m_Left = textobj->m_Left;
624 path.m_Bottom = textobj->m_Bottom; 624 path.m_Bottom = textobj->m_Bottom;
625 path.m_Right = textobj->m_Right; 625 path.m_Right = textobj->m_Right;
626 path.m_Top = textobj->m_Top; 626 path.m_Top = textobj->m_Top;
627 RenderSingleObject(&path, pObj2Device); 627 RenderSingleObject(&path, pObj2Device);
628 return; 628 return;
629 } 629 }
630 CFX_FontCache* pCache; 630 CFX_FontCache* pCache;
631 if (pFont->m_pDocument) { 631 if (pFont->m_pDocument) {
632 pCache = pFont->m_pDocument->GetRenderData()->GetFontCache(); 632 pCache = pFont->m_pDocument->GetRenderData()->GetFontCache();
(...skipping 25 matching lines...) Expand all
658 } 658 }
659 CPDF_PathObject path; 659 CPDF_PathObject path;
660 path.m_GraphState = textobj->m_GraphState; 660 path.m_GraphState = textobj->m_GraphState;
661 path.m_ColorState = textobj->m_ColorState; 661 path.m_ColorState = textobj->m_ColorState;
662 CFX_Matrix matrix; 662 CFX_Matrix matrix;
663 if (charpos.m_bGlyphAdjust) 663 if (charpos.m_bGlyphAdjust)
664 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1], 664 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
665 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0); 665 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
666 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, 666 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX,
667 charpos.m_OriginY); 667 charpos.m_OriginY);
668 path.m_Path.Emplace()->Append(pPath, &matrix); 668 path.m_Path.Append(pPath, &matrix);
669 path.m_Matrix = *pTextMatrix; 669 path.m_Matrix = *pTextMatrix;
670 path.m_bStroke = bStroke; 670 path.m_bStroke = bStroke;
671 path.m_FillType = bFill ? FXFILL_WINDING : 0; 671 path.m_FillType = bFill ? FXFILL_WINDING : 0;
672 path.CalcBoundingBox(); 672 path.CalcBoundingBox();
673 ProcessPath(&path, pObj2Device); 673 ProcessPath(&path, pObj2Device);
674 } 674 }
675 } 675 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/include/cpdf_path.h ('k') | fpdfsdk/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698