From 603a31d0c509c7ce3c2709dcb5377a78e6ce4815 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Wed, 14 Jun 2017 11:41:18 -0400 Subject: Add blend to GraphicsData MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CL [1] added the ability to set the blend mode for a page object. This CL adds the corresponding component to GraphicsData since the blend mode is part of ExtGSState. In addition, a test using the SetBlendMode method is added. [1] https://pdfium-review.googlesource.com/c/5953/ Bug: pdfium:720 Change-Id: I49120284345185c200a45cc3b37ec59f0658e2dc Reviewed-on: https://pdfium-review.googlesource.com/6510 Commit-Queue: Nicolás Peña Reviewed-by: dsinclair --- core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/edit') diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp index e06c28d7ae..8b39a7a136 100644 --- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp +++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp @@ -269,10 +269,10 @@ void CPDF_PageContentGenerator::ProcessGraphics(std::ostringstream* buf, GraphicsData graphD; graphD.fillAlpha = pPageObj->m_GeneralState.GetFillAlpha(); graphD.strokeAlpha = pPageObj->m_GeneralState.GetStrokeAlpha(); - int blend_type = pPageObj->m_GeneralState.GetBlendType(); + graphD.blendType = pPageObj->m_GeneralState.GetBlendType(); if (graphD.fillAlpha == 1.0f && graphD.strokeAlpha == 1.0f && - (blend_type == FXDIB_BLEND_UNSUPPORTED || - blend_type == FXDIB_BLEND_NORMAL)) { + (graphD.blendType == FXDIB_BLEND_UNSUPPORTED || + graphD.blendType == FXDIB_BLEND_NORMAL)) { return; } @@ -288,8 +288,8 @@ void CPDF_PageContentGenerator::ProcessGraphics(std::ostringstream* buf, if (graphD.strokeAlpha != 1.0f) gsDict->SetNewFor("CA", graphD.strokeAlpha); - if (blend_type != FXDIB_BLEND_UNSUPPORTED && - blend_type != FXDIB_BLEND_NORMAL) { + if (graphD.blendType != FXDIB_BLEND_UNSUPPORTED && + graphD.blendType != FXDIB_BLEND_NORMAL) { gsDict->SetNewFor("BM", pPageObj->m_GeneralState.GetBlendMode()); } -- cgit v1.2.3