aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer/sk_app/GLWindowContext.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-07-26 12:02:50 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-26 12:02:51 -0700
commitd1bdd1fcbd308afb9903f39d231742f5c951cf07 (patch)
tree786715537d870e3ff8bc3686ea40b83b62c43d6b /tools/viewer/sk_app/GLWindowContext.h
parent1ed2ae45f59c2864ea05838b4da2750b85472824 (diff)
Use Windowing system-specific WindowContext factories.
Diffstat (limited to 'tools/viewer/sk_app/GLWindowContext.h')
-rw-r--r--tools/viewer/sk_app/GLWindowContext.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/viewer/sk_app/GLWindowContext.h b/tools/viewer/sk_app/GLWindowContext.h
index acf15a332e..e9abffd6d1 100644
--- a/tools/viewer/sk_app/GLWindowContext.h
+++ b/tools/viewer/sk_app/GLWindowContext.h
@@ -23,9 +23,6 @@ namespace sk_app {
class GLWindowContext : public WindowContext {
public:
- // This is defined in the platform .cpp file
- static GLWindowContext* Create(void* platformData, const DisplayParams& params);
-
sk_sp<SkSurface> getBackbufferSurface() override;
bool isValid() override { return SkToBool(fBackendContext.get()); }
@@ -40,11 +37,18 @@ public:
}
protected:
- GLWindowContext(void*, const DisplayParams&);
- void initializeContext(void*, const DisplayParams&);
- virtual void onInitializeContext(void*, const DisplayParams&) = 0;
+ GLWindowContext(const DisplayParams&);
+ // This should be called by subclass constructor. It is also called when window/display
+ // parameters change. This will in turn call onInitializeContext().
+ void initializeContext();
+ virtual void onInitializeContext() = 0;
+
+ // This should be called by subclass destructor. It is also called when window/display
+ // parameters change prior to initializing a new GL context. This will in turn call
+ // onDestroyContext().
void destroyContext();
virtual void onDestroyContext() = 0;
+
virtual void onSwapBuffers() = 0;
SkAutoTUnref<const GrGLInterface> fBackendContext;