Chromium Code Reviews| 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 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #if defined(ENABLE_GPU) | 9 #if defined(ENABLE_GPU) |
| 10 | 10 |
|
apatrick_chromium
2012/06/05 18:44:15
#include <deque>
piman
2012/06/05 20:09:50
Done.
| |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/common/gpu/gpu_memory_allocation.h" | 18 #include "content/common/gpu/gpu_memory_allocation.h" |
| 19 #include "content/common/gpu/gpu_memory_allocation.h" | 19 #include "content/common/gpu/gpu_memory_allocation.h" |
| 20 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" | 20 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 gfx::GpuPreference gpu_preference() { return gpu_preference_; } | 160 gfx::GpuPreference gpu_preference() { return gpu_preference_; } |
| 161 | 161 |
| 162 // Sends a message to the console. | 162 // Sends a message to the console. |
| 163 void SendConsoleMessage(int32 id, const std::string& message); | 163 void SendConsoleMessage(int32 id, const std::string& message); |
| 164 | 164 |
| 165 gfx::GLSurface* surface() const { return surface_; } | 165 gfx::GLSurface* surface() const { return surface_; } |
| 166 | 166 |
| 167 void AddDestructionObserver(DestructionObserver* observer); | 167 void AddDestructionObserver(DestructionObserver* observer); |
| 168 void RemoveDestructionObserver(DestructionObserver* observer); | 168 void RemoveDestructionObserver(DestructionObserver* observer); |
| 169 | 169 |
| 170 // Associates a sync point to this stub. When the stub is destroyed, it will | |
| 171 // retire all sync points that haven't been previously retired. | |
| 172 void AddSyncPoint(uint32 sync_point); | |
| 173 | |
| 170 private: | 174 private: |
| 171 void Destroy(); | 175 void Destroy(); |
| 172 | 176 |
| 173 // Cleans up and sends reply if OnInitialize failed. | 177 // Cleans up and sends reply if OnInitialize failed. |
| 174 void OnInitializeFailed(IPC::Message* reply_message); | 178 void OnInitializeFailed(IPC::Message* reply_message); |
| 175 | 179 |
| 176 // Message handlers: | 180 // Message handlers: |
| 177 void OnInitialize(IPC::Message* reply_message); | 181 void OnInitialize(IPC::Message* reply_message); |
| 178 void OnSetGetBuffer(int32 shm_id, IPC::Message* reply_message); | 182 void OnSetGetBuffer(int32 shm_id, IPC::Message* reply_message); |
| 179 void OnSetSharedStateBuffer(int32 shm_id, IPC::Message* reply_message); | 183 void OnSetSharedStateBuffer(int32 shm_id, IPC::Message* reply_message); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 198 void OnCreateVideoDecoder( | 202 void OnCreateVideoDecoder( |
| 199 media::VideoCodecProfile profile, | 203 media::VideoCodecProfile profile, |
| 200 IPC::Message* reply_message); | 204 IPC::Message* reply_message); |
| 201 void OnDestroyVideoDecoder(int32 decoder_route_id); | 205 void OnDestroyVideoDecoder(int32 decoder_route_id); |
| 202 | 206 |
| 203 void OnSetSurfaceVisible(bool visible); | 207 void OnSetSurfaceVisible(bool visible); |
| 204 | 208 |
| 205 void OnDiscardBackbuffer(); | 209 void OnDiscardBackbuffer(); |
| 206 void OnEnsureBackbuffer(); | 210 void OnEnsureBackbuffer(); |
| 207 | 211 |
| 212 void OnRetireSyncPoint(uint32 sync_point); | |
| 213 void OnWaitSyncPoint(uint32 sync_point); | |
| 214 void OnSyncPointRetired(); | |
| 215 | |
| 208 void OnSetClientHasMemoryAllocationChangedCallback(bool); | 216 void OnSetClientHasMemoryAllocationChangedCallback(bool); |
| 209 | 217 |
| 210 void OnReschedule(); | 218 void OnReschedule(); |
| 211 | 219 |
| 212 void OnCommandProcessed(); | 220 void OnCommandProcessed(); |
| 213 void OnParseError(); | 221 void OnParseError(); |
| 214 | 222 |
| 215 void ReportState(); | 223 void ReportState(); |
| 216 | 224 |
| 217 // The lifetime of objects of this class is managed by a GpuChannel. The | 225 // The lifetime of objects of this class is managed by a GpuChannel. The |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 248 GpuWatchdog* watchdog_; | 256 GpuWatchdog* watchdog_; |
| 249 | 257 |
| 250 std::deque<IPC::Message*> delayed_echos_; | 258 std::deque<IPC::Message*> delayed_echos_; |
| 251 | 259 |
| 252 // Zero or more video decoders owned by this stub, keyed by their | 260 // Zero or more video decoders owned by this stub, keyed by their |
| 253 // decoder_route_id. | 261 // decoder_route_id. |
| 254 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; | 262 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; |
| 255 | 263 |
| 256 ObserverList<DestructionObserver> destruction_observers_; | 264 ObserverList<DestructionObserver> destruction_observers_; |
| 257 | 265 |
| 266 // A queue of sync points associated with this stub. | |
| 267 std::deque<uint32> sync_points_; | |
| 268 | |
| 258 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 269 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
| 259 }; | 270 }; |
| 260 | 271 |
| 261 #endif // defined(ENABLE_GPU) | 272 #endif // defined(ENABLE_GPU) |
| 262 | 273 |
| 263 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 274 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| OLD | NEW |