[PDF] Improve complex xfer mode support.

Xfer mode applies only to the shape of the source drawing, not everything in the clip as in currently implemented.  It's just that the current gm examples draw a shape that fills the visible layer.

R=edisonn@google.com, reed@google.com

Review URL: https://codereview.appspot.com/4631078

git-svn-id: http://skia.googlecode.com/svn/trunk/include@12034 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/pdf/SkPDFDevice.h b/pdf/SkPDFDevice.h
index e68623e..d8e1aa2 100644
--- a/pdf/SkPDFDevice.h
+++ b/pdf/SkPDFDevice.h
@@ -262,12 +262,11 @@
     void cleanUp(bool clearFontUsage);
     SkPDFFormXObject* createFormXObjectFromDevice();
 
-    // Clear the passed clip from all existing content entries.
-    void clearClipFromContent(const SkClipStack* clipStack,
-                              const SkRegion& clipRegion);
-    void drawFormXObjectWithClip(SkPDFFormXObject* form,
+    void drawFormXObjectWithMask(int xObjectIndex,
+                                 SkPDFFormXObject* mask,
                                  const SkClipStack* clipStack,
                                  const SkRegion& clipRegion,
+                                 SkXfermode::Mode mode,
                                  bool invertClip);
 
     // If the paint or clip is such that we shouldn't draw anything, this
@@ -281,7 +280,8 @@
                                     bool hasText,
                                     SkPDFFormXObject** dst);
     void finishContentEntry(SkXfermode::Mode xfermode,
-                            SkPDFFormXObject* dst);
+                            SkPDFFormXObject* dst,
+                            SkPath* shape);
     bool isContentEmpty();
 
     void populateGraphicStateEntryFromPaint(const SkMatrix& matrix,
@@ -291,6 +291,7 @@
                                             bool hasText,
                                             GraphicStateEntry* entry);
     int addGraphicStateResource(SkPDFGraphicState* gs);
+    int addXObjectResource(SkPDFObject* xObject);
 
     void updateFont(const SkPaint& paint, uint16_t glyphID,
                     ContentEntry* contentEntry);