From a4ad01fe03ffdd1806d31a9d7bb820f6a69a0afb Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Wed, 15 Feb 2017 16:26:48 -0500 Subject: Move generated graphics and font maps to CPDF_Page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new CPDF_PageContentGenerator is created for every call of FPDFPage_GenerateContent, so having the maps there will cause duplicated resources to be created every time this method is called. Thus it is better to move these to the page. Change-Id: I47804f79790fc5354f8a94b6387d66b65eda5a20 Reviewed-on: https://pdfium-review.googlesource.com/2717 Reviewed-by: Tom Sepez Commit-Queue: Nicolás Peña --- core/fpdfapi/page/cpdf_page.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/fpdfapi/page/cpdf_page.cpp') diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp index ba30ce57c3..46123ab42e 100644 --- a/core/fpdfapi/page/cpdf_page.cpp +++ b/core/fpdfapi/page/cpdf_page.cpp @@ -175,3 +175,13 @@ CFX_Matrix CPDF_Page::GetDisplayMatrix(int xPos, x0, y0)); return matrix; } + +bool GraphicsData::operator<(const GraphicsData& other) const { + if (fillAlpha != other.fillAlpha) + return fillAlpha < other.fillAlpha; + return strokeAlpha < other.strokeAlpha; +} + +bool FontData::operator<(const FontData& other) const { + return baseFont < other.baseFont; +} -- cgit v1.2.3