Index: content/renderer/gpu/gpu_benchmarking_extension.cc |
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc |
index b4aadc1821371c8c2cb537cb04af6c68f50f3049..1f1f32f46bf3cc8164dfe524bb5b20fc46eadd5b 100644 |
--- a/content/renderer/gpu/gpu_benchmarking_extension.cc |
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc |
@@ -35,6 +35,7 @@ |
#include "gin/handle.h" |
#include "gin/object_template_builder.h" |
#include "gpu/ipc/common/gpu_messages.h" |
+#include "skia/ext/skia_encode_image.h" |
#include "third_party/WebKit/public/web/WebImageCache.h" |
#include "third_party/WebKit/public/web/WebKit.h" |
#include "third_party/WebKit/public/web/WebLocalFrame.h" |
@@ -51,6 +52,7 @@ |
// Note that headers in third_party/skia/src are fragile. This is |
// an experimental, fragile, and diagnostic-only document type. |
#include "third_party/skia/src/utils/SkMultiPictureDocument.h" |
+#include "ui/gfx/codec/install_skia_codec.h" |
#include "ui/gfx/codec/png_codec.h" |
#include "v8/include/v8.h" |
@@ -594,8 +596,12 @@ void GpuBenchmarking::PrintPagesToSkPictures(v8::Isolate* isolate, |
void GpuBenchmarking::PrintPagesToXPS(v8::Isolate* isolate, |
const std::string& filename) { |
- PrintDocumentTofile(isolate, filename, |
- [](SkWStream* s) { return SkDocument::MakeXPS(s); }); |
+ // SkXPS requires an image encoder be set up. XPS needs to me configured to |
+ // work outside of the sandbox. TODO(halcanary) implement that, and |
+ // call SetImageEncoder will be performed when the sandbox is set up. |
+ skia::SetImageEncoder(&gfx::EncodeImage); |
+ PrintDocumentTofile(isolate, filename, |
+ [](SkWStream* s) { return SkDocument::MakeXPS(s); }); |
} |
void GpuBenchmarking::PrintToSkPicture(v8::Isolate* isolate, |