| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "gpu/command_buffer/service/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 struct GpuInProcessThreadHolder { | 117 struct GpuInProcessThreadHolder { |
| 118 GpuInProcessThreadHolder() : gpu_thread(new GpuInProcessThread) {} | 118 GpuInProcessThreadHolder() : gpu_thread(new GpuInProcessThread) {} |
| 119 scoped_refptr<InProcessCommandBuffer::Service> gpu_thread; | 119 scoped_refptr<InProcessCommandBuffer::Service> gpu_thread; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 base::LazyInstance<GpuInProcessThreadHolder> g_default_service = | 122 base::LazyInstance<GpuInProcessThreadHolder> g_default_service = |
| 123 LAZY_INSTANCE_INITIALIZER; | 123 LAZY_INSTANCE_INITIALIZER; |
| 124 | 124 |
| 125 class ScopedEvent { | 125 class ScopedEvent { |
| 126 public: | 126 public: |
| 127 ScopedEvent(base::WaitableEvent* event) : event_(event) {} | 127 explicit ScopedEvent(base::WaitableEvent* event) : event_(event) {} |
| 128 ~ScopedEvent() { event_->Signal(); } | 128 ~ScopedEvent() { event_->Signal(); } |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 base::WaitableEvent* event_; | 131 base::WaitableEvent* event_; |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 // This wrapper adds the WaitSyncPoint which allows waiting on a sync point | 134 // This wrapper adds the WaitSyncPoint which allows waiting on a sync point |
| 135 // on the service thread, implemented using a condition variable. | 135 // on the service thread, implemented using a condition variable. |
| 136 class SyncPointManagerWrapper { | 136 class SyncPointManagerWrapper { |
| 137 public: | 137 public: |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 | 961 |
| 962 #if defined(OS_ANDROID) | 962 #if defined(OS_ANDROID) |
| 963 scoped_refptr<gfx::SurfaceTexture> | 963 scoped_refptr<gfx::SurfaceTexture> |
| 964 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { | 964 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { |
| 965 DCHECK(stream_texture_manager_); | 965 DCHECK(stream_texture_manager_); |
| 966 return stream_texture_manager_->GetSurfaceTexture(stream_id); | 966 return stream_texture_manager_->GetSurfaceTexture(stream_id); |
| 967 } | 967 } |
| 968 #endif | 968 #endif |
| 969 | 969 |
| 970 } // namespace gpu | 970 } // namespace gpu |
| OLD | NEW |