Remove not reachable branch in fxge code.

BUG=chromium:805881

Change-Id: I5f920649f425d0cfc47c780b36ed70f23cbe1299
Reviewed-on: https://pdfium-review.googlesource.com/24191
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index ab8efff..8275840 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -1856,7 +1856,7 @@
 
 bool CFX_SkiaDeviceDriver::SetClip_PathStroke(
     const CFX_PathData* pPathData,         // path info
-    const CFX_Matrix* pObject2Device,      // optional transformation
+    const CFX_Matrix* pObject2Device,      // required transformation
     const CFX_GraphStateData* pGraphState  // graphic state, for pen attributes
     ) {
   bool cached = m_pCache->SetClipStroke(pPathData, pObject2Device, pGraphState);
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index 7dfdef4..c2e6c01 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -50,7 +50,7 @@
   /** Set clipping path using stroked region */
   bool SetClip_PathStroke(
       const CFX_PathData* pPathData,     // path info
-      const CFX_Matrix* pObject2Device,  // optional transformation
+      const CFX_Matrix* pObject2Device,  // required transformation
       const CFX_GraphStateData*
           pGraphState)  // graphic state, for pen attributes
       override;
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index 1513c07..417a1d7 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -234,23 +234,19 @@
                                         const CFX_GraphStateData* pGraphState) {
   StartRendering();
   SetGraphState(pGraphState);
-  if (pObject2Device) {
-    std::ostringstream buf;
-    buf << "mx Cm [" << pObject2Device->a << " " << pObject2Device->b << " "
-        << pObject2Device->c << " " << pObject2Device->d << " "
-        << pObject2Device->e << " " << pObject2Device->f << "]cm ";
-    m_pStream->WriteBlock(buf.str().c_str(), buf.tellp());
-  }
+
+  std::ostringstream buf;
+  buf << "mx Cm [" << pObject2Device->a << " " << pObject2Device->b << " "
+      << pObject2Device->c << " " << pObject2Device->d << " "
+      << pObject2Device->e << " " << pObject2Device->f << "]cm ";
+  m_pStream->WriteBlock(buf.str().c_str(), buf.tellp());
 
   OutputPath(pPathData, nullptr);
   CFX_FloatRect rect = pPathData->GetBoundingBox(pGraphState->m_LineWidth,
                                                  pGraphState->m_MiterLimit);
   m_ClipBox.Intersect(pObject2Device->TransformRect(rect).GetOuterRect());
 
-  m_pStream->WriteString("strokepath W n");
-  if (pObject2Device)
-    m_pStream->WriteString(" sm");
-  m_pStream->WriteString("\n");
+  m_pStream->WriteString("strokepath W n sm\n");
 }
 
 bool CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 492b0b5..41dc220 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -91,28 +91,24 @@
   return true;
 }
 
-HPEN CreatePen(const CFX_GraphStateData* pGraphState,
-               const CFX_Matrix* pMatrix,
-               uint32_t argb) {
-  float width;
-  float scale = 1.f;
-  if (pMatrix)
+HPEN CreateExtPen(const CFX_GraphStateData* pGraphState,
+                  const CFX_Matrix* pMatrix,
+                  uint32_t argb) {
+  ASSERT(pGraphState);
+
+  float scale = 1.0f;
+  if (pMatrix) {
     scale = fabs(pMatrix->a) > fabs(pMatrix->b) ? fabs(pMatrix->a)
                                                 : fabs(pMatrix->b);
-  if (pGraphState) {
-    width = scale * pGraphState->m_LineWidth;
-  } else {
-    width = 1.0f;
   }
+  float width = std::max(scale * pGraphState->m_LineWidth, 1.0f);
+
   uint32_t PenStyle = PS_GEOMETRIC;
-  if (width < 1) {
-    width = 1;
-  }
-  if (pGraphState->m_DashCount) {
+  if (pGraphState->m_DashCount)
     PenStyle |= PS_USERSTYLE;
-  } else {
+  else
     PenStyle |= PS_SOLID;
-  }
+
   switch (pGraphState->m_LineCap) {
     case 0:
       PenStyle |= PS_ENDCAP_FLAT;
@@ -135,6 +131,7 @@
       PenStyle |= PS_JOIN_BEVEL;
       break;
   }
+
   int a;
   FX_COLORREF rgb;
   std::tie(a, rgb) = ArgbToColorRef(argb);
@@ -1005,7 +1002,7 @@
         ((m_DeviceClass != FXDC_PRINTER && !(fill_mode & FXFILL_FULLCOVER)) ||
          (pGraphState && pGraphState->m_DashCount))) {
       if (!((!pMatrix || !pMatrix->WillScale()) && pGraphState &&
-            pGraphState->m_LineWidth == 1.f &&
+            pGraphState->m_LineWidth == 1.0f &&
             (pPathData->GetPoints().size() == 5 ||
              pPathData->GetPoints().size() == 4) &&
             pPathData->IsRect())) {
@@ -1023,7 +1020,7 @@
   HBRUSH hBrush = nullptr;
   if (pGraphState && stroke_alpha) {
     SetMiterLimit(m_hDC, pGraphState->m_MiterLimit, nullptr);
-    hPen = CreatePen(pGraphState, pMatrix, stroke_color);
+    hPen = CreateExtPen(pGraphState, pMatrix, stroke_color);
     hPen = (HPEN)SelectObject(m_hDC, hPen);
   }
   if (fill_mode && fill_alpha) {
@@ -1111,7 +1108,7 @@
     const CFX_PathData* pPathData,
     const CFX_Matrix* pMatrix,
     const CFX_GraphStateData* pGraphState) {
-  HPEN hPen = CreatePen(pGraphState, pMatrix, 0xff000000);
+  HPEN hPen = CreateExtPen(pGraphState, pMatrix, 0xff000000);
   hPen = (HPEN)SelectObject(m_hDC, hPen);
   SetPathToDC(m_hDC, pPathData, pMatrix);
   WidenPath(m_hDC);
diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp
index d784a0f..64c8ea7 100644
--- a/core/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/fxge/win32/fx_win32_gdipext.cpp
@@ -730,13 +730,12 @@
                          bool bTextMode) {
   CGdiplusExt& GdiplusExt =
       ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
-  float width = pGraphState ? pGraphState->m_LineWidth : 1.0f;
+  float width = pGraphState->m_LineWidth;
   if (!bTextMode) {
     float unit = pMatrix
                      ? 1.0f / ((pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2)
                      : 1.0f;
-    if (width < unit)
-      width = unit;
+    width = std::max(width, unit);
   }
   GpPen* pPen = nullptr;
   CallFunc(GdipCreatePen1)((Gdiplus::ARGB)argb, width, UnitWorld, &pPen);