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 8f4e84a0f092e32e70e6385c50471eb5f4bd7c9b..613a9004cecc5c42924737c987b6fe7c085e1557 100644 |
| --- a/content/common/gpu/gpu_command_buffer_stub.h |
| +++ b/content/common/gpu/gpu_command_buffer_stub.h |
| @@ -13,6 +13,7 @@ |
| #include "base/id_map.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "content/common/content_export.h" |
| #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| #include "gpu/command_buffer/common/constants.h" |
| #include "gpu/command_buffer/service/command_buffer_service.h" |
| @@ -32,11 +33,38 @@ |
| #endif |
| class GpuChannel; |
| +class GpuMemoryAllocation; |
| class GpuWatchdog; |
| -class GpuCommandBufferStub |
| +class CONTENT_EXPORT GpuCommandBufferStubBase { |
|
nduca
2012/02/01 00:01:17
Put a comment above this class explaining that exp
|
| + public: |
| + struct CONTENT_EXPORT SurfaceState { |
| + int32 surface_id; |
| + bool visible; |
| + base::TimeTicks last_used_time; |
| + |
| + SurfaceState(int32 surface_id, |
| + bool visible, |
| + base::TimeTicks last_used_time); |
| + }; |
| + |
| + public: |
| + virtual ~GpuCommandBufferStubBase() {} |
| + |
| + // Null if surface_id == 0. |
|
nduca
2012/02/01 00:01:17
Null if this is an offscreen commandbuffer. surfac
|
| + virtual SurfaceState* surface_state() = 0; |
| + |
| + // This stubs' surface_id should *not* be in the affected_surface_ids list |
| + virtual const std::vector<int32>& affected_surface_ids() = 0; |
| + |
| + virtual void SendMemoryAllocationToProxy( |
| + const GpuMemoryAllocation& allocation) = 0; |
| +}; |
| + |
| +class CONTENT_EXPORT GpuCommandBufferStub |
| : public IPC::Channel::Listener, |
| public IPC::Message::Sender, |
| + public GpuCommandBufferStubBase, |
| public base::SupportsWeakPtr<GpuCommandBufferStub> { |
| public: |
| GpuCommandBufferStub( |
| @@ -61,6 +89,15 @@ class GpuCommandBufferStub |
| // IPC::Message::Sender implementation: |
| virtual bool Send(IPC::Message* msg) OVERRIDE; |
| + // GpuCommandBufferStubBase implementation: |
| + virtual GpuCommandBufferStubBase::SurfaceState* surface_state() OVERRIDE; |
| + // affected_surface_ids refers to others stubs' surfaces. This stubs' |
|
nduca
2012/02/01 00:01:17
space between methods.
Change comment so that it
|
| + // surface_id is found via surface state |
| + virtual const std::vector<int32>& affected_surface_ids() OVERRIDE; |
| + virtual void SendMemoryAllocationToProxy( |
| + const GpuMemoryAllocation& allocation) OVERRIDE; |
| + |
| + |
| // Whether this command buffer can currently handle IPC messages. |
| bool IsScheduled(); |
| @@ -74,7 +111,8 @@ class GpuCommandBufferStub |
| gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } |
| // Identifies the target surface. |
| - int32 surface_id() const { return surface_id_; } |
| + int32 surface_id() const { return (surface_state_.get()) ? |
|
nduca
2012/02/01 00:01:17
newline after the {
maybe move to cpp
|
| + surface_state_->surface_id : 0; } |
| // Identifies the various GpuCommandBufferStubs in the GPU process belonging |
| // to the same renderer process. |
| @@ -141,6 +179,8 @@ class GpuCommandBufferStub |
| int32 route_id_; |
| bool software_; |
| uint32 last_flush_count_; |
| + scoped_ptr<GpuCommandBufferStubBase::SurfaceState> surface_state_; |
| + std::vector<int32> affected_surface_ids_; |
| // Identifies the window for the rendering results on the browser side. |
| int32 surface_id_; |
|
nduca
2012/02/01 00:01:17
Are you deleting this? Looks like you've gotten 99
|