Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / experimental / SkV8Example / SkV8Example.h
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
15 class GrContext;
16 class GrGLInterface;
17 class GrRenderTarget;
18 class SkSurface;
19
20 class JsContext;
21
22 class SkV8ExampleWindow : public SkOSWindow {
23 public:
24     SkV8ExampleWindow(void* hwnd, JsContext* canvas);
25     virtual ~SkV8ExampleWindow();
26
27 protected:
28     virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE;
29     virtual void onSizeChange() SK_OVERRIDE;
30
31 #if SK_SUPPORT_GPU
32     virtual SkSurface* createSurface() SK_OVERRIDE;
33 #endif
34
35 #ifdef SK_BUILD_FOR_WIN
36     virtual void onHandleInval(const SkIRect&) SK_OVERRIDE;
37 #endif
38
39     void windowSizeChanged();
40
41 private:
42     typedef SkOSWindow INHERITED;
43     JsContext* fJsContext;
44
45 #if SK_SUPPORT_GPU
46     GrContext*              fCurContext;
47     const GrGLInterface*    fCurIntf;
48     GrRenderTarget*         fCurRenderTarget;
49     SkSurface*              fCurSurface;
50 #endif
51 };
52
53 #endif