Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.h

Issue 10083056: GpuMemoryManager suggests values for renderer Contents Texture Managers' preferred memory limit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing issue with every proxy registering a callback, even when it is null. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 handles_memory_allocations() const = 0;
nduca 2012/04/23 22:12:18 bikeshed man wonders if "client responds to" or "c
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
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 bool handles_memory_allocations() const OVERRIDE {
112 return handles_memory_allocations_;
113 }
110 virtual bool has_surface_state() const OVERRIDE; 114 virtual bool has_surface_state() const OVERRIDE;
111 virtual const GpuCommandBufferStubBase::SurfaceState& surface_state() const 115 virtual const GpuCommandBufferStubBase::SurfaceState& surface_state() const
112 OVERRIDE; 116 OVERRIDE;
113 117
114 // Returns true iff |other| is in the same context share group as this stub. 118 // Returns true iff |other| is in the same context share group as this stub.
115 virtual bool IsInSameContextShareGroup( 119 virtual bool IsInSameContextShareGroup(
116 const GpuCommandBufferStubBase& other) const OVERRIDE; 120 const GpuCommandBufferStubBase& other) const OVERRIDE;
117 121
118 // Sends memory allocation limits to render process. 122 // Sends memory allocation limits to render process.
119 virtual void SendMemoryAllocationToProxy( 123 virtual void SendMemoryAllocationToProxy(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 void OnCreateVideoDecoder( 195 void OnCreateVideoDecoder(
192 media::VideoCodecProfile profile, 196 media::VideoCodecProfile profile,
193 IPC::Message* reply_message); 197 IPC::Message* reply_message);
194 void OnDestroyVideoDecoder(int32 decoder_route_id); 198 void OnDestroyVideoDecoder(int32 decoder_route_id);
195 199
196 void OnSetSurfaceVisible(bool visible); 200 void OnSetSurfaceVisible(bool visible);
197 201
198 void OnDiscardBackbuffer(); 202 void OnDiscardBackbuffer();
199 void OnEnsureBackbuffer(); 203 void OnEnsureBackbuffer();
200 204
205 void OnHandlesMemoryAllocations();
206
201 void OnReschedule(); 207 void OnReschedule();
202 208
203 void OnCommandProcessed(); 209 void OnCommandProcessed();
204 void OnParseError(); 210 void OnParseError();
205 211
206 void ReportState(); 212 void ReportState();
207 213
208 // The lifetime of objects of this class is managed by a GpuChannel. The 214 // The lifetime of objects of this class is managed by a GpuChannel. The
209 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they 215 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they
210 // are destroyed. So a raw pointer is safe. 216 // are destroyed. So a raw pointer is safe.
211 GpuChannel* channel_; 217 GpuChannel* channel_;
212 218
213 // The group of contexts that share namespaces with this context. 219 // The group of contexts that share namespaces with this context.
214 scoped_refptr<gpu::gles2::ContextGroup> context_group_; 220 scoped_refptr<gpu::gles2::ContextGroup> context_group_;
215 221
216 gfx::GLSurfaceHandle handle_; 222 gfx::GLSurfaceHandle handle_;
217 gfx::Size initial_size_; 223 gfx::Size initial_size_;
218 gpu::gles2::DisallowedFeatures disallowed_features_; 224 gpu::gles2::DisallowedFeatures disallowed_features_;
219 std::string allowed_extensions_; 225 std::string allowed_extensions_;
220 std::vector<int32> requested_attribs_; 226 std::vector<int32> requested_attribs_;
221 gfx::GpuPreference gpu_preference_; 227 gfx::GpuPreference gpu_preference_;
222 int32 route_id_; 228 int32 route_id_;
223 bool software_; 229 bool software_;
230 bool handles_memory_allocations_;
224 uint32 last_flush_count_; 231 uint32 last_flush_count_;
225 scoped_ptr<GpuCommandBufferStubBase::SurfaceState> surface_state_; 232 scoped_ptr<GpuCommandBufferStubBase::SurfaceState> surface_state_;
226 GpuMemoryAllocation allocation_; 233 GpuMemoryAllocation allocation_;
227 234
228 scoped_ptr<gpu::CommandBufferService> command_buffer_; 235 scoped_ptr<gpu::CommandBufferService> command_buffer_;
229 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; 236 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
230 scoped_ptr<gpu::GpuScheduler> scheduler_; 237 scoped_ptr<gpu::GpuScheduler> scheduler_;
231 scoped_refptr<gfx::GLContext> context_; 238 scoped_refptr<gfx::GLContext> context_;
232 scoped_refptr<gfx::GLSurface> surface_; 239 scoped_refptr<gfx::GLSurface> surface_;
233 240
(...skipping 11 matching lines...) Expand all
245 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_; 252 IDMap<GpuVideoDecodeAccelerator, IDMapOwnPointer> video_decoders_;
246 253
247 ObserverList<DestructionObserver> destruction_observers_; 254 ObserverList<DestructionObserver> destruction_observers_;
248 255
249 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 256 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
250 }; 257 };
251 258
252 #endif // defined(ENABLE_GPU) 259 #endif // defined(ENABLE_GPU)
253 260
254 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 261 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698