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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) { |
488 XEvent forwarded_event = *event; | 488 XEvent forwarded_event = *event; |
489 forwarded_event.xexpose.window = parent_window_; | 489 forwarded_event.xexpose.window = parent_window_; |
490 XSendEvent(g_display, parent_window_, False, ExposureMask, | 490 XSendEvent(g_display, parent_window_, False, ExposureMask, |
491 &forwarded_event); | 491 &forwarded_event); |
492 XFlush(g_display); | 492 XFlush(g_display); |
493 return ui::POST_DISPATCH_STOP_PROPAGATION; | 493 return ui::kPostDispatchStopPropagation; |
494 } | 494 } |
495 | 495 |
496 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) { | 496 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) { |
497 size_ = size; | 497 size_ = size; |
498 glXWaitGL(); | 498 glXWaitGL(); |
499 XResizeWindow(g_display, window_, size.width(), size.height()); | 499 XResizeWindow(g_display, window_, size.width(), size.height()); |
500 glXWaitX(); | 500 glXWaitX(); |
501 return true; | 501 return true; |
502 } | 502 } |
503 | 503 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 689 |
690 void* PbufferGLSurfaceGLX::GetConfig() { | 690 void* PbufferGLSurfaceGLX::GetConfig() { |
691 return config_; | 691 return config_; |
692 } | 692 } |
693 | 693 |
694 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 694 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
695 Destroy(); | 695 Destroy(); |
696 } | 696 } |
697 | 697 |
698 } // namespace gfx | 698 } // namespace gfx |
OLD | NEW |