aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gm/gmmain.cpp3
-rw-r--r--gyp/common_variables.gypi1
-rw-r--r--gyp/gm.gyp7
-rw-r--r--src/utils/SkPDFRasterizer.cpp5
-rw-r--r--src/utils/SkPDFRasterizer.h1
5 files changed, 17 insertions, 0 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 2a7db03bab..d1ab966abc 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -1321,6 +1321,9 @@ static const PDFRasterizerData kPDFRasterizers[] = {
#ifdef SK_BUILD_POPPLER
{ &SkPopplerRasterizePDF, "poppler", true },
#endif
+#ifdef SK_BUILD_NATIVE_PDF_RENDERER
+ { &SkNativeRasterizePDF, "native", true },
+#endif // SK_BUILD_NATIVE_PDF_RENDERER
};
static const char kDefaultsConfigStr[] = "defaults";
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
index e3bd0d8b64..23aaff9589 100644
--- a/gyp/common_variables.gypi
+++ b/gyp/common_variables.gypi
@@ -156,6 +156,7 @@
'skia_static_initializers%': '<(skia_static_initializers)',
'ios_sdk_version%': '6.0',
'skia_win_debuggers_path%': '<(skia_win_debuggers_path)',
+ 'skia_run_pdfviewer_in_gm%': 0,
# These are referenced by our .gypi files that list files (e.g. core.gypi)
#
diff --git a/gyp/gm.gyp b/gyp/gm.gyp
index e412efe6cf..b430da1320 100644
--- a/gyp/gm.gyp
+++ b/gyp/gm.gyp
@@ -33,6 +33,7 @@
'../src/pipe/utils/',
'../src/utils/',
'../src/utils/debugger',
+ '../experimental/PdfViewer',
],
'includes': [
'gmslides.gypi',
@@ -58,8 +59,14 @@
'gm.gyp:gm_expectations',
'jsoncpp.gyp:jsoncpp',
'pdf.gyp:pdf',
+ 'pdfviewer_lib.gyp:pdfviewer_lib',
],
'conditions': [
+ ['skia_run_pdfviewer_in_gm', {
+ 'defines': [
+ 'SK_BUILD_NATIVE_PDF_RENDERER',
+ ],
+ }],
['skia_os in ["linux", "mac", "win"]', {
'dependencies': [
'poppler.gyp:libpoppler-cpp-gpl',
diff --git a/src/utils/SkPDFRasterizer.cpp b/src/utils/SkPDFRasterizer.cpp
index a3b4cb4a53..267c803ca5 100644
--- a/src/utils/SkPDFRasterizer.cpp
+++ b/src/utils/SkPDFRasterizer.cpp
@@ -18,6 +18,7 @@
#include "SkPDFRasterizer.h"
#include "SkColorPriv.h"
+#include "SkPdfRenderer.h"
bool SkPopplerRasterizePDF(SkStream* pdf, SkBitmap* output) {
size_t size = pdf->getLength();
@@ -71,3 +72,7 @@ bool SkPopplerRasterizePDF(SkStream* pdf, SkBitmap* output) {
return true;
}
+
+bool SkNativeRasterizePDF(SkStream* pdf, SkBitmap* output) {
+ return SkPDFNativeRenderToBitmap(pdf, output);
+}
diff --git a/src/utils/SkPDFRasterizer.h b/src/utils/SkPDFRasterizer.h
index 4a4083cc21..2f2bd02d5d 100644
--- a/src/utils/SkPDFRasterizer.h
+++ b/src/utils/SkPDFRasterizer.h
@@ -11,5 +11,6 @@
#include "SkStream.h"
bool SkPopplerRasterizePDF(SkStream* pdf, SkBitmap* output);
+bool SkNativeRasterizePDF(SkStream* pdf, SkBitmap* output);
#endif