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 | |
| 13 | #include "SkWindow.h" |
| 14 | |
commit-bot@chromium.org | 9ee0e32 | 2014-01-06 20:03:55 +0000 | [diff] [blame] | 15 | class GrContext; |
| 16 | class GrGLInterface; |
| 17 | class GrRenderTarget; |
commit-bot@chromium.org | 939560b | 2014-02-27 17:39:40 +0000 | [diff] [blame] | 18 | class SkSurface; |
commit-bot@chromium.org | 9ee0e32 | 2014-01-06 20:03:55 +0000 | [diff] [blame] | 19 | |
commit-bot@chromium.org | c8d7328 | 2014-01-06 18:17:24 +0000 | [diff] [blame] | 20 | class JsContext; |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 21 | |
| 22 | class SkV8ExampleWindow : public SkOSWindow { |
| 23 | public: |
commit-bot@chromium.org | c8d7328 | 2014-01-06 18:17:24 +0000 | [diff] [blame] | 24 | SkV8ExampleWindow(void* hwnd, JsContext* canvas); |
commit-bot@chromium.org | 939560b | 2014-02-27 17:39:40 +0000 | [diff] [blame] | 25 | virtual ~SkV8ExampleWindow(); |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 26 | |
| 27 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 28 | void onDraw(SkCanvas* canvas) override; |
| 29 | void onSizeChange() override; |
commit-bot@chromium.org | 9ee0e32 | 2014-01-06 20:03:55 +0000 | [diff] [blame] | 30 | |
| 31 | #if SK_SUPPORT_GPU |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 32 | SkSurface* createSurface() override; |
commit-bot@chromium.org | 9ee0e32 | 2014-01-06 20:03:55 +0000 | [diff] [blame] | 33 | #endif |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 34 | |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 35 | #ifdef SK_BUILD_FOR_WIN |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 36 | void onHandleInval(const SkIRect&) override; |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 37 | #endif |
| 38 | |
commit-bot@chromium.org | 9ee0e32 | 2014-01-06 20:03:55 +0000 | [diff] [blame] | 39 | void windowSizeChanged(); |
| 40 | |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 41 | private: |
| 42 | typedef SkOSWindow INHERITED; |
commit-bot@chromium.org | c8d7328 | 2014-01-06 18:17:24 +0000 | [diff] [blame] | 43 | JsContext* fJsContext; |
commit-bot@chromium.org | 9ee0e32 | 2014-01-06 20:03:55 +0000 | [diff] [blame] | 44 | |
| 45 | #if SK_SUPPORT_GPU |
| 46 | GrContext* fCurContext; |
| 47 | const GrGLInterface* fCurIntf; |
| 48 | GrRenderTarget* fCurRenderTarget; |
commit-bot@chromium.org | 939560b | 2014-02-27 17:39:40 +0000 | [diff] [blame] | 49 | SkSurface* fCurSurface; |
commit-bot@chromium.org | 9ee0e32 | 2014-01-06 20:03:55 +0000 | [diff] [blame] | 50 | #endif |
commit-bot@chromium.org | 44a3877 | 2013-12-05 13:45:19 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | #endif |