summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit/cpdf_pagecontentgenerator.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-02-06 12:01:21 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-06 18:12:42 +0000
commitf9baca8709472f71fe0e5bcae95717b7f712b4a5 (patch)
tree19c773256d3063fa67ada0500cd4f162584bec06 /core/fpdfapi/edit/cpdf_pagecontentgenerator.h
parent3c056ae5599be463216fb1883c710157f019acc2 (diff)
downloadpdfium-f9baca8709472f71fe0e5bcae95717b7f712b4a5.tar.xz
Add support for fill and stroke RGBA in CPDF_PageContentGenerator
CPDF_PageObject is a CPDF_GraphicStates, which allows us to add graphics information to the object itself. The RGB can be added easily in the stream. The alpha parameter needs to be in a dictionary contained in the ExtGState, which should be part of the page's resources. BUG=pdfium:661 Change-Id: Id99b2ece7aa201e3550c765ac2b5eeff4b43fc48 Reviewed-on: https://pdfium-review.googlesource.com/2530 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit/cpdf_pagecontentgenerator.h')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.h b/core/fpdfapi/edit/cpdf_pagecontentgenerator.h
index c74652e206..e48ea4a7c9 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.h
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.h
@@ -7,6 +7,7 @@
#ifndef CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_
#define CORE_FPDFAPI_EDIT_CPDF_PAGECONTENTGENERATOR_H_
+#include <map>
#include <vector>
#include "core/fxcrt/fx_basic.h"
@@ -26,14 +27,21 @@ class CPDF_PageContentGenerator {
void GenerateContent();
private:
- friend class cpdf_pagecontentgenerator_ProcessRect_Test;
- friend class cpdf_pagecontentgenerator_ProcessPath_Test;
+ friend class CPDF_PageContentGeneratorTest;
void ProcessPath(CFX_ByteTextBuf* buf, CPDF_PathObject* pPathObj);
void ProcessImage(CFX_ByteTextBuf* buf, CPDF_ImageObject* pImageObj);
+ void ProcessGraphics(CFX_ByteTextBuf* buf, CPDF_PageObject* pPageObj);
CFX_ByteString RealizeResource(uint32_t dwResourceObjNum,
const CFX_ByteString& bsType);
+ struct GraphicsData {
+ FX_FLOAT fillAlpha;
+ FX_FLOAT strokeAlpha;
+ bool operator<(const GraphicsData& other) const;
+ };
+
+ std::map<GraphicsData, CFX_ByteString> m_GraphicsMap;
CPDF_Page* const m_pPage;
CPDF_Document* const m_pDocument;
std::vector<CPDF_PageObject*> m_pageObjects;