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 #include "ui/gl/gl_surface_glx.h" |
| 6 |
5 extern "C" { | 7 extern "C" { |
6 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
7 } | 9 } |
8 | 10 #include <memory> |
9 #include "ui/gl/gl_surface_glx.h" | |
10 | 11 |
11 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/synchronization/cancellation_flag.h" | 18 #include "base/synchronization/cancellation_flag.h" |
19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
21 #include "base/threading/non_thread_safe.h" | 21 #include "base/threading/non_thread_safe.h" |
22 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
24 #include "base/trace_event/trace_event.h" | 24 #include "base/trace_event/trace_event.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 void PendingCallbackRunner(const base::TimeTicks timebase, | 325 void PendingCallbackRunner(const base::TimeTicks timebase, |
326 const base::TimeDelta interval) { | 326 const base::TimeDelta interval) { |
327 DCHECK(pending_callback_); | 327 DCHECK(pending_callback_); |
328 pending_callback_->Run(timebase, interval); | 328 pending_callback_->Run(timebase, interval); |
329 pending_callback_.reset(); | 329 pending_callback_.reset(); |
330 } | 330 } |
331 | 331 |
332 scoped_refptr<SGIVideoSyncThread> vsync_thread_; | 332 scoped_refptr<SGIVideoSyncThread> vsync_thread_; |
333 | 333 |
334 // Thread shim through which the sync provider is accessed on |vsync_thread_|. | 334 // Thread shim through which the sync provider is accessed on |vsync_thread_|. |
335 scoped_ptr<SGIVideoSyncProviderThreadShim> shim_; | 335 std::unique_ptr<SGIVideoSyncProviderThreadShim> shim_; |
336 | 336 |
337 scoped_ptr<VSyncProvider::UpdateVSyncCallback> pending_callback_; | 337 std::unique_ptr<VSyncProvider::UpdateVSyncCallback> pending_callback_; |
338 | 338 |
339 // Raw pointers to sync primitives owned by the shim_. | 339 // Raw pointers to sync primitives owned by the shim_. |
340 // These will only be referenced before we post a task to destroy | 340 // These will only be referenced before we post a task to destroy |
341 // the shim_, so they are safe to access. | 341 // the shim_, so they are safe to access. |
342 base::CancellationFlag* cancel_vsync_flag_; | 342 base::CancellationFlag* cancel_vsync_flag_; |
343 base::Lock* vsync_lock_; | 343 base::Lock* vsync_lock_; |
344 | 344 |
345 base::TimeTicks last_get_vsync_parameters_time_; | 345 base::TimeTicks last_get_vsync_parameters_time_; |
346 | 346 |
347 DISALLOW_COPY_AND_ASSIGN(SGIVideoSyncVSyncProvider); | 347 DISALLOW_COPY_AND_ASSIGN(SGIVideoSyncVSyncProvider); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 if (!config_) | 639 if (!config_) |
640 config_ = GetConfigForWindow(g_display, window_); | 640 config_ = GetConfigForWindow(g_display, window_); |
641 return config_; | 641 return config_; |
642 } | 642 } |
643 | 643 |
644 UnmappedNativeViewGLSurfaceGLX::~UnmappedNativeViewGLSurfaceGLX() { | 644 UnmappedNativeViewGLSurfaceGLX::~UnmappedNativeViewGLSurfaceGLX() { |
645 Destroy(); | 645 Destroy(); |
646 } | 646 } |
647 | 647 |
648 } // namespace gfx | 648 } // namespace gfx |
OLD | NEW |