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

Unified Diff: experimental/SkV8Example/SkV8Example.cpp

Issue 661033005: SkV8Sample: Now with Path2D and Path2DBuilder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: path* Created 6 years, 2 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 | « experimental/SkV8Example/Path2DBuilder.cpp ('k') | experimental/SkV8Example/js/sample.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/SkV8Example/SkV8Example.cpp
diff --git a/experimental/SkV8Example/SkV8Example.cpp b/experimental/SkV8Example/SkV8Example.cpp
index 84fe648c902067bb6ab7a6c05896ebf2f8443636..d537fd4d3822fb6c1a7d37389c6c32129a62873a 100644
--- a/experimental/SkV8Example/SkV8Example.cpp
+++ b/experimental/SkV8Example/SkV8Example.cpp
@@ -13,6 +13,7 @@
#include "Global.h"
#include "JsContext.h"
#include "Path2D.h"
+#include "Path2DBuilder.h"
#include "gl/GrGLUtil.h"
#include "gl/GrGLDefines.h"
@@ -129,6 +130,8 @@ void SkV8ExampleWindow::onSizeChange() {
#endif
}
+Global* global = NULL;
+
void SkV8ExampleWindow::onDraw(SkCanvas* canvas) {
canvas->save();
@@ -164,6 +167,7 @@ void SkV8ExampleWindow::onHandleInval(const SkIRect& rect) {
SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
printf("Started\n");
+ v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
SkCommandLineFlags::Parse(argc, argv);
v8::V8::InitializeICU();
@@ -176,7 +180,7 @@ SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
v8::HandleScope handle_scope(isolate);
isolate->Enter();
- Global* global = new Global(isolate);
+ global = new Global(isolate);
// Set up things to look like a browser by creating
@@ -210,6 +214,7 @@ SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
printf("Could not load file: %s.\n", FLAGS_infile[0]);
exit(1);
}
+ Path2DBuilder::AddToGlobal(global);
Path2D::AddToGlobal(global);
if (!global->parseScript(script)) {
« no previous file with comments | « experimental/SkV8Example/Path2DBuilder.cpp ('k') | experimental/SkV8Example/js/sample.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698