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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 event_source->RemovePlatformEventDispatcher(this); | 477 event_source->RemovePlatformEventDispatcher(this); |
478 XDestroyWindow(g_display, window_); | 478 XDestroyWindow(g_display, window_); |
479 XFlush(g_display); | 479 XFlush(g_display); |
480 } | 480 } |
481 } | 481 } |
482 | 482 |
483 bool NativeViewGLSurfaceGLX::CanDispatchEvent(const ui::PlatformEvent& event) { | 483 bool NativeViewGLSurfaceGLX::CanDispatchEvent(const ui::PlatformEvent& event) { |
484 return event->type == Expose && event->xexpose.window == window_; | 484 return event->type == Expose && event->xexpose.window == window_; |
485 } | 485 } |
486 | 486 |
487 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) { | 487 ui::PostDispatchAction NativeViewGLSurfaceGLX::DispatchEvent( |
| 488 const ui::PlatformEvent& event) { |
488 XEvent forwarded_event = *event; | 489 XEvent forwarded_event = *event; |
489 forwarded_event.xexpose.window = parent_window_; | 490 forwarded_event.xexpose.window = parent_window_; |
490 XSendEvent(g_display, parent_window_, False, ExposureMask, | 491 XSendEvent(g_display, parent_window_, False, ExposureMask, |
491 &forwarded_event); | 492 &forwarded_event); |
492 XFlush(g_display); | 493 XFlush(g_display); |
493 return ui::POST_DISPATCH_STOP_PROPAGATION; | 494 return ui::POST_DISPATCH_STOP_PROPAGATION; |
494 } | 495 } |
495 | 496 |
496 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) { | 497 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) { |
497 size_ = size; | 498 size_ = size; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 690 |
690 void* PbufferGLSurfaceGLX::GetConfig() { | 691 void* PbufferGLSurfaceGLX::GetConfig() { |
691 return config_; | 692 return config_; |
692 } | 693 } |
693 | 694 |
694 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 695 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
695 Destroy(); | 696 Destroy(); |
696 } | 697 } |
697 | 698 |
698 } // namespace gfx | 699 } // namespace gfx |
OLD | NEW |