jvanverth | a8d0d6c | 2016-05-05 12:32:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #ifndef WindowContext_DEFINED |
| 8 | #define WindowContext_DEFINED |
| 9 | |
brianosman | 05de216 | 2016-05-06 13:28:57 -0700 | [diff] [blame] | 10 | #include "DisplayParams.h" |
jvanverth | a8d0d6c | 2016-05-05 12:32:03 -0700 | [diff] [blame] | 11 | #include "GrTypes.h" |
| 12 | |
| 13 | class SkSurface; |
| 14 | |
| 15 | namespace sk_app { |
| 16 | |
jvanverth | 2884e9c | 2016-05-18 07:01:16 -0700 | [diff] [blame] | 17 | // TODO: fill this out with an interface |
jvanverth | a8d0d6c | 2016-05-05 12:32:03 -0700 | [diff] [blame] | 18 | class WindowContext { |
| 19 | public: |
| 20 | virtual ~WindowContext() {} |
| 21 | |
jvanverth | 2884e9c | 2016-05-18 07:01:16 -0700 | [diff] [blame] | 22 | virtual SkSurface* getBackbufferSurface() = 0; |
jvanverth | a8d0d6c | 2016-05-05 12:32:03 -0700 | [diff] [blame] | 23 | |
| 24 | virtual void swapBuffers() = 0; |
| 25 | |
jvanverth | 2884e9c | 2016-05-18 07:01:16 -0700 | [diff] [blame] | 26 | virtual bool makeCurrent() = 0; |
| 27 | |
jvanverth | a8d0d6c | 2016-05-05 12:32:03 -0700 | [diff] [blame] | 28 | virtual bool isValid() = 0; |
| 29 | |
| 30 | virtual void resize(uint32_t w, uint32_t h) = 0; |
| 31 | |
jvanverth | 2884e9c | 2016-05-18 07:01:16 -0700 | [diff] [blame] | 32 | virtual const DisplayParams& getDisplayParams() = 0; |
brianosman | 05de216 | 2016-05-06 13:28:57 -0700 | [diff] [blame] | 33 | virtual void setDisplayParams(const DisplayParams& params) = 0; |
| 34 | |
jvanverth | a8d0d6c | 2016-05-05 12:32:03 -0700 | [diff] [blame] | 35 | virtual GrBackendContext getBackendContext() = 0; |
jvanverth | a8d0d6c | 2016-05-05 12:32:03 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespace sk_app |
| 39 | |
| 40 | #endif |