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: Move to .cpp 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
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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 FX_BOOL bFill, 616 FX_BOOL bFill,
617 FX_BOOL bStroke) { 617 FX_BOOL bStroke) {
618 if (!bStroke) { 618 if (!bStroke) {
619 CPDF_PathObject path; 619 CPDF_PathObject path;
620 std::vector<std::unique_ptr<CPDF_TextObject>> pCopy; 620 std::vector<std::unique_ptr<CPDF_TextObject>> pCopy;
621 pCopy.push_back(std::unique_ptr<CPDF_TextObject>(textobj->Clone())); 621 pCopy.push_back(std::unique_ptr<CPDF_TextObject>(textobj->Clone()));
622 path.m_bStroke = FALSE; 622 path.m_bStroke = FALSE;
623 path.m_FillType = FXFILL_WINDING; 623 path.m_FillType = FXFILL_WINDING;
624 path.m_ClipPath.AppendTexts(&pCopy); 624 path.m_ClipPath.AppendTexts(&pCopy);
625 path.m_ColorState = textobj->m_ColorState; 625 path.m_ColorState = textobj->m_ColorState;
626 path.m_Path.Emplace()->AppendRect(textobj->m_Left, textobj->m_Bottom, 626 path.m_Path.AppendRect(textobj->m_Left, textobj->m_Bottom, textobj->m_Right,
627 textobj->m_Right, textobj->m_Top); 627 textobj->m_Top);
628 path.m_Left = textobj->m_Left; 628 path.m_Left = textobj->m_Left;
629 path.m_Bottom = textobj->m_Bottom; 629 path.m_Bottom = textobj->m_Bottom;
630 path.m_Right = textobj->m_Right; 630 path.m_Right = textobj->m_Right;
631 path.m_Top = textobj->m_Top; 631 path.m_Top = textobj->m_Top;
632 RenderSingleObject(&path, pObj2Device); 632 RenderSingleObject(&path, pObj2Device);
633 return; 633 return;
634 } 634 }
635 CFX_FontCache* pCache; 635 CFX_FontCache* pCache;
636 if (pFont->m_pDocument) { 636 if (pFont->m_pDocument) {
637 pCache = pFont->m_pDocument->GetRenderData()->GetFontCache(); 637 pCache = pFont->m_pDocument->GetRenderData()->GetFontCache();
(...skipping 25 matching lines...) Expand all
663 } 663 }
664 CPDF_PathObject path; 664 CPDF_PathObject path;
665 path.m_GraphState = textobj->m_GraphState; 665 path.m_GraphState = textobj->m_GraphState;
666 path.m_ColorState = textobj->m_ColorState; 666 path.m_ColorState = textobj->m_ColorState;
667 CFX_Matrix matrix; 667 CFX_Matrix matrix;
668 if (charpos.m_bGlyphAdjust) 668 if (charpos.m_bGlyphAdjust)
669 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1], 669 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1],
670 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0); 670 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0);
671 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, 671 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX,
672 charpos.m_OriginY); 672 charpos.m_OriginY);
673 path.m_Path.Emplace()->Append(pPath, &matrix); 673 path.m_Path.Append(pPath, &matrix);
674 path.m_Matrix = *pTextMatrix; 674 path.m_Matrix = *pTextMatrix;
675 path.m_bStroke = bStroke; 675 path.m_bStroke = bStroke;
676 path.m_FillType = bFill ? FXFILL_WINDING : 0; 676 path.m_FillType = bFill ? FXFILL_WINDING : 0;
677 path.CalcBoundingBox(); 677 path.CalcBoundingBox();
678 ProcessPath(&path, pObj2Device); 678 ProcessPath(&path, pObj2Device);
679 } 679 }
680 } 680 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698