summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp10
-rw-r--r--core/fpdfapi/page/cpdf_page.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_page.h1
3 files changed, 9 insertions, 6 deletions
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<CPDF_Number>("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<CPDF_Name>("BM",
pPageObj->m_GeneralState.GetBlendMode());
}
diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp
index 092a1cad41..075aa9023d 100644
--- a/core/fpdfapi/page/cpdf_page.cpp
+++ b/core/fpdfapi/page/cpdf_page.cpp
@@ -183,7 +183,9 @@ int CPDF_Page::GetPageRotation() const {
bool GraphicsData::operator<(const GraphicsData& other) const {
if (fillAlpha != other.fillAlpha)
return fillAlpha < other.fillAlpha;
- return strokeAlpha < other.strokeAlpha;
+ if (strokeAlpha != other.strokeAlpha)
+ return strokeAlpha < other.strokeAlpha;
+ return blendType < other.blendType;
}
bool FontData::operator<(const FontData& other) const {
diff --git a/core/fpdfapi/page/cpdf_page.h b/core/fpdfapi/page/cpdf_page.h
index 77cc793d81..0a080a58ae 100644
--- a/core/fpdfapi/page/cpdf_page.h
+++ b/core/fpdfapi/page/cpdf_page.h
@@ -26,6 +26,7 @@ class CPDF_PageRenderContext;
struct GraphicsData {
float fillAlpha;
float strokeAlpha;
+ int blendType;
bool operator<(const GraphicsData& other) const;
};