Clean up poppler code.

We're not actually using it.

BUG=skia:3362
DOCS_PREVIEW= https://skia.org/?cl=1002493002

Review URL: https://codereview.chromium.org/1002493002
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
index bbd09a6..60dcccc 100644
--- a/gyp/common_variables.gypi
+++ b/gyp/common_variables.gypi
@@ -86,11 +86,6 @@
         }, {
           'os_posix%': 1,
         }],
-        [ 'skia_os in ["linux"]', {
-          'skia_poppler_enabled%': 1,
-        }, {
-          'skia_poppler_enabled%': 0,
-        }],
         ['"64" in skia_arch_type', {
           'skia_arch_width%': 64,
         }, {
@@ -224,7 +219,6 @@
     'skia_resource_cache_mb_limit%': '<(skia_resource_cache_mb_limit)',
     'skia_resource_cache_count_limit%': '<(skia_resource_cache_count_limit)',
     'skia_angle%': '<(skia_angle)',
-    'skia_poppler_enabled%': '<(skia_poppler_enabled)',
     'skia_arch_width%': '<(skia_arch_width)',
     'skia_arch_type%': '<(skia_arch_type)',
     'skia_chrome_utils%': '<(skia_chrome_utils)',
diff --git a/gyp/dm.gyp b/gyp/dm.gyp
index c05826b..dc75729 100644
--- a/gyp/dm.gyp
+++ b/gyp/dm.gyp
@@ -25,11 +25,6 @@
                 '../dm/DMSrcSinkAndroid.cpp',
               ],
           }],
-          ['skia_poppler_enabled', {
-              'sources':      [ '../src/utils/SkPDFRasterizer.cpp' ],
-              'defines':      [ 'SK_BUILD_POPPLER' ],
-              'dependencies': [ 'poppler.gyp:*' ],
-          }],
         ],
     }]
 }
diff --git a/gyp/freetype.gyp b/gyp/freetype.gyp
index fc528d4..ed6e97b 100644
--- a/gyp/freetype.gyp
+++ b/gyp/freetype.gyp
@@ -81,8 +81,7 @@
         'libpng.gyp:libpng',
       ],
       'includes': [
-        # common freetype sources needed for both the base Skia build and the
-        # libpoppler build for testing only
+        # TODO: merge this back in here?
         'freetype.gypi',
       ],
       'include_dirs': [
@@ -109,30 +108,5 @@
         }],
       ],
     },
-    {
-      'target_name': 'freetype_poppler',
-      'type': 'static_library',
-      'standalone_static_library': 1,
-      'includes': [
-        'freetype.gypi',
-      ],
-      'sources': [
-        # additional components used by poppler
-        '../third_party/externals/freetype/src/base/ftbdf.c',
-        '../third_party/externals/freetype/src/base/ftpfr.c',
-
-        '../third_party/externals/freetype/src/bdf/bdf.c',
-        '../third_party/externals/freetype/src/cid/type1cid.c',
-        '../third_party/externals/freetype/src/pcf/pcf.c',
-        '../third_party/externals/freetype/src/pfr/pfr.c',
-        '../third_party/externals/freetype/src/psaux/psaux.c',
-        '../third_party/externals/freetype/src/type1/type1.c',
-        '../third_party/externals/freetype/src/type42/type42.c',
-        '../third_party/externals/freetype/src/winfonts/winfnt.c',
-
-        '../third_party/externals/freetype/src/gzip/ftgzip.c',
-        '../third_party/externals/freetype/src/lzw/ftlzw.c',
-      ],
-    },
   ],
 }
diff --git a/gyp/poppler.gyp b/gyp/poppler.gyp
deleted file mode 100644
index 6b7685d..0000000
--- a/gyp/poppler.gyp
+++ /dev/null
@@ -1,15 +0,0 @@
-# Poppler, assuming it's been installed to the (Linux) system.
-{
-    'targets': [{
-        'target_name': 'poppler',
-        'type': 'none',
-        'direct_dependent_settings': {
-            'libraries': [
-                '-lpoppler-cpp',
-            ],
-            'include_dirs': [
-                '/usr/include/poppler/cpp',
-            ],
-        },
-    }],
-}
diff --git a/site/user/quick/linux.md b/site/user/quick/linux.md
index 7b34565..ef4f95b 100644
--- a/site/user/quick/linux.md
+++ b/site/user/quick/linux.md
@@ -33,8 +33,6 @@
   * mesa-common-dev
   * GL
     * such as freeglut3-dev
-  * Poppler PDF rendering library C++ development files
-    * suggested Ubuntu package: libpoppler-cpp-dev
 
 Check out the source code
 -------------------------
diff --git a/src/utils/SkPDFRasterizer.cpp b/src/utils/SkPDFRasterizer.cpp
deleted file mode 100644
index d44dfa3..0000000
--- a/src/utils/SkPDFRasterizer.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifdef SK_BUILD_FOR_WIN32
-#pragma warning(push)
-#pragma warning(disable : 4530)
-#endif
-
-#include "SkPDFRasterizer.h"
-#include "SkColorPriv.h"
-
-#ifdef SK_BUILD_NATIVE_PDF_RENDERER
-#include "SkPdfRenderer.h"
-#endif  // SK_BUILD_NATIVE_PDF_RENDERER
-
-#ifdef SK_BUILD_POPPLER
-#include <poppler-document.h>
-#include <poppler-image.h>
-#include <poppler-page.h>
-#include <poppler-page-renderer.h>
-#endif  // SK_BUILD_POPPLER
-
-#ifdef SK_BUILD_POPPLER
-bool SkPopplerRasterizePDF(SkStream* pdf, SkBitmap* output) {
-  SkAutoTDelete<SkStream> streamDeleter(pdf);
-  size_t size = pdf->getLength();
-  SkAutoFree buffer(sk_malloc_throw(size));
-  pdf->read(buffer.get(), size);
-
-  SkAutoTDelete<poppler::document> doc(
-      poppler::document::load_from_raw_data((const char*)buffer.get(), size));
-  if (!doc.get() || doc->is_locked()) {
-    return false;
-  }
-
-  SkAutoTDelete<poppler::page> page(doc->create_page(0));
-  poppler::page_renderer renderer;
-  poppler::image image = renderer.render_page(page.get());
-
-  if (!image.is_valid() || image.format() != poppler::image::format_argb32) {
-    return false;
-  }
-
-  int width = image.width(), height = image.height();
-  size_t rowSize = image.bytes_per_row();
-  char *imgData = image.data();
-
-  SkBitmap bitmap;
-  if (!bitmap.tryAllocN32Pixels(width, height)) {
-    return false;
-  }
-  bitmap.eraseColor(SK_ColorWHITE);
-  SkPMColor* bitmapPixels = (SkPMColor*)bitmap.getPixels();
-
-  // do pixel-by-pixel copy to deal with RGBA ordering conversions
-  for (int y = 0; y < height; y++) {
-    char *rowData = imgData;
-    for (int x = 0; x < width; x++) {
-      uint8_t a = rowData[3];
-      uint8_t r = rowData[2];
-      uint8_t g = rowData[1];
-      uint8_t b = rowData[0];
-
-      *bitmapPixels = SkPreMultiplyARGB(a, r, g, b);
-
-      bitmapPixels++;
-      rowData += 4;
-    }
-    imgData += rowSize;
-  }
-
-  output->swap(bitmap);
-
-  return true;
-}
-#endif  // SK_BUILD_POPPLER
-
-#ifdef SK_BUILD_NATIVE_PDF_RENDERER
-bool SkNativeRasterizePDF(SkStream* pdf, SkBitmap* output) {
-    SkAutoTDelete<SkStream> streamDeleter(pdf);
-    return SkPDFNativeRenderToBitmap(pdf, output);
-}
-#endif  // SK_BUILD_NATIVE_PDF_RENDERER
diff --git a/src/utils/SkPDFRasterizer.h b/src/utils/SkPDFRasterizer.h
deleted file mode 100644
index 36bd086..0000000
--- a/src/utils/SkPDFRasterizer.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef SkPDFRasterizer_DEFINED
-#define SkPDFRasterizer_DEFINED
-
-#include "SkBitmap.h"
-#include "SkStream.h"
-
-#ifdef SK_BUILD_POPPLER
-// Deletes pdf when finished.
-bool SkPopplerRasterizePDF(SkStream* pdf, SkBitmap* output);
-#endif  // SK_BUILD_POPPLER
-
-#ifdef SK_BUILD_NATIVE_PDF_RENDERER
-// Deletes pdf when finished.
-bool SkNativeRasterizePDF(SkStream* pdf, SkBitmap* output);
-#endif  // SK_BUILD_NATIVE_PDF_RENDERER
-
-#endif
diff --git a/tools/install_dependencies.sh b/tools/install_dependencies.sh
index 5769602..ae98884 100755
--- a/tools/install_dependencies.sh
+++ b/tools/install_dependencies.sh
@@ -15,7 +15,6 @@
         Ubuntu)
             sudo apt-get install \
                 build-essential \
-		libpoppler-cpp-dev \
 		libfreetype6-dev \
 		libfontconfig-dev \
 		libpng12-dev \
diff --git a/tools/tsan.supp b/tools/tsan.supp
index 6158bf8..0401197 100644
--- a/tools/tsan.supp
+++ b/tools/tsan.supp
@@ -5,11 +5,6 @@
 # WebP races (harmlessly) choosing function pointers for SIMD versions of some of its functions.
 race:third_party/externals/libwebp
 
-# Poppler races on startup.
-race:libpoppler.so
-# LCMS is used by poppler, and also races.
-race:liblcms2.so
-
 # skia:2459  Seemingly misdiagnosed use-after-free, having something to do with software GL drivers.
 # Having trouble getting this suppression to match.
 # We've tried: race:swrast_dri.so