blob: d48e38e7466949b07031a3dd2443231f3011e847 [file] [log] [blame]
jvanvertha8d0d6c2016-05-05 12:32:03 -07001/*
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
brianosman05de2162016-05-06 13:28:57 -070010#include "DisplayParams.h"
jvanvertha8d0d6c2016-05-05 12:32:03 -070011#include "GrTypes.h"
12
13class SkSurface;
14
15namespace sk_app {
16
jvanverth2884e9c2016-05-18 07:01:16 -070017// TODO: fill this out with an interface
jvanvertha8d0d6c2016-05-05 12:32:03 -070018class WindowContext {
19public:
20 virtual ~WindowContext() {}
21
jvanverth2884e9c2016-05-18 07:01:16 -070022 virtual SkSurface* getBackbufferSurface() = 0;
jvanvertha8d0d6c2016-05-05 12:32:03 -070023
24 virtual void swapBuffers() = 0;
25
jvanverth2884e9c2016-05-18 07:01:16 -070026 virtual bool makeCurrent() = 0;
27
jvanvertha8d0d6c2016-05-05 12:32:03 -070028 virtual bool isValid() = 0;
29
30 virtual void resize(uint32_t w, uint32_t h) = 0;
31
jvanverth2884e9c2016-05-18 07:01:16 -070032 virtual const DisplayParams& getDisplayParams() = 0;
brianosman05de2162016-05-06 13:28:57 -070033 virtual void setDisplayParams(const DisplayParams& params) = 0;
34
jvanvertha8d0d6c2016-05-05 12:32:03 -070035 virtual GrBackendContext getBackendContext() = 0;
jvanvertha8d0d6c2016-05-05 12:32:03 -070036};
37
38} // namespace sk_app
39
40#endif