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