OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2016 Google Inc. | 3 * Copyright 2016 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef GLWindowContext_DEFINED | 8 #ifndef GLWindowContext_DEFINED |
9 #define GLWindowContext_DEFINED | 9 #define GLWindowContext_DEFINED |
10 | 10 |
11 | 11 |
12 #include "gl/GrGLInterface.h" | 12 #include "gl/GrGLInterface.h" |
13 | 13 |
14 #include "SkRefCnt.h" | 14 #include "SkRefCnt.h" |
15 #include "GrRenderTarget.h" | |
16 #include "SkSurface.h" | 15 #include "SkSurface.h" |
17 | 16 |
18 #include "WindowContext.h" | 17 #include "WindowContext.h" |
19 | 18 |
20 class GrContext; | 19 class GrContext; |
21 | 20 |
22 namespace sk_app { | 21 namespace sk_app { |
23 | 22 |
24 class GLWindowContext : public WindowContext { | 23 class GLWindowContext : public WindowContext { |
25 public: | 24 public: |
(...skipping 19 matching lines...) Expand all Loading... |
45 | 44 |
46 // This should be called by subclass destructor. It is also called when wind
ow/display | 45 // This should be called by subclass destructor. It is also called when wind
ow/display |
47 // parameters change prior to initializing a new GL context. This will in tu
rn call | 46 // parameters change prior to initializing a new GL context. This will in tu
rn call |
48 // onDestroyContext(). | 47 // onDestroyContext(). |
49 void destroyContext(); | 48 void destroyContext(); |
50 virtual void onDestroyContext() = 0; | 49 virtual void onDestroyContext() = 0; |
51 | 50 |
52 virtual void onSwapBuffers() = 0; | 51 virtual void onSwapBuffers() = 0; |
53 | 52 |
54 SkAutoTUnref<const GrGLInterface> fBackendContext; | 53 SkAutoTUnref<const GrGLInterface> fBackendContext; |
55 sk_sp<GrRenderTarget> fRenderTarget; | |
56 sk_sp<SkSurface> fSurface; | 54 sk_sp<SkSurface> fSurface; |
57 | 55 |
58 // parameters obtained from the native window | 56 // parameters obtained from the native window |
59 // Note that the platform .cpp file is responsible for | 57 // Note that the platform .cpp file is responsible for |
60 // initializing fSampleCount, fStencilBits, and fColorBits! | 58 // initializing fSampleCount, fStencilBits, and fColorBits! |
61 int fSampleCount; | 59 int fSampleCount; |
62 int fStencilBits; | 60 int fStencilBits; |
63 int fColorBits; | 61 int fColorBits; |
64 int fActualColorBits; | 62 int fActualColorBits; |
65 }; | 63 }; |
66 | 64 |
67 } // namespace sk_app | 65 } // namespace sk_app |
68 | 66 |
69 #endif | 67 #endif |
OLD | NEW |