Chromium Code Reviews| Index: content/common/gpu/gpu_command_buffer_stub.h |
| diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h |
| index 75ac792b19c5d958089c8e1bde8ab6be0c665030..df21523b1725703fa43e6b39dcf2602934869353 100644 |
| --- a/content/common/gpu/gpu_command_buffer_stub.h |
| +++ b/content/common/gpu/gpu_command_buffer_stub.h |
| @@ -48,23 +48,24 @@ class MailboxManager; |
| // testability. |
| class CONTENT_EXPORT GpuCommandBufferStubBase { |
| public: |
| - struct CONTENT_EXPORT SurfaceState { |
| - int32 surface_id; |
| + struct CONTENT_EXPORT MemoryManagerState { |
| + // Offscreen commandbuffers will not have a surface. |
| + bool has_surface; |
| bool visible; |
| + bool client_has_memory_allocation_changed_callback; |
| + // Use time is determined by the last time that visibility was changed |
|
Ken Russell (switch to Gerrit)
2012/10/16 22:06:01
Nit: prefer complete sentences in comments. http:/
ccameron
2012/10/16 22:29:32
Done.
|
| base::TimeTicks last_used_time; |
| - SurfaceState(int32 surface_id, |
| - bool visible, |
| - base::TimeTicks last_used_time); |
| + MemoryManagerState( |
| + bool has_surface, |
| + bool visible, |
| + base::TimeTicks last_used_time); |
| }; |
| public: |
| virtual ~GpuCommandBufferStubBase() {} |
| - // Will not have surface state if this is an offscreen commandbuffer. |
| - virtual bool client_has_memory_allocation_changed_callback() const = 0; |
| - virtual bool has_surface_state() const = 0; |
| - virtual const SurfaceState& surface_state() const = 0; |
| + virtual const MemoryManagerState& memory_manager_state() const = 0; |
| virtual gfx::Size GetSurfaceSize() const = 0; |
| @@ -117,10 +118,10 @@ class GpuCommandBufferStub |
| virtual bool Send(IPC::Message* msg) OVERRIDE; |
| // GpuCommandBufferStubBase implementation: |
| - virtual bool client_has_memory_allocation_changed_callback() const OVERRIDE; |
| - virtual bool has_surface_state() const OVERRIDE; |
| - virtual const GpuCommandBufferStubBase::SurfaceState& surface_state() const |
| - OVERRIDE; |
| + virtual const GpuCommandBufferStubBase::MemoryManagerState& |
| + memory_manager_state() const OVERRIDE { |
| + return *memory_manager_state_.get(); |
| + } |
| // Returns surface size. |
| virtual gfx::Size GetSurfaceSize() const OVERRIDE; |
| @@ -153,7 +154,7 @@ class GpuCommandBufferStub |
| // Identifies the target surface. |
| int32 surface_id() const { |
| - return (surface_state_.get()) ? surface_state_->surface_id : 0; |
| + return surface_id_; |
| } |
| // Identifies the various GpuCommandBufferStubs in the GPU process belonging |
| @@ -256,10 +257,10 @@ class GpuCommandBufferStub |
| std::vector<int32> requested_attribs_; |
| gfx::GpuPreference gpu_preference_; |
| int32 route_id_; |
| + int32 surface_id_; |
| bool software_; |
| - bool client_has_memory_allocation_changed_callback_; |
| uint32 last_flush_count_; |
| - scoped_ptr<GpuCommandBufferStubBase::SurfaceState> surface_state_; |
| + scoped_ptr<MemoryManagerState> memory_manager_state_; |
| scoped_ptr<gpu::CommandBufferService> command_buffer_; |
| scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |