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

Unified Diff: tools/viewer/sk_app/GLWindowContext.h

Issue 2169543002: Use Windowing system-specific WindowContext factories. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: more xlib Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkBackendContext.cpp ('k') | tools/viewer/sk_app/GLWindowContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/GLWindowContext.h
diff --git a/tools/viewer/sk_app/GLWindowContext.h b/tools/viewer/sk_app/GLWindowContext.h
index acf15a332e15c8b44fb03b1763b2b0448d5166c4..e9abffd6d18c4712cad217dd3d8f02aa90b6ed6d 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;
« no previous file with comments | « src/gpu/vk/GrVkBackendContext.cpp ('k') | tools/viewer/sk_app/GLWindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698