commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 1 | /* |
| 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.org | 80bd0c9 | 2013-12-06 15:24:52 +0000 | [diff] [blame] | 13 | #include <v8.h> |
| 14 | |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 15 | #include "SkWindow.h" |
| 16 | |
commit-bot@chromium.org | 80bd0c9 | 2013-12-06 15:24:52 +0000 | [diff] [blame] | 17 | |
| 18 | using namespace v8; |
| 19 | |
| 20 | |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 21 | class SkCanvas; |
| 22 | |
| 23 | |
| 24 | class SkV8ExampleWindow : public SkOSWindow { |
| 25 | public: |
commit-bot@chromium.org | 80bd0c9 | 2013-12-06 15:24:52 +0000 | [diff] [blame] | 26 | SkV8ExampleWindow(void* hwnd, |
| 27 | Isolate* isolate, |
| 28 | Handle<Context> context, |
| 29 | Handle<Script> script); |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 30 | |
| 31 | |
| 32 | protected: |
| 33 | virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE; |
| 34 | |
| 35 | |
commit-bot@chromium.org | 80bd0c9 | 2013-12-06 15:24:52 +0000 | [diff] [blame] | 36 | |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 37 | #ifdef SK_BUILD_FOR_WIN |
| 38 | virtual void onHandleInval(const SkIRect&) SK_OVERRIDE; |
| 39 | #endif |
| 40 | |
| 41 | private: |
| 42 | typedef SkOSWindow INHERITED; |
commit-bot@chromium.org | 80bd0c9 | 2013-12-06 15:24:52 +0000 | [diff] [blame] | 43 | Isolate* fIsolate; |
| 44 | Persistent<Context> fContext; |
| 45 | Persistent<Script> fScript; |
| 46 | SkScalar fRotationAngle; |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | #endif |