class MessageLoopProxy;
}
-namespace gpu {
-struct Mailbox;
-}
-
namespace IPC {
class SyncMessageFilter;
}
namespace content {
class CommandBufferProxyImpl;
class GpuChannelHost;
-struct GpuRenderingStats;
struct GpuListenerInfo {
GpuListenerInfo();
// Destroy a command buffer created by this channel.
void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer);
- // Collect rendering stats from GPU process.
- bool CollectRenderingStatsForSurface(
- int surface_id, GpuRenderingStats* stats);
-
// Add a route for the current message loop.
void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener);
void RemoveRoute(int route_id);
base::SharedMemoryHandle ShareToGpuProcess(
base::SharedMemoryHandle source_handle);
- // Generates |num| unique mailbox names that can be used with
- // GL_texture_mailbox_CHROMIUM. Unlike genMailboxCHROMIUM, this IPC is
- // handled only on the GPU process' IO thread, and so is not effectively
- // a finish.
- bool GenerateMailboxNames(unsigned num, std::vector<gpu::Mailbox>* names);
-
// Reserve one unused transfer buffer ID.
int32 ReserveTransferBufferId();
// Whether the channel is lost.
bool IsLost() const;
- // Gets mailboxes from the pool, and return the number of mailboxes to ask
- // the GPU process to maintain a good pool size. The caller is responsible
- // for sending the GpuChannelMsg_GenerateMailboxNamesAsync message.
- size_t GetMailboxNames(size_t num, std::vector<gpu::Mailbox>* names);
-
private:
virtual ~MessageFilter();
- bool OnControlMessageReceived(const IPC::Message& msg);
-
- // Message handlers.
- void OnGenerateMailboxNamesReply(const std::vector<gpu::Mailbox>& names);
// Threading notes: |listeners_| is only accessed on the IO thread. Every
// other field is protected by |lock_|.
// Whether the channel has been lost.
bool lost_;
-
- // A pool of valid mailbox names.
- std::vector<gpu::Mailbox> mailbox_name_pool_;
-
- // Number of pending mailbox requested from the GPU process.
- size_t requested_mailboxes_;
};
// Threading notes: all fields are constant during the lifetime of |this|