If poppler is disable and native pdf is enabled, we still need SkPDFRasterizer.cpp
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 10 Jan 2014 19:09:00 +0000 (19:09 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 10 Jan 2014 19:09:00 +0000 (19:09 +0000)
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

gyp/gm.gyp
src/utils/SkPDFRasterizer.cpp
src/utils/SkPDFRasterizer.h

index 657bc560eaae7053bf3624d36002522716765ac9..971fce5d355e5e75e95053de09d97cd63abc060b 100644 (file)
         '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',
           ],
index 89ac4015b8a206649725a560b55e9273fd07a412..68a31196ecd6ee093bad9e9a2909315507f1f442 100644 (file)
 #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) {
index ebc9fa610cae4a7c409479693ea6386e7fae88ba..82ec09233ff879bb3465d7d22daa3a2728730698 100644 (file)
@@ -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);