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

Unified Diff: src/views/unix/SkOSWindow_Unix.cpp

Issue 1159213002: Expand VisualBench to a real benching tool (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 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 | « include/views/SkWindow.h ('k') | tools/VisualBench.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/views/unix/SkOSWindow_Unix.cpp
diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp
index ea2d60b0f3323809ade3fbc43d175b38d49aefe7..f7aaceef02f6f505bbb120f349d80e4566025dcd 100644
--- a/src/views/unix/SkOSWindow_Unix.cpp
+++ b/src/views/unix/SkOSWindow_Unix.cpp
@@ -42,10 +42,10 @@ SkOSWindow::SkOSWindow(void*)
}
SkOSWindow::~SkOSWindow() {
- this->closeWindow();
+ this->internalCloseWindow();
}
-void SkOSWindow::closeWindow() {
+void SkOSWindow::internalCloseWindow() {
if (fUnixWindow.fDisplay) {
this->detach();
SkASSERT(fUnixWindow.fGc);
@@ -61,7 +61,7 @@ void SkOSWindow::closeWindow() {
void SkOSWindow::initWindow(int requestedMSAASampleCount, AttachmentInfo* info) {
if (fMSAASampleCount != requestedMSAASampleCount) {
- this->closeWindow();
+ this->internalCloseWindow();
}
// presence of fDisplay means we already have a window
if (fUnixWindow.fDisplay) {
@@ -461,7 +461,6 @@ void SkOSWindow::setFullscreen(bool setFullscreen) {
if (NULL == dsp) {
return;
}
- Window win = fUnixWindow.fWin;
// Full screen
Atom wm_state = XInternAtom(dsp, "_NET_WM_STATE", False);
@@ -470,7 +469,7 @@ void SkOSWindow::setFullscreen(bool setFullscreen) {
XEvent evt;
sk_bzero(&evt, sizeof(evt));
evt.type = ClientMessage;
- evt.xclient.window = win;
+ evt.xclient.window = fUnixWindow.fWin;
evt.xclient.message_type = wm_state;
evt.xclient.format = 32;
evt.xclient.data.l[0] = setFullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
@@ -488,6 +487,24 @@ void SkOSWindow::setVsync(bool vsync) {
}
}
+void SkOSWindow::closeWindow() {
+ Display* dsp = fUnixWindow.fDisplay;
+ if (NULL == dsp) {
+ return;
+ }
+
+ XEvent evt;
+ sk_bzero(&evt, sizeof(evt));
+ evt.type = ClientMessage;
+ evt.xclient.message_type = XInternAtom(dsp, "WM_PROTOCOLS", true);
+ evt.xclient.window = fUnixWindow.fWin;
+ evt.xclient.format = 32;
+ evt.xclient.data.l[0] = XInternAtom(dsp, "WM_DELETE_WINDOW", false);
+ evt.xclient.data.l[1] = CurrentTime;
+
+ XSendEvent(dsp, fUnixWindow.fWin, false, NoEventMask, &evt);
+}
+
///////////////////////////////////////////////////////////////////////////////
void SkEvent::SignalNonEmptyQueue() {
« no previous file with comments | « include/views/SkWindow.h ('k') | tools/VisualBench.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698