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

Unified Diff: experimental/SkV8Example/SkV8Example.cpp

Issue 673223002: Get SkV8Example running again. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix 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/SkV8Example.h ('k') | gyp/v8.gyp » ('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 00fa27735126fed867ac215830d5b902006e6448..84fe648c902067bb6ab7a6c05896ebf2f8443636 100644
--- a/experimental/SkV8Example/SkV8Example.cpp
+++ b/experimental/SkV8Example/SkV8Example.cpp
@@ -7,8 +7,7 @@
*
*/
#include <v8.h>
-
-using namespace v8;
+#include <include/libplatform/libplatform.h>
#include "SkV8Example.h"
#include "Global.h"
@@ -110,16 +109,14 @@ void SkV8ExampleWindow::windowSizeChanged() {
#endif
#if SK_SUPPORT_GPU
-SkCanvas* SkV8ExampleWindow::createCanvas() {
+SkSurface* SkV8ExampleWindow::createSurface() {
if (FLAGS_gpu) {
- SkCanvas* c = fCurSurface->getCanvas();
- // Increase the ref count since the surface keeps a reference
- // to the canvas, but callers of createCanvas put the results
- // in a SkAutoTUnref.
- c->ref();
- return c;
+ // Increase the ref count since callers of createSurface put the
+ // results in a SkAutoTUnref.
+ fCurSurface->ref();
+ return fCurSurface;
} else {
- return this->INHERITED::createCanvas();
+ return this->INHERITED::createSurface();
}
}
#endif
@@ -163,13 +160,22 @@ void SkV8ExampleWindow::onHandleInval(const SkIRect& rect) {
}
#endif
+
SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
printf("Started\n");
SkCommandLineFlags::Parse(argc, argv);
- // Get the default Isolate created at startup.
- Isolate* isolate = Isolate::GetCurrent();
+ v8::V8::InitializeICU();
+ v8::Platform* platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
+
+ v8::Isolate* isolate = v8::Isolate::New();
+ v8::Isolate::Scope isolate_scope(isolate);
+ v8::HandleScope handle_scope(isolate);
+ isolate->Enter();
+
Global* global = new Global(isolate);
« no previous file with comments | « experimental/SkV8Example/SkV8Example.h ('k') | gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698