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 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 SurfaceState(int32 surface_id, | 51 SurfaceState(int32 surface_id, |
52 bool visible, | 52 bool visible, |
53 base::TimeTicks last_used_time); | 53 base::TimeTicks last_used_time); |
54 }; | 54 }; |
55 | 55 |
56 public: | 56 public: |
57 virtual ~GpuCommandBufferStubBase() {} | 57 virtual ~GpuCommandBufferStubBase() {} |
58 | 58 |
59 // Will not have surface state if this is an offscreen commandbuffer. | 59 // Will not have surface state if this is an offscreen commandbuffer. |
| 60 virtual bool client_has_memory_allocation_changed_callback() const = 0; |
60 virtual bool has_surface_state() const = 0; | 61 virtual bool has_surface_state() const = 0; |
61 virtual const SurfaceState& surface_state() const = 0; | 62 virtual const SurfaceState& surface_state() const = 0; |
62 | 63 |
63 virtual bool IsInSameContextShareGroup( | 64 virtual bool IsInSameContextShareGroup( |
64 const GpuCommandBufferStubBase& other) const = 0; | 65 const GpuCommandBufferStubBase& other) const = 0; |
65 | 66 |
66 virtual void SendMemoryAllocationToProxy( | 67 virtual void SendMemoryAllocationToProxy( |
67 const GpuMemoryAllocation& allocation) = 0; | 68 const GpuMemoryAllocation& allocation) = 0; |
68 | 69 |
69 virtual void SetMemoryAllocation( | 70 virtual void SetMemoryAllocation( |
(...skipping 30 matching lines...) Expand all Loading... |
100 | 101 |
101 virtual ~GpuCommandBufferStub(); | 102 virtual ~GpuCommandBufferStub(); |
102 | 103 |
103 // IPC::Channel::Listener implementation: | 104 // IPC::Channel::Listener implementation: |
104 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 105 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
105 | 106 |
106 // IPC::Message::Sender implementation: | 107 // IPC::Message::Sender implementation: |
107 virtual bool Send(IPC::Message* msg) OVERRIDE; | 108 virtual bool Send(IPC::Message* msg) OVERRIDE; |
108 | 109 |
109 // GpuCommandBufferStubBase implementation: | 110 // GpuCommandBufferStubBase implementation: |
| 111 virtual bool client_has_memory_allocation_changed_callback() const OVERRIDE; |
110 virtual bool has_surface_state() const OVERRIDE; | 112 virtual bool has_surface_state() const OVERRIDE; |
111 virtual const GpuCommandBufferStubBase::SurfaceState& surface_state() const | 113 virtual const GpuCommandBufferStubBase::SurfaceState& surface_state() const |
112 OVERRIDE; | 114 OVERRIDE; |
113 | 115 |
114 // Returns true iff |other| is in the same context share group as this stub. | 116 // Returns true iff |other| is in the same context share group as this stub. |
115 virtual bool IsInSameContextShareGroup( | 117 virtual bool IsInSameContextShareGroup( |
116 const GpuCommandBufferStubBase& other) const OVERRIDE; | 118 const GpuCommandBufferStubBase& other) const OVERRIDE; |
117 | 119 |
118 // Sends memory allocation limits to render process. | 120 // Sends memory allocation limits to render process. |
119 virtual void SendMemoryAllocationToProxy( | 121 virtual void SendMemoryAllocationToProxy( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void OnCreateVideoDecoder( | 193 void OnCreateVideoDecoder( |
192 media::VideoCodecProfile profile, | 194 media::VideoCodecProfile profile, |
193 IPC::Message* reply_message); | 195 IPC::Message* reply_message); |
194 void OnDestroyVideoDecoder(int32 decoder_route_id); | 196 void OnDestroyVideoDecoder(int32 decoder_route_id); |
195 | 197 |
196 void OnSetSurfaceVisible(bool visible); | 198 void OnSetSurfaceVisible(bool visible); |
197 | 199 |
198 void OnDiscardBackbuffer(); | 200 void OnDiscardBackbuffer(); |
199 void OnEnsureBackbuffer(); | 201 void OnEnsureBackbuffer(); |
200 | 202 |
| 203 void OnSetClientHasMemoryAllocationChangedCallback(bool); |
| 204 |
201 void OnReschedule(); | 205 void OnReschedule(); |
202 | 206 |
203 void OnCommandProcessed(); | 207 void OnCommandProcessed(); |
204 void OnParseError(); | 208 void OnParseError(); |
205 | 209 |
206 void ReportState(); | 210 void ReportState(); |
207 | 211 |
208 // The lifetime of objects of this class is managed by a GpuChannel. The | 212 // The lifetime of objects of this class is managed by a GpuChannel. The |
209 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they | 213 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they |
210 // are destroyed. So a raw pointer is safe. | 214 // are destroyed. So a raw pointer is safe. |
211 GpuChannel* channel_; | 215 GpuChannel* channel_; |
212 | 216 |
213 // The group of contexts that share namespaces with this context. | 217 // The group of contexts that share namespaces with this context. |
214 scoped_refptr<gpu::gles2::ContextGroup> context_group_; | 218 scoped_refptr<gpu::gles2::ContextGroup> context_group_; |
215 | 219 |
216 gfx::GLSurfaceHandle handle_; | 220 gfx::GLSurfaceHandle handle_; |
217 gfx::Size initial_size_; | 221 gfx::Size initial_size_; |
218 gpu::gles2::DisallowedFeatures disallowed_features_; | 222 gpu::gles2::DisallowedFeatures disallowed_features_; |
219 std::string allowed_extensions_; | 223 std::string allowed_extensions_; |
220 std::vector<int32> requested_attribs_; | 224 std::vector<int32> requested_attribs_; |
221 gfx::GpuPreference gpu_preference_; | 225 gfx::GpuPreference gpu_preference_; |
222 int32 route_id_; | 226 int32 route_id_; |
223 bool software_; | 227 bool software_; |
| 228 bool client_has_memory_allocation_changed_callback_; |
224 uint32 last_flush_count_; | 229 uint32 last_flush_count_; |
225 scoped_ptr<GpuCommandBufferStubBase::SurfaceState> surface_state_; | 230 scoped_ptr<GpuCommandBufferStubBase::SurfaceState> surface_state_; |
226 GpuMemoryAllocation allocation_; | 231 GpuMemoryAllocation allocation_; |
227 | 232 |
228 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 233 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
229 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 234 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
230 scoped_ptr<gpu::GpuScheduler> scheduler_; | 235 scoped_ptr<gpu::GpuScheduler> scheduler_; |
231 scoped_refptr<gfx::GLContext> context_; | 236 scoped_refptr<gfx::GLContext> context_; |
232 scoped_refptr<gfx::GLSurface> surface_; | 237 scoped_refptr<gfx::GLSurface> surface_; |
233 | 238 |
(...skipping 11 matching lines...) Expand all Loading... |
245 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; | 250 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; |
246 | 251 |
247 ObserverList<DestructionObserver> destruction_observers_; | 252 ObserverList<DestructionObserver> destruction_observers_; |
248 | 253 |
249 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 254 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
250 }; | 255 }; |
251 | 256 |
252 #endif // defined(ENABLE_GPU) | 257 #endif // defined(ENABLE_GPU) |
253 | 258 |
254 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 259 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |