OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 * | 7 * |
8 */ | 8 */ |
9 #include <v8.h> | 9 #include <v8.h> |
10 | 10 |
11 using namespace v8; | 11 using namespace v8; |
12 | 12 |
13 #include "SkV8Example.h" | 13 #include "SkV8Example.h" |
14 #include "Global.h" | 14 #include "Global.h" |
15 #include "JsContext.h" | 15 #include "JsContext.h" |
16 #include "Path.h" | 16 #include "Path2D.h" |
17 | 17 |
18 #include "gl/GrGLUtil.h" | 18 #include "gl/GrGLUtil.h" |
19 #include "gl/GrGLDefines.h" | 19 #include "gl/GrGLDefines.h" |
20 #include "gl/GrGLInterface.h" | 20 #include "gl/GrGLInterface.h" |
21 #include "GrRenderTarget.h" | 21 #include "GrRenderTarget.h" |
22 #include "GrContext.h" | 22 #include "GrContext.h" |
23 #include "SkApplication.h" | 23 #include "SkApplication.h" |
24 #include "SkCommandLineFlags.h" | 24 #include "SkCommandLineFlags.h" |
25 #include "SkData.h" | 25 #include "SkData.h" |
26 #include "SkDraw.h" | 26 #include "SkDraw.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 SkAutoTUnref<SkData> data; | 198 SkAutoTUnref<SkData> data; |
199 if (FLAGS_infile.count()) { | 199 if (FLAGS_infile.count()) { |
200 data.reset(SkData::NewFromFileName(FLAGS_infile[0])); | 200 data.reset(SkData::NewFromFileName(FLAGS_infile[0])); |
201 script = static_cast<const char*>(data->data()); | 201 script = static_cast<const char*>(data->data()); |
202 } | 202 } |
203 if (NULL == script) { | 203 if (NULL == script) { |
204 printf("Could not load file: %s.\n", FLAGS_infile[0]); | 204 printf("Could not load file: %s.\n", FLAGS_infile[0]); |
205 exit(1); | 205 exit(1); |
206 } | 206 } |
207 Path::AddToGlobal(global); | 207 Path2D::AddToGlobal(global); |
208 | 208 |
209 if (!global->parseScript(script)) { | 209 if (!global->parseScript(script)) { |
210 printf("Failed to parse file: %s.\n", FLAGS_infile[0]); | 210 printf("Failed to parse file: %s.\n", FLAGS_infile[0]); |
211 exit(1); | 211 exit(1); |
212 } | 212 } |
213 | 213 |
214 | 214 |
215 JsContext* jsContext = new JsContext(global); | 215 JsContext* jsContext = new JsContext(global); |
216 | 216 |
217 if (!jsContext->initialize()) { | 217 if (!jsContext->initialize()) { |
218 printf("Failed to initialize.\n"); | 218 printf("Failed to initialize.\n"); |
219 exit(1); | 219 exit(1); |
220 } | 220 } |
221 SkV8ExampleWindow* win = new SkV8ExampleWindow(hwnd, jsContext); | 221 SkV8ExampleWindow* win = new SkV8ExampleWindow(hwnd, jsContext); |
222 global->setWindow(win); | 222 global->setWindow(win); |
223 | 223 |
224 return win; | 224 return win; |
225 } | 225 } |
OLD | NEW |