Reland "[pdf] SkPDFGraphicStackState::Entry::fColor default"

This reverts commit d2cfcc3b5189237f59f4b1fa7ace4ab353444121.

Reason for revert: Adding build flag

Original change's description:
> Revert "[pdf] SkPDFGraphicStackState::Entry::fColor default"
>
> This reverts commit fc31f43cc40abc90d09cb11c220a54cd70211b70.
>
> Reason for revert: Changes some users expectations. Will re-land with a build flag.
>
> Original change's description:
> > [pdf] SkPDFGraphicStackState::Entry::fColor default
> >
> > Make the default value for SkPDFGraphicStackState::Entry::fColor a very
> > invalid color instead of opaque black in order to better match the
> > actual defaults in PDF.
> >
> > Currently if an SkPDFDevice is created and the first thing done with it
> > is to draw an opaque black path then the opaque black will not be
> > written to the PDF since it is currently assumed that the default will
> > be opaque black. However, because no color space is currently defined
> > for the fill and stroke colors and PDF otherwise has no default, the
> > path will instead be filled with an indeterminate opaque color (in the
> > case of poppler this will be cyan).
> >
> > Change-Id: I9f6a46c42fe8721d6a6f3dddc5ac986207a64bcd
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/635602
> > Reviewed-by: Herb Derby <herb@google.com>
> > Commit-Queue: Ben Wagner <bungeman@google.com>
>
> Change-Id: Ifc53ec0643549aad73cf15ac79bfe05c81d446a1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/636076
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Change-Id: I8bd567b89d411142446b04419ff4cd58263b77b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/636077
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
diff --git a/src/pdf/SkPDFGraphicStackState.cpp b/src/pdf/SkPDFGraphicStackState.cpp
index f93cc24..dfd2214 100644
--- a/src/pdf/SkPDFGraphicStackState.cpp
+++ b/src/pdf/SkPDFGraphicStackState.cpp
@@ -189,16 +189,13 @@
             SkPDFUtils::ApplyPattern(state.fShaderIndex, fContentStream);
             currentEntry()->fShaderIndex = state.fShaderIndex;
         }
-    } else {
-        if (state.fColor != currentEntry()->fColor ||
-                currentEntry()->fShaderIndex >= 0) {
-            emit_pdf_color(state.fColor, fContentStream);
-            fContentStream->writeText("RG ");
-            emit_pdf_color(state.fColor, fContentStream);
-            fContentStream->writeText("rg\n");
-            currentEntry()->fColor = state.fColor;
-            currentEntry()->fShaderIndex = -1;
-        }
+    } else if (state.fColor != currentEntry()->fColor || currentEntry()->fShaderIndex >= 0) {
+        emit_pdf_color(state.fColor, fContentStream);
+        fContentStream->writeText("RG ");
+        emit_pdf_color(state.fColor, fContentStream);
+        fContentStream->writeText("rg\n");
+        currentEntry()->fColor = state.fColor;
+        currentEntry()->fShaderIndex = -1;
     }
 
     if (state.fGraphicStateIndex != currentEntry()->fGraphicStateIndex) {
diff --git a/src/pdf/SkPDFGraphicStackState.h b/src/pdf/SkPDFGraphicStackState.h
index 97cc969..d4d6b4e 100644
--- a/src/pdf/SkPDFGraphicStackState.h
+++ b/src/pdf/SkPDFGraphicStackState.h
@@ -6,6 +6,7 @@
 #include "include/core/SkColor.h"
 #include "include/core/SkMatrix.h"
 #include "include/core/SkScalar.h"
+#include "include/private/base/SkFloatingPoint.h"
 #include "src/core/SkClipStack.h"
 
 class SkDynamicMemoryWStream;
@@ -16,7 +17,12 @@
     struct Entry {
         SkMatrix fMatrix = SkMatrix::I();
         uint32_t fClipStackGenID = SkClipStack::kWideOpenGenID;
-        SkColor4f fColor = {0, 0, 0, 1};
+        SkColor4f fColor =
+#ifdef SK_IGNORE_FIX_FOR_PDF_UNDEFINED_COLOR
+            {0, 0, 0, 1};
+#else
+            {SK_FloatNaN, SK_FloatNaN, SK_FloatNaN, SK_FloatNaN};
+#endif
         SkScalar fTextScaleX = 1;  // Zero means we don't care what the value is.
         int fShaderIndex = -1;
         int fGraphicStateIndex = -1;