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

Unified Diff: core/fxge/agg/fx_agg_driver.cpp

Issue 2459673002: Fix some FX_BOOL / int noise in core/fx* (Closed)
Patch Set: Fix some FX_BOOL / int noise in core/fx* Created 4 years, 2 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/fxcodec/codec/fx_codec_fax.cpp ('k') | core/fxge/ge/cfx_renderdevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/agg/fx_agg_driver.cpp
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index d3be763def2b15e31131751b4abee9411a224f1e..ed6410b4c38bb02a9103de4a1c147b21ab5867fd 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -240,7 +240,7 @@ FX_BOOL DibSetPixel(CFX_DIBitmap* pDevice,
uint32_t color,
int alpha_flag,
void* pIccTransform) {
- FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bObjCMYK = !!FXGETFLAG_COLORTYPE(alpha_flag);
int alpha = bObjCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
if (pIccTransform) {
CCodec_IccModule* pIccModule =
@@ -1315,7 +1315,7 @@ class CFX_Renderer {
m_pClipMask = m_pClipRgn->GetMask().GetObject();
}
m_bFullCover = bFullCover;
- FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
+ FX_BOOL bObjectCMYK = !!FXGETFLAG_COLORTYPE(alpha_flag);
FX_BOOL bDeviceCMYK = pDevice->IsCmykImage();
m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
CCodec_IccModule* pIccModule = nullptr;
@@ -1468,8 +1468,9 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
rasterizer.filling_rule((fill_mode & 3) == FXFILL_WINDING
? agg::fill_non_zero
: agg::fill_even_odd);
- if (!RenderRasterizer(rasterizer, fill_color, fill_mode & FXFILL_FULLCOVER,
- FALSE, 0, nullptr)) {
+ if (!RenderRasterizer(rasterizer, fill_color,
+ !!(fill_mode & FXFILL_FULLCOVER), FALSE, 0,
+ nullptr)) {
return FALSE;
}
}
@@ -1484,13 +1485,10 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)),
(FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
RasterizeStroke(rasterizer, path_data.m_PathData, nullptr, pGraphState, 1,
- FALSE, fill_mode & FX_STROKE_TEXT_MODE);
- if (!RenderRasterizer(rasterizer, stroke_color,
- fill_mode & FXFILL_FULLCOVER, m_bGroupKnockout, 0,
- nullptr)) {
- return FALSE;
- }
- return TRUE;
+ FALSE, !!(fill_mode & FX_STROKE_TEXT_MODE));
+ return RenderRasterizer(rasterizer, stroke_color,
+ !!(fill_mode & FXFILL_FULLCOVER), m_bGroupKnockout,
+ 0, nullptr);
}
CFX_Matrix matrix1;
CFX_Matrix matrix2;
@@ -1512,12 +1510,10 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)),
(FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
RasterizeStroke(rasterizer, path_data.m_PathData, &matrix2, pGraphState,
- matrix1.a, FALSE, fill_mode & FX_STROKE_TEXT_MODE);
- if (!RenderRasterizer(rasterizer, stroke_color, fill_mode & FXFILL_FULLCOVER,
- m_bGroupKnockout, 0, nullptr)) {
- return FALSE;
- }
- return TRUE;
+ matrix1.a, FALSE, !!(fill_mode & FX_STROKE_TEXT_MODE));
+ return RenderRasterizer(rasterizer, stroke_color,
+ !!(fill_mode & FXFILL_FULLCOVER), m_bGroupKnockout, 0,
+ nullptr);
}
FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, int y, uint32_t color) {
@@ -1752,8 +1748,8 @@ bool CFX_FxgeDevice::Create(int width,
return false;
}
SetBitmap(pBitmap);
- SetDeviceDriver(pdfium::MakeUnique<CFX_AggDeviceDriver>(pBitmap, FALSE,
- pOriDevice, FALSE));
+ SetDeviceDriver(pdfium::MakeUnique<CFX_AggDeviceDriver>(pBitmap, false,
Tom Sepez 2016/10/27 17:59:29 Note: Because FALSE gets redefined by third_party
+ pOriDevice, false));
return true;
}
« no previous file with comments | « core/fxcodec/codec/fx_codec_fax.cpp ('k') | core/fxge/ge/cfx_renderdevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698