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

Unified Diff: content/renderer/skia_benchmarking_extension.h

Issue 142143005: Convert the SkiaBenchmarkingExtension to a gin::Wrappable class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 months 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 | « content/renderer/render_view_impl.cc ('k') | content/renderer/skia_benchmarking_extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/skia_benchmarking_extension.h
diff --git a/content/renderer/skia_benchmarking_extension.h b/content/renderer/skia_benchmarking_extension.h
index 73d5f83dddf5d5cead64ad5a51bea638ec9d10d9..974ae127b357d9582e36e36b3236d15b1d0767c3 100644
--- a/content/renderer/skia_benchmarking_extension.h
+++ b/content/renderer/skia_benchmarking_extension.h
@@ -5,17 +5,72 @@
#ifndef CONTENT_RENDERER_SKIA_BENCHMARKING_EXTENSION_H_
#define CONTENT_RENDERER_SKIA_BENCHMARKING_EXTENSION_H_
-namespace v8 {
-class Extension;
+#include "base/basictypes.h"
+#include "gin/wrappable.h"
+
+namespace blink {
+class WebFrame;
+}
+
+namespace gin {
+class Arguments;
}
namespace content {
-// V8 extension for Skia benchmarking
-class SkiaBenchmarkingExtension {
+class SkiaBenchmarking : public gin::Wrappable<SkiaBenchmarking> {
public:
- static v8::Extension* Get();
- static void InitSkGraphics();
+ static gin::WrapperInfo kWrapperInfo;
+ static void Install(blink::WebFrame* frame);
+
+ // Wrapper around SkGraphics::Init that can be invoked multiple times.
+ static void Initialize();
+
+ private:
+ SkiaBenchmarking();
+ virtual ~SkiaBenchmarking();
+
+ // gin::Wrappable.
+ virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
+ v8::Isolate* isolate) OVERRIDE;
+
+ // Rasterizes a Picture JSON-encoded by cc::Picture::AsValue().
+ //
+ // Takes a JSON-encoded cc::Picture and optionally rasterization parameters:
+ // {
+ // 'scale': {Number},
+ // 'stop': {Number},
+ // 'overdraw': {Boolean},
+ // 'clip': [Number, Number, Number, Number]
+ // }
+ //
+ // Returns
+ // {
+ // 'width': {Number},
+ // 'height': {Number},
+ // 'data': {ArrayBuffer}
+ // }
+ void Rasterize(gin::Arguments* args);
+
+ // Extracts the Skia draw commands from a JSON-encoded cc::Picture.
+ //
+ // Takes a JSON-encoded cc::Picture and returns
+ // [{ 'cmd': {String}, 'info': [String, ...] }, ...]
+ void GetOps(gin::Arguments* args);
+
+ // Returns timing information for the given picture.
+ //
+ // Takes a JSON-encoded cc::Picture and returns
+ // { 'total_time': {Number}, 'cmd_times': [Number, ...] }
+ void GetOpTimings(gin::Arguments* args);
+
+ // Returns meta information for the given picture.
+ //
+ // Takes a base64 encoded SKP and returns
+ // { 'width': {Number}, 'height': {Number} }
+ void GetInfo(gin::Arguments* args);
+
+ DISALLOW_COPY_AND_ASSIGN(SkiaBenchmarking);
};
} // namespace content
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | content/renderer/skia_benchmarking_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698