Separate and update PDF_DIFF_TRACE_IN_PNG

Move its functionality out of readToken() and into its own class.
Callers of the previous readToken() now call
SkPdfNativeTokenizer::readToken(), which in turn calls a function
for writing the diff to a file, if the caller requests it and
PDF_TRACE_DIFF_IN_PNG is defined.

Do not attempt to draw a diff for compatibility sections, which we
do not draw.

Use SkString to handle string manipulation.

Hide globals only used by PDF_TRACE_DIFF_IN_PNG behind that flag.

Remove hasVisualEffects, which always returns true.

Rename gLastOpKeyword to gOpCounter for clarity.

In SkPdfNativeTokenizer, set fEmpty to true when the entire stream
has been read.

Use SkBitmap::copyTo instead of manually copying an SkBitmap.

Builds on https://codereview.chromium.org/79933003/

R=mtklein@google.com

Review URL: https://codereview.chromium.org/80463005

git-svn-id: http://skia.googlecode.com/svn/trunk/gyp@12436 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/pdfviewer_lib.gyp b/pdfviewer_lib.gyp
index 405d02c..1bfc049 100644
--- a/pdfviewer_lib.gyp
+++ b/pdfviewer_lib.gyp
@@ -12,13 +12,14 @@
         # FIXME: Include directory is named "inc" (instead of "include") in
         # order to not be considered the public API.
         '../experimental/PdfViewer/inc/SkPdfContext.h',
+        '../experimental/PdfViewer/inc/SkPdfDiffEncoder.h',
         '../experimental/PdfViewer/inc/SkPdfRenderer.h',
         '../experimental/PdfViewer/inc/SkPdfTokenLooper.h',
 
         '../experimental/PdfViewer/src/SkPdfContext.cpp',
         '../experimental/PdfViewer/src/SkPdfRenderer.cpp',
         '../experimental/PdfViewer/src/SkTDStackNester.h',
-        '../experimental/PdfViewer/src/SkPdfTokenLooper.cpp',
+        '../experimental/PdfViewer/src/SkPdfDiffEncoder.cpp',
 
         '../experimental/PdfViewer/SkPdfGraphicsState.cpp',
         '../experimental/PdfViewer/SkPdfFont.cpp',