#include "url/gurl.h"
namespace gpu {
-class GpuControlService;
struct Mailbox;
namespace gles2 {
-class ImageManager;
class MailboxManager;
}
}
class GpuChannel;
class GpuVideoDecodeAccelerator;
+class GpuVideoEncodeAccelerator;
class GpuWatchdog;
+struct WaitForCommandState;
class GpuCommandBufferStub
: public GpuMemoryManagerClient,
virtual ~DestructionObserver() {}
};
- typedef base::Callback<void(const ui::LatencyInfo&)>
+ typedef base::Callback<void(const std::vector<ui::LatencyInfo>&)>
LatencyInfoCallback;
GpuCommandBufferStub(
GpuCommandBufferStub* share_group,
const gfx::GLSurfaceHandle& handle,
gpu::gles2::MailboxManager* mailbox_manager,
- gpu::gles2::ImageManager* image_manager,
const gfx::Size& size,
const gpu::gles2::DisallowedFeatures& disallowed_features,
const std::vector<int32>& attribs,
gfx::GpuPreference gpu_preference() { return gpu_preference_; }
+ int32 GetRequestedAttribute(int attr) const;
+
// Sends a message to the console.
void SendConsoleMessage(int32 id, const std::string& message);
void MarkContextLost();
+ uint64 GetMemoryUsage() const;
+
private:
- GpuMemoryManager* GetMemoryManager();
+ GpuMemoryManager* GetMemoryManager() const;
bool MakeCurrent();
void Destroy();
void OnSetGetBuffer(int32 shm_id, IPC::Message* reply_message);
void OnProduceFrontBuffer(const gpu::Mailbox& mailbox);
void OnGetState(IPC::Message* reply_message);
- void OnGetStateFast(IPC::Message* reply_message);
+ void OnWaitForTokenInRange(int32 start,
+ int32 end,
+ IPC::Message* reply_message);
+ void OnWaitForGetOffsetInRange(int32 start,
+ int32 end,
+ IPC::Message* reply_message);
void OnAsyncFlush(int32 put_offset, uint32 flush_count);
void OnEcho(const IPC::Message& message);
void OnRescheduled();
void OnDestroyTransferBuffer(int32 id);
void OnGetTransferBuffer(int32 id, IPC::Message* reply_message);
- void OnCreateVideoDecoder(
- media::VideoCodecProfile profile,
- IPC::Message* reply_message);
+ void OnCreateVideoDecoder(media::VideoCodecProfile profile,
+ int32 route_id,
+ IPC::Message* reply_message);
+ void OnCreateVideoEncoder(media::VideoFrame::Format input_format,
+ const gfx::Size& input_visible_size,
+ media::VideoCodecProfile output_profile,
+ uint32 initial_bitrate,
+ int32 route_id,
+ IPC::Message* reply_message);
void OnSetSurfaceVisible(bool visible);
- void OnDiscardBackbuffer();
void OnEnsureBackbuffer();
void OnRetireSyncPoint(uint32 sync_point);
void OnSignalSyncPointAck(uint32 id);
void OnSignalQuery(uint32 query, uint32 id);
- void OnReceivedClientManagedMemoryStats(const gpu::ManagedMemoryStats& stats);
void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback);
void OnRegisterGpuMemoryBuffer(int32 id,
- gfx::GpuMemoryBufferHandle gpu_memory_buffer,
+ gfx::GpuMemoryBufferHandle handle,
uint32 width,
uint32 height,
uint32 internalformat);
- void OnDestroyGpuMemoryBuffer(int32 id);
+ void OnUnregisterGpuMemoryBuffer(int32 id);
void OnCommandProcessed();
void OnParseError();
- void OnSetLatencyInfo(const ui::LatencyInfo& latency_info);
+ void OnSetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
+ void OnCreateStreamTexture(
+ uint32 texture_id, int32 stream_id, bool* succeeded);
void ReportState();
void ScheduleDelayedWork(int64 delay);
bool CheckContextLost();
+ void CheckCompleteWaits();
// The lifetime of objects of this class is managed by a GpuChannel. The
// GpuChannels destroy all the GpuCommandBufferStubs that they own when they
scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
scoped_ptr<gpu::GpuScheduler> scheduler_;
scoped_refptr<gfx::GLSurface> surface_;
- scoped_ptr<gpu::GpuControlService> gpu_control_;
scoped_ptr<GpuMemoryManagerClientState> memory_manager_client_state_;
// The last memory allocation received from the GpuMemoryManager (used to
size_t active_url_hash_;
size_t total_gpu_memory_;
+ scoped_ptr<WaitForCommandState> wait_for_token_;
+ scoped_ptr<WaitForCommandState> wait_for_get_offset_;
DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
};