Revert "[PDF] Refactor SkPDFFont to enable font/cmap subsetting."

The PDF xref table is corrupt with this change. Revert until we figure it out.

Review URL: http://codereview.appspot.com/4803049

git-svn-id: http://skia.googlecode.com/svn/trunk@1944 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index e2dfba6..619d55d 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -424,8 +424,8 @@
     }
 }
 
-SkDevice* SkPDFDevice::onCreateCompatibleDevice(SkBitmap::Config config,
-                                                int width, int height,
+SkDevice* SkPDFDevice::onCreateCompatibleDevice(SkBitmap::Config config, 
+                                                int width, int height, 
                                                 bool isOpaque,
                                                 Usage usage) {
     SkMatrix initialTransform;
@@ -544,7 +544,7 @@
 }
 
 SkPDFDevice::~SkPDFDevice() {
-    this->cleanUp(true);
+    this->cleanUp();
 }
 
 void SkPDFDevice::init() {
@@ -553,24 +553,18 @@
     fLastContentEntry = NULL;
     fMarginContentEntries.reset();
     fLastMarginContentEntry = NULL;
-    fDrawingArea = kContent_DrawingArea;
-    if (fFontGlyphUsage == NULL) {
-        fFontGlyphUsage.reset(new SkPDFGlyphSetMap());
-    }
+    fDrawingArea = kContent_DrawingArea; 
 }
 
-void SkPDFDevice::cleanUp(bool clearFontUsage) {
+void SkPDFDevice::cleanUp() {
     fGraphicStateResources.unrefAll();
     fXObjectResources.unrefAll();
     fFontResources.unrefAll();
     fShaderResources.unrefAll();
-    if (clearFontUsage) {
-        fFontGlyphUsage->reset();
-    }
 }
 
 void SkPDFDevice::clear(SkColor color) {
-    this->cleanUp(true);
+    this->cleanUp();
     this->init();
 
     SkPaint paint;
@@ -831,8 +825,6 @@
         size_t availableGlyphs =
             font->glyphsToPDFFontEncoding(glyphIDs + consumedGlyphCount,
                                           numGlyphs - consumedGlyphCount);
-        fFontGlyphUsage->noteGlyphUsage(font, glyphIDs + consumedGlyphCount,
-                                        availableGlyphs);
         SkString encodedString =
             SkPDFString::FormatString(glyphIDs + consumedGlyphCount,
                                       availableGlyphs, font->multiByteGlyphs());
@@ -901,7 +893,6 @@
             i--;
             continue;
         }
-        fFontGlyphUsage->noteGlyphUsage(font, &encodedValue, 1);
         SkScalar x = pos[i * scalarsPerPos];
         SkScalar y = scalarsPerPos == 1 ? constY : pos[i * scalarsPerPos + 1];
         align_text(glyphCacheProc, textPaint, glyphIDs + i, 1, &x, &y, NULL);
@@ -961,9 +952,6 @@
     fXObjectResources.push(xobject);  // Transfer reference.
     SkPDFUtils::DrawFormXObject(fXObjectResources.count() - 1,
                                 &content.entry()->fContent);
-
-    // Merge glyph sets from the drawn device.
-    fFontGlyphUsage->merge(pdfDevice->getFontGlyphUsage());
 }
 
 ContentEntry* SkPDFDevice::getLastContentEntry() {
@@ -1154,7 +1142,7 @@
         SkRect r = SkRect::MakeWH(this->width(), this->height());
         emit_clip(NULL, &r, &data);
     }
-
+    
     SkPDFDevice::copyContentEntriesToData(fContentEntries.get(), &data);
 
     // potentially we could cache this SkData, and only rebuild it if we
@@ -1166,10 +1154,7 @@
         SkRefPtr<SkPDFFormXObject>* xobject) {
     *xobject = new SkPDFFormXObject(this);
     (*xobject)->unref();  // SkRefPtr and new both took a reference.
-    // We always draw the form xobjects that we create back into the device, so
-    // we simply preserve the font usage instead of pulling it out and merging
-    // it back in later.
-    cleanUp(false);  // Reset this device to have no content.
+    cleanUp();  // Reset this device to have no content.
     init();
 }