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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 519 |
520 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) { | 520 uint32_t NativeViewGLSurfaceGLX::DispatchEvent(const ui::PlatformEvent& event) { |
521 XEvent forwarded_event = *event; | 521 XEvent forwarded_event = *event; |
522 forwarded_event.xexpose.window = parent_window_; | 522 forwarded_event.xexpose.window = parent_window_; |
523 XSendEvent(g_display, parent_window_, False, ExposureMask, | 523 XSendEvent(g_display, parent_window_, False, ExposureMask, |
524 &forwarded_event); | 524 &forwarded_event); |
525 XFlush(g_display); | 525 XFlush(g_display); |
526 return ui::POST_DISPATCH_STOP_PROPAGATION; | 526 return ui::POST_DISPATCH_STOP_PROPAGATION; |
527 } | 527 } |
528 | 528 |
529 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) { | 529 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size, float scale_factor) { |
530 size_ = size; | 530 size_ = size; |
531 glXWaitGL(); | 531 glXWaitGL(); |
532 XResizeWindow(g_display, window_, size.width(), size.height()); | 532 XResizeWindow(g_display, window_, size.width(), size.height()); |
533 glXWaitX(); | 533 glXWaitX(); |
534 return true; | 534 return true; |
535 } | 535 } |
536 | 536 |
537 bool NativeViewGLSurfaceGLX::IsOffscreen() { | 537 bool NativeViewGLSurfaceGLX::IsOffscreen() { |
538 return false; | 538 return false; |
539 } | 539 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 if (!config_) | 634 if (!config_) |
635 config_ = GLSurfaceGLX::GetConfig(window_); | 635 config_ = GLSurfaceGLX::GetConfig(window_); |
636 return config_; | 636 return config_; |
637 } | 637 } |
638 | 638 |
639 UnmappedNativeViewGLSurfaceGLX::~UnmappedNativeViewGLSurfaceGLX() { | 639 UnmappedNativeViewGLSurfaceGLX::~UnmappedNativeViewGLSurfaceGLX() { |
640 Destroy(); | 640 Destroy(); |
641 } | 641 } |
642 | 642 |
643 } // namespace gfx | 643 } // namespace gfx |
OLD | NEW |