| Index: experimental/SkV8Example/SkV8Example.h
|
| diff --git a/experimental/SkV8Example/SkV8Example.h b/experimental/SkV8Example/SkV8Example.h
|
| index 9ed0eccb1247e6d17e7eab071d35506384222d9f..30737963f3b3b07f0ebddd17ba7f4cb49c0529ba 100644
|
| --- a/experimental/SkV8Example/SkV8Example.h
|
| +++ b/experimental/SkV8Example/SkV8Example.h
|
| @@ -19,6 +19,7 @@ using namespace v8;
|
|
|
| class SkCanvas;
|
| class JsCanvas;
|
| +class Global;
|
|
|
| class SkV8ExampleWindow : public SkOSWindow {
|
| public:
|
| @@ -43,24 +44,22 @@ private:
|
| // function onDraw(canvas) {
|
| // canvas.fillStyle="#FF0000";
|
| // canvas.fillRect(x, y, w, h);
|
| -// canvas.inval();
|
| // }
|
| class JsCanvas {
|
| public:
|
| - JsCanvas(Isolate* isolate)
|
| - : fIsolate(isolate)
|
| + JsCanvas(Global* global)
|
| + : fGlobal(global)
|
| , fCanvas(NULL)
|
| - , fWindow(NULL)
|
| {
|
| fFillStyle.setColor(SK_ColorRED);
|
| }
|
| ~JsCanvas();
|
|
|
| // Parse the script.
|
| - bool initialize(const char script[]);
|
| + bool initialize();
|
|
|
| // Call this with the SkCanvas you want onDraw to draw on.
|
| - void onDraw(SkCanvas* canvas, SkOSWindow* window);
|
| + void onDraw(SkCanvas* canvas);
|
|
|
| private:
|
| // Implementation of the canvas.fillStyle field.
|
| @@ -72,9 +71,6 @@ private:
|
| // Implementation of the canvas.fillRect() JS function.
|
| static void FillRect(const v8::FunctionCallbackInfo<Value>& args);
|
|
|
| - // Implementation of the canvas.inval() JS function.
|
| - static void Inval(const v8::FunctionCallbackInfo<Value>& args);
|
| -
|
| // Get the pointer out of obj.
|
| static JsCanvas* Unwrap(Handle<Object> obj);
|
|
|
| @@ -85,19 +81,13 @@ private:
|
| // Wrap the 'this' pointer into an Object. Can be retrieved via Unwrap.
|
| Handle<Object> wrap();
|
|
|
| - Isolate* fIsolate;
|
| + Global* fGlobal;
|
|
|
| // Only valid when inside OnDraw().
|
| SkCanvas* fCanvas;
|
|
|
| SkPaint fFillStyle;
|
|
|
| - // Only valid when inside OnDraw().
|
| - SkOSWindow* fWindow;
|
| -
|
| - // The context that the script will be parsed into.
|
| - Persistent<Context> fContext;
|
| -
|
| // A handle to the onDraw function defined in the script.
|
| Persistent<Function> fOnDraw;
|
|
|
|
|