diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-10 19:09:00 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-10 19:09:00 +0000 |
commit | 1066f0837892102399a323b8883417cc368f0342 (patch) | |
tree | b636aed076867a339f604a318218efc5cad2c7a1 | |
parent | 5c6f1d4424191539ebe5a5c3db883716d67efe12 (diff) |
If poppler is disable and native pdf is enabled, we still need SkPDFRasterizer.cpp
R=reed@google.com
TBR=reed@google.com
NOTREECHECKS=true
NOTRY=true
Author: vandebo@chromium.org
Review URL: https://codereview.chromium.org/133583004
git-svn-id: http://skia.googlecode.com/svn/trunk@13025 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gyp/gm.gyp | 8 | ||||
-rw-r--r-- | src/utils/SkPDFRasterizer.cpp | 15 | ||||
-rw-r--r-- | src/utils/SkPDFRasterizer.h | 2 |
3 files changed, 17 insertions, 8 deletions
diff --git a/gyp/gm.gyp b/gyp/gm.gyp index 657bc560ea..971fce5d35 100644 --- a/gyp/gm.gyp +++ b/gyp/gm.gyp @@ -62,6 +62,11 @@ 'pdf.gyp:pdf', ], 'conditions': [ + ['skia_run_pdfviewer_in_gm or skia_poppler_enabled', { + 'sources': [ + '../src/utils/SkPDFRasterizer.cpp', + ], + }], ['skia_run_pdfviewer_in_gm', { 'defines': [ 'SK_BUILD_NATIVE_PDF_RENDERER', @@ -77,9 +82,6 @@ 'dependencies': [ 'poppler.gyp:libpoppler-cpp-gpl', ], - 'sources': [ - '../src/utils/SkPDFRasterizer.cpp', - ], 'defines': [ 'SK_BUILD_POPPLER', ], diff --git a/src/utils/SkPDFRasterizer.cpp b/src/utils/SkPDFRasterizer.cpp index 89ac4015b8..68a31196ec 100644 --- a/src/utils/SkPDFRasterizer.cpp +++ b/src/utils/SkPDFRasterizer.cpp @@ -11,17 +11,21 @@ #pragma warning(disable : 4530) #endif -#include <poppler-document.h> -#include <poppler-image.h> -#include <poppler-page.h> -#include <poppler-page-renderer.h> - #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) { size_t size = pdf->getLength(); SkAutoFree buffer(sk_malloc_throw(size)); @@ -74,6 +78,7 @@ bool SkPopplerRasterizePDF(SkStream* pdf, SkBitmap* output) { return true; } +#endif // SK_BUILD_POPPLER #ifdef SK_BUILD_NATIVE_PDF_RENDERER bool SkNativeRasterizePDF(SkStream* pdf, SkBitmap* output) { diff --git a/src/utils/SkPDFRasterizer.h b/src/utils/SkPDFRasterizer.h index ebc9fa610c..82ec09233f 100644 --- a/src/utils/SkPDFRasterizer.h +++ b/src/utils/SkPDFRasterizer.h @@ -10,7 +10,9 @@ #include "SkBitmap.h" #include "SkStream.h" +#ifdef SK_BUILD_POPPLER bool SkPopplerRasterizePDF(SkStream* pdf, SkBitmap* output); +#endif // SK_BUILD_POPPLER #ifdef SK_BUILD_NATIVE_PDF_RENDERER bool SkNativeRasterizePDF(SkStream* pdf, SkBitmap* output); |