Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2372)

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp

Issue 2303553002: Make CPDF_GeneralState have a CPDF_GeneralStateData (Closed)
Patch Set: Nit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_text.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index fc06c0be5703d801bf429dd32f375f71a7301f5d..090060d2c0e5c9a2b7306dbc4bab76527dc38b4c 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -961,7 +961,9 @@ void CPDF_RenderStatus::DrawShadingPattern(CPDF_ShadingPattern* pattern,
CFX_Matrix matrix = *pattern->pattern_to_form();
matrix.Concat(*pObj2Device);
GetScaledMatrix(matrix);
- int alpha = pPageObj->m_GeneralState.GetAlpha(bStroke);
+ int alpha =
+ FXSYS_round(255 * (bStroke ? pPageObj->m_GeneralState.GetStrokeAlpha()
+ : pPageObj->m_GeneralState.GetFillAlpha()));
DrawShading(pattern, &matrix, rect, alpha,
m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
m_pDevice->RestoreState(false);
@@ -978,12 +980,12 @@ void CPDF_RenderStatus::ProcessShading(const CPDF_ShadingObject* pShadingObj,
CFX_Matrix matrix = pShadingObj->m_Matrix;
matrix.Concat(*pObj2Device);
DrawShading(pShadingObj->m_pShading, &matrix, rect,
- pShadingObj->m_GeneralState.GetAlpha(FALSE),
+ FXSYS_round(255 * pShadingObj->m_GeneralState.GetFillAlpha()),
m_Options.m_ColorMode == RENDER_COLOR_ALPHA);
}
void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
- const CPDF_PageObject* pPageObj,
+ CPDF_PageObject* pPageObj,
const CFX_Matrix* pObj2Device,
FX_BOOL bStroke) {
if (!pPattern->Load()) {
@@ -1167,7 +1169,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
m_pDevice->RestoreState(false);
}
-void CPDF_RenderStatus::DrawPathWithPattern(const CPDF_PathObject* pPathObj,
+void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj,
const CFX_Matrix* pObj2Device,
const CPDF_Color* pColor,
FX_BOOL bStroke) {
@@ -1181,7 +1183,7 @@ void CPDF_RenderStatus::DrawPathWithPattern(const CPDF_PathObject* pPathObj,
DrawShadingPattern(pShadingPattern, pPathObj, pObj2Device, bStroke);
}
-void CPDF_RenderStatus::ProcessPathPattern(const CPDF_PathObject* pPathObj,
+void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj,
const CFX_Matrix* pObj2Device,
int& filltype,
FX_BOOL& bStroke) {
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698