| 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" | 15 #include "GrRenderTarget.h" |
| 16 #include "SkSurface.h" | 16 #include "SkSurface.h" |
| 17 | 17 |
| 18 #include "WindowContext.h" | 18 #include "WindowContext.h" |
| 19 | 19 |
| 20 class GrContext; | 20 class GrContext; |
| 21 | 21 |
| 22 namespace sk_app { | 22 namespace sk_app { |
| 23 | 23 |
| 24 class GLWindowContext : public WindowContext { | 24 class GLWindowContext : public WindowContext { |
| 25 public: | 25 public: |
| 26 sk_sp<SkSurface> getBackbufferSurface() override; | 26 sk_sp<SkSurface> getBackbufferSurface() override; |
| 27 | 27 |
| 28 bool isValid() override { return SkToBool(fBackendContext.get()); } | 28 bool isValid() override { return SkToBool(fBackendContext.get()); } |
| 29 | 29 |
| 30 void resize(uint32_t w, uint32_t h) override; | 30 void resize(int w, int h) override; |
| 31 void swapBuffers() override; | 31 void swapBuffers() override; |
| 32 | 32 |
| 33 void setDisplayParams(const DisplayParams& params) override; | 33 void setDisplayParams(const DisplayParams& params) override; |
| 34 | 34 |
| 35 GrBackendContext getBackendContext() override { | 35 GrBackendContext getBackendContext() override { |
| 36 return (GrBackendContext) fBackendContext.get(); | 36 return (GrBackendContext) fBackendContext.get(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 GLWindowContext(const DisplayParams&); | 40 GLWindowContext(const DisplayParams&); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 60 // initializing fSampleCount, fStencilBits, and fColorBits! | 60 // initializing fSampleCount, fStencilBits, and fColorBits! |
| 61 int fSampleCount; | 61 int fSampleCount; |
| 62 int fStencilBits; | 62 int fStencilBits; |
| 63 int fColorBits; | 63 int fColorBits; |
| 64 int fActualColorBits; | 64 int fActualColorBits; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace sk_app | 67 } // namespace sk_app |
| 68 | 68 |
| 69 #endif | 69 #endif |
| OLD | NEW |