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

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

Issue 1999213002: Add Xlib support to viewer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix line lengths 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
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
new file mode 100644
index 0000000000000000000000000000000000000000..e1ca90a668087b757f4fedacf6d739d877793d9b
--- /dev/null
+++ b/tools/viewer/sk_app/unix/Window_unix.h
@@ -0,0 +1,61 @@
+/*
+* Copyright 2016 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#ifndef Window_unix_DEFINED
+#define Window_unix_DEFINED
+
+#include <X11/Xlib.h>
+#include "../Window.h"
+#include "SkChecksum.h"
+#include "SkTDynamicHash.h"
+
+namespace sk_app {
+
+struct ContextPlatformData_unix {
+ Display* fDisplay;
+ ::Window fHWnd;
djsollen 2016/05/23 18:13:06 so X11 calls their class Window as well? can you d
jvanverth1 2016/05/23 18:19:10 Done.
+ VisualID fVisualID;
+};
+
+class Window_unix : public Window {
+public:
+ Window_unix() : Window() {}
+ ~Window_unix() override {}
+
+ bool init(Display* display);
+
+ void setTitle(const char*) override;
+ void show() override;
+
+ bool attach(BackendType attachType, const DisplayParams& params) override;
+
+ void inval() override;
+
+ bool handleEvent(const XEvent& event);
+
+ static const ::Window& GetKey(const Window_unix& w) {
+ return w.fHWnd;
+ }
+
+ static uint32_t Hash(const ::Window& w) {
+ return SkChecksum::Mix(w);
+ }
+
+ static SkTDynamicHash<Window_unix,::Window> gWindowMap;
+
+private:
+ Display* fDisplay;
+ ::Window fHWnd;
+
+ Atom fWmDeleteMessage;
+ double fResizeTimer;
+ int fExposeCount;
+};
+
+} // namespace sk_app
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698