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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 explicit OMLSyncControlVSyncProvider(gfx::AcceleratedWidget window) | 75 explicit OMLSyncControlVSyncProvider(gfx::AcceleratedWidget window) |
76 : SyncControlVSyncProvider(), | 76 : SyncControlVSyncProvider(), |
77 window_(window) { | 77 window_(window) { |
78 } | 78 } |
79 | 79 |
80 virtual ~OMLSyncControlVSyncProvider() { } | 80 virtual ~OMLSyncControlVSyncProvider() { } |
81 | 81 |
82 protected: | 82 protected: |
83 virtual bool GetSyncValues(int64* system_time, | 83 virtual bool GetSyncValues(int64* system_time, |
84 int64* media_stream_counter, | 84 int64* media_stream_counter, |
85 int64* swap_buffer_counter) OVERRIDE { | 85 int64* swap_buffer_counter) override { |
86 return glXGetSyncValuesOML(g_display, window_, system_time, | 86 return glXGetSyncValuesOML(g_display, window_, system_time, |
87 media_stream_counter, swap_buffer_counter); | 87 media_stream_counter, swap_buffer_counter); |
88 } | 88 } |
89 | 89 |
90 virtual bool GetMscRate(int32* numerator, int32* denominator) OVERRIDE { | 90 virtual bool GetMscRate(int32* numerator, int32* denominator) override { |
91 if (!g_glx_get_msc_rate_oml_supported) | 91 if (!g_glx_get_msc_rate_oml_supported) |
92 return false; | 92 return false; |
93 | 93 |
94 if (!glXGetMscRateOML(g_display, window_, numerator, denominator)) { | 94 if (!glXGetMscRateOML(g_display, window_, numerator, denominator)) { |
95 // Once glXGetMscRateOML has been found to fail, don't try again, | 95 // Once glXGetMscRateOML has been found to fail, don't try again, |
96 // since each failing call may spew an error message. | 96 // since each failing call may spew an error message. |
97 g_glx_get_msc_rate_oml_supported = false; | 97 g_glx_get_msc_rate_oml_supported = false; |
98 return false; | 98 return false; |
99 } | 99 } |
100 | 100 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 cancel_vsync_flag_->Set(); | 262 cancel_vsync_flag_->Set(); |
263 } | 263 } |
264 | 264 |
265 // Hand-off |shim_| to be deleted on the |vsync_thread_|. | 265 // Hand-off |shim_| to be deleted on the |vsync_thread_|. |
266 vsync_thread_->message_loop()->DeleteSoon( | 266 vsync_thread_->message_loop()->DeleteSoon( |
267 FROM_HERE, | 267 FROM_HERE, |
268 shim_.release()); | 268 shim_.release()); |
269 } | 269 } |
270 | 270 |
271 virtual void GetVSyncParameters( | 271 virtual void GetVSyncParameters( |
272 const VSyncProvider::UpdateVSyncCallback& callback) OVERRIDE { | 272 const VSyncProvider::UpdateVSyncCallback& callback) override { |
273 if (kGetVSyncParametersMinPeriod > base::TimeDelta()) { | 273 if (kGetVSyncParametersMinPeriod > base::TimeDelta()) { |
274 base::TimeTicks now = base::TimeTicks::Now(); | 274 base::TimeTicks now = base::TimeTicks::Now(); |
275 base::TimeDelta delta = now - last_get_vsync_parameters_time_; | 275 base::TimeDelta delta = now - last_get_vsync_parameters_time_; |
276 if (delta < kGetVSyncParametersMinPeriod) | 276 if (delta < kGetVSyncParametersMinPeriod) |
277 return; | 277 return; |
278 last_get_vsync_parameters_time_ = now; | 278 last_get_vsync_parameters_time_ = now; |
279 } | 279 } |
280 | 280 |
281 // Only one outstanding request per surface. | 281 // Only one outstanding request per surface. |
282 if (!pending_callback_) { | 282 if (!pending_callback_) { |
(...skipping 406 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 |