blob: 97cf58017122f860d2fdb29b78644bc94ebc8c97 [file] [log] [blame]
commit-bot@chromium.org44a38772013-12-05 13:45:19 +00001/*
2 * Copyright 2013 Google Inc.
3 *
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 *
8 */
9
10#ifndef SkV8Example_DEFINED
11#define SkV8Example_DEFINED
12
commit-bot@chromium.org80bd0c92013-12-06 15:24:52 +000013#include <v8.h>
14
commit-bot@chromium.org44a38772013-12-05 13:45:19 +000015#include "SkWindow.h"
16
commit-bot@chromium.org80bd0c92013-12-06 15:24:52 +000017
18using namespace v8;
19
20
commit-bot@chromium.org44a38772013-12-05 13:45:19 +000021class SkCanvas;
22
23
24class SkV8ExampleWindow : public SkOSWindow {
25public:
commit-bot@chromium.org80bd0c92013-12-06 15:24:52 +000026 SkV8ExampleWindow(void* hwnd,
27 Isolate* isolate,
28 Handle<Context> context,
29 Handle<Script> script);
commit-bot@chromium.org44a38772013-12-05 13:45:19 +000030
31
32protected:
33 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE;
34
35
commit-bot@chromium.org80bd0c92013-12-06 15:24:52 +000036
commit-bot@chromium.org44a38772013-12-05 13:45:19 +000037#ifdef SK_BUILD_FOR_WIN
38 virtual void onHandleInval(const SkIRect&) SK_OVERRIDE;
39#endif
40
41private:
42 typedef SkOSWindow INHERITED;
commit-bot@chromium.org80bd0c92013-12-06 15:24:52 +000043 Isolate* fIsolate;
44 Persistent<Context> fContext;
45 Persistent<Script> fScript;
46 SkScalar fRotationAngle;
commit-bot@chromium.org44a38772013-12-05 13:45:19 +000047};
48
49#endif