| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 extern "C" { | 5 extern "C" { |
| 6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
| 7 } | 7 } |
| 8 | 8 |
| 9 #include "ui/gl/gl_surface_glx.h" | 9 #include "ui/gl/gl_surface_glx.h" |
| 10 | 10 |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 return true; | 459 return true; |
| 460 } | 460 } |
| 461 | 461 |
| 462 void NativeViewGLSurfaceGLX::Destroy() { | 462 void NativeViewGLSurfaceGLX::Destroy() { |
| 463 if (window_) { | 463 if (window_) { |
| 464 ui::PlatformEventSource* event_source = | 464 ui::PlatformEventSource* event_source = |
| 465 ui::PlatformEventSource::GetInstance(); | 465 ui::PlatformEventSource::GetInstance(); |
| 466 if (event_source) | 466 if (event_source) |
| 467 event_source->RemovePlatformEventDispatcher(this); | 467 event_source->RemovePlatformEventDispatcher(this); |
| 468 XDestroyWindow(g_display, window_); | 468 XDestroyWindow(g_display, window_); |
| 469 window_ = 0; |
| 469 XFlush(g_display); | 470 XFlush(g_display); |
| 470 } | 471 } |
| 471 } | 472 } |
| 472 | 473 |
| 473 bool NativeViewGLSurfaceGLX::CanDispatchEvent(const ui::PlatformEvent& event) { | 474 bool NativeViewGLSurfaceGLX::CanDispatchEvent(const ui::PlatformEvent& event) { |
| 474 return event->type == Expose && event->xexpose.window == window_; | 475 return event->type == Expose && event->xexpose.window == window_; |
| 475 } | 476 } |
| 476 | 477 |
| 477 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) { | 478 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) { |
| 478 XEvent forwarded_event = *event; | 479 XEvent forwarded_event = *event; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 | 675 |
| 675 void* PbufferGLSurfaceGLX::GetConfig() { | 676 void* PbufferGLSurfaceGLX::GetConfig() { |
| 676 return config_; | 677 return config_; |
| 677 } | 678 } |
| 678 | 679 |
| 679 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 680 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
| 680 Destroy(); | 681 Destroy(); |
| 681 } | 682 } |
| 682 | 683 |
| 683 } // namespace gfx | 684 } // namespace gfx |
| OLD | NEW |