Replaced redundant checks with a boolean variable.
In CFX_SkiaDeviceDriver::DrawPath(), replaced the redundant checks
for pGraphState && stroke_alpha with boolean variable
is_paint_stroke.
BUG=pdfium:1313
Change-Id: I31335faf3fb408d57940fcf444031dc493fc6604
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/55398
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index b183ce0..e64862a 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -1922,7 +1922,8 @@
if (fill_mode & FXFILL_FULLCOVER)
skPaint.setBlendMode(SkBlendMode::kPlus);
int stroke_alpha = FXARGB_A(stroke_color);
- if (pGraphState && stroke_alpha)
+ bool is_paint_stroke = !!(pGraphState && stroke_alpha);
+ if (is_paint_stroke)
PaintStroke(&skPaint, pGraphState, skMatrix);
SkPath skPath = BuildPath(pPathData);
SkAutoCanvasRestore scoped_save_restore(m_pCanvas, /*doSave=*/true);
@@ -1931,7 +1932,7 @@
skPath.setFillType(GetAlternateOrWindingFillType(fill_mode));
SkPath strokePath;
const SkPath* fillPath = &skPath;
- if (pGraphState && stroke_alpha) {
+ if (is_paint_stroke) {
if (m_bGroupKnockout) {
skPaint.getFillPath(skPath, &strokePath);
if (Op(skPath, strokePath, SkPathOp::kDifference_SkPathOp,
@@ -1948,7 +1949,7 @@
DebugShowSkiaDrawPath(this, m_pCanvas, skPaint, *fillPath);
m_pCanvas->drawPath(*fillPath, skPaint);
}
- if (pGraphState && stroke_alpha) {
+ if (is_paint_stroke) {
skPaint.setStyle(SkPaint::kStroke_Style);
skPaint.setColor(stroke_color);
#ifdef _SKIA_SUPPORT_PATHS_