Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: tools/viewer/sk_app/GLWindowContext.h

Issue 1990893002: Revert of Add OpenGL context to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/viewer/sk_app/DisplayParams.h ('k') | tools/viewer/sk_app/GLWindowContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2016 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8 #ifndef GLWindowContext_DEFINED
9 #define GLWindowContext_DEFINED
10
11
12 #include "gl/GrGLInterface.h"
13
14 #include "SkRefCnt.h"
15 #include "GrRenderTarget.h"
16 #include "SkSurface.h"
17
18 #include "WindowContext.h"
19
20 class GrContext;
21
22 namespace sk_app {
23
24 class GLWindowContext : public WindowContext {
25 public:
26 // This is defined in the platform .cpp file
27 static GLWindowContext* Create(void* platformData, const DisplayParams& para ms);
28
29 sk_sp<SkSurface> getBackbufferSurface() override;
30
31 bool isValid() override { return SkToBool(fBackendContext.get()); }
32
33 void resize(uint32_t w, uint32_t h) override;
34 void swapBuffers() override;
35
36 void setDisplayParams(const DisplayParams& params) override;
37
38 GrBackendContext getBackendContext() override {
39 return (GrBackendContext) fBackendContext.get();
40 }
41
42 protected:
43 GLWindowContext(void*, const DisplayParams&);
44 void initializeContext(void*, const DisplayParams&);
45 virtual void onInitializeContext(void*, const DisplayParams&) = 0;
46 void destroyContext();
47 virtual void onDestroyContext() = 0;
48 virtual void onSwapBuffers() = 0;
49
50 SkAutoTUnref<const GrGLInterface> fBackendContext;
51 sk_sp<GrRenderTarget> fRenderTarget;
52 sk_sp<SkSurface> fSurface;
53
54 // parameters obtained from the native window
55 int fSampleCount;
56 int fStencilBits;
57 int fColorBits;
58 int fActualColorBits;
59 };
60
61 } // namespace sk_app
62
63 #endif
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/DisplayParams.h ('k') | tools/viewer/sk_app/GLWindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698