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

Unified Diff: experimental/SkV8Example/SkV8Example.h

Issue 103143009: Add a setTimer() function. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 7 years 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/Global.cpp ('k') | experimental/SkV8Example/SkV8Example.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « experimental/SkV8Example/Global.cpp ('k') | experimental/SkV8Example/SkV8Example.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698