OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #ifndef WindowContext_DEFINED | 7 #ifndef WindowContext_DEFINED |
8 #define WindowContext_DEFINED | 8 #define WindowContext_DEFINED |
9 | 9 |
10 #include "DisplayParams.h" | 10 #include "DisplayParams.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 const DisplayParams& getDisplayParams() { return fDisplayParams; } | 36 const DisplayParams& getDisplayParams() { return fDisplayParams; } |
37 virtual void setDisplayParams(const DisplayParams& params) = 0; | 37 virtual void setDisplayParams(const DisplayParams& params) = 0; |
38 | 38 |
39 SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; } | 39 SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; } |
40 void setSurfaceProps(const SkSurfaceProps& props) { | 40 void setSurfaceProps(const SkSurfaceProps& props) { |
41 fSurfaceProps = props; | 41 fSurfaceProps = props; |
42 } | 42 } |
43 | 43 |
44 virtual GrBackendContext getBackendContext() = 0; | 44 virtual GrBackendContext getBackendContext() = 0; |
| 45 GrContext* getGrContext() const { return fContext; } |
45 | 46 |
46 sk_sp<SkSurface> createRenderSurface(sk_sp<GrRenderTarget>, int colorBits); | 47 sk_sp<SkSurface> createRenderSurface(sk_sp<GrRenderTarget>, int colorBits); |
47 void presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarg
et> rt, | 48 void presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarg
et> rt, |
48 int colorBits); | 49 int colorBits); |
49 | 50 |
50 protected: | 51 protected: |
51 virtual bool isGpuContext() { return true; } | 52 virtual bool isGpuContext() { return true; } |
52 | 53 |
53 GrContext* fContext; | 54 GrContext* fContext; |
54 | 55 |
55 int fWidth; | 56 int fWidth; |
56 int fHeight; | 57 int fHeight; |
57 DisplayParams fDisplayParams; | 58 DisplayParams fDisplayParams; |
58 GrPixelConfig fPixelConfig; | 59 GrPixelConfig fPixelConfig; |
59 SkSurfaceProps fSurfaceProps; | 60 SkSurfaceProps fSurfaceProps; |
60 }; | 61 }; |
61 | 62 |
62 } // namespace sk_app | 63 } // namespace sk_app |
63 | 64 |
64 #endif | 65 #endif |
OLD | NEW |