| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 class SGIVideoSyncVSyncProvider | 234 class SGIVideoSyncVSyncProvider |
| 235 : public gfx::VSyncProvider, | 235 : public gfx::VSyncProvider, |
| 236 public base::SupportsWeakPtr<SGIVideoSyncVSyncProvider> { | 236 public base::SupportsWeakPtr<SGIVideoSyncVSyncProvider> { |
| 237 public: | 237 public: |
| 238 explicit SGIVideoSyncVSyncProvider(gfx::AcceleratedWidget window) | 238 explicit SGIVideoSyncVSyncProvider(gfx::AcceleratedWidget window) |
| 239 : vsync_thread_(SGIVideoSyncThread::Create()), | 239 : vsync_thread_(SGIVideoSyncThread::Create()), |
| 240 shim_((new SGIVideoSyncProviderThreadShim(window))->AsWeakPtr()), | 240 shim_((new SGIVideoSyncProviderThreadShim(window))->AsWeakPtr()), |
| 241 cancel_vsync_flag_(shim_->cancel_vsync_flag()), | 241 cancel_vsync_flag_(shim_->cancel_vsync_flag()), |
| 242 vsync_lock_(shim_->vsync_lock()) { | 242 vsync_lock_(shim_->vsync_lock()) { |
| 243 // The WeakPtr is bound to the SGIVideoSyncThread. We only use it for | |
| 244 // PostTask. | |
| 245 shim_->DetachFromThread(); | |
| 246 vsync_thread_->message_loop()->PostTask( | 243 vsync_thread_->message_loop()->PostTask( |
| 247 FROM_HERE, | 244 FROM_HERE, |
| 248 base::Bind(&SGIVideoSyncProviderThreadShim::Initialize, shim_)); | 245 base::Bind(&SGIVideoSyncProviderThreadShim::Initialize, shim_)); |
| 249 } | 246 } |
| 250 | 247 |
| 251 virtual ~SGIVideoSyncVSyncProvider() { | 248 virtual ~SGIVideoSyncVSyncProvider() { |
| 252 { | 249 { |
| 253 base::AutoLock locked(*vsync_lock_); | 250 base::AutoLock locked(*vsync_lock_); |
| 254 cancel_vsync_flag_->Set(); | 251 cancel_vsync_flag_->Set(); |
| 255 } | 252 } |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 612 |
| 616 void* PbufferGLSurfaceGLX::GetConfig() { | 613 void* PbufferGLSurfaceGLX::GetConfig() { |
| 617 return config_; | 614 return config_; |
| 618 } | 615 } |
| 619 | 616 |
| 620 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 617 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
| 621 Destroy(); | 618 Destroy(); |
| 622 } | 619 } |
| 623 | 620 |
| 624 } // namespace gfx | 621 } // namespace gfx |
| OLD | NEW |