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

Unified Diff: tools/viewer/sk_app/unix/Window_unix.h

Issue 2011473003: Add OpenGL support to Linux viewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Repatched the patch 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp ('k') | tools/viewer/sk_app/unix/Window_unix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/unix/Window_unix.h
diff --git a/tools/viewer/sk_app/unix/Window_unix.h b/tools/viewer/sk_app/unix/Window_unix.h
index c2156fc6aecf1e3e5b2fc86db4dd1f3553bf4f43..fb6b22d4132a4e09ed056528bc6b298cb2588e84 100644
--- a/tools/viewer/sk_app/unix/Window_unix.h
+++ b/tools/viewer/sk_app/unix/Window_unix.h
@@ -9,6 +9,7 @@
#define Window_unix_DEFINED
#include <X11/Xlib.h>
+#include <GL/glx.h>
#include "../Window.h"
#include "SkChecksum.h"
#include "SkTDynamicHash.h"
@@ -18,17 +19,22 @@ typedef Window XWindow;
namespace sk_app {
struct ContextPlatformData_unix {
- Display* fDisplay;
- XWindow fHWnd;
- VisualID fVisualID;
+ Display* fDisplay;
+ XWindow fWindow;
+ XVisualInfo* fVisualInfo;
};
class Window_unix : public Window {
public:
- Window_unix() : Window() {}
- ~Window_unix() override {}
+ Window_unix() : Window()
+ , fDisplay(nullptr)
+ , fWindow(0)
+ , fGC(nullptr)
+ , fVisualInfo(nullptr)
+ , fMSAASampleCount(0) {}
+ ~Window_unix() override { this->closeWindow(); }
- bool init(Display* display);
+ bool initWindow(Display* display, const DisplayParams* params);
void setTitle(const char*) override;
void show() override;
@@ -40,7 +46,7 @@ public:
bool handleEvent(const XEvent& event);
static const XWindow& GetKey(const Window_unix& w) {
- return w.fHWnd;
+ return w.fWindow;
}
static uint32_t Hash(const XWindow& w) {
@@ -70,8 +76,13 @@ public:
}
private:
- Display* fDisplay;
- XWindow fHWnd;
+ void closeWindow();
+
+ Display* fDisplay;
+ XWindow fWindow;
+ GC fGC;
+ XVisualInfo* fVisualInfo;
+ int fMSAASampleCount;
Atom fWmDeleteMessage;
« no previous file with comments | « tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp ('k') | tools/viewer/sk_app/unix/Window_unix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698