PDF: Now threadsafe!

The PDF canvas is now just as threadsafe as any other Skia canvas.

DM updated to thread PDF tests.

SkDocument_PDF now owns SkPDFCanon, and pointers to that canon are
passed around to all classes that need access to the canon.

BUG=skia:2683

Review URL: https://codereview.chromium.org/944643002
diff --git a/src/pdf/SkPDFGraphicState.h b/src/pdf/SkPDFGraphicState.h
index a759d56..b26e4a0 100644
--- a/src/pdf/SkPDFGraphicState.h
+++ b/src/pdf/SkPDFGraphicState.h
@@ -47,7 +47,8 @@
      *  other references.
      *  @param paint  The SkPaint to emulate.
      */
-    static SkPDFGraphicState* GetGraphicStateForPaint(const SkPaint& paint);
+    static SkPDFGraphicState* GetGraphicStateForPaint(SkPDFCanon* canon,
+                                                      const SkPaint& paint);
 
     /** Make a graphic state that only sets the passed soft mask. The
      *  reference count of the object is incremented and it is the caller's
@@ -74,12 +75,12 @@
     static SkPDFGraphicState* CreateNoSMaskGraphicState();
 
 private:
+    SkPDFCanon* const fCanon;
     const SkPaint fPaint;
     bool fPopulated;
-    bool fSMask;
 
     SkPDFGraphicState();
-    explicit SkPDFGraphicState(const SkPaint& paint);
+    SkPDFGraphicState(SkPDFCanon* canon, const SkPaint& paint);
 
     void populateDict();