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