Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 2527833002: Implement SkEncodeImage() (Closed)
Patch Set: remove size check Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | skia/BUILD.gn » ('j') | skia/ext/skia_encode_image.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | skia/BUILD.gn » ('j') | skia/ext/skia_encode_image.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698