Index: content/common/gpu/image_transport_surface.h |
diff --git a/content/common/gpu/image_transport_surface.h b/content/common/gpu/image_transport_surface.h |
index 130d5cb436bad29c5f3adb44f70ce4fa83e9d8a3..d432708cf2da0dfca74c6df282b591c94ad2da56 100644 |
--- a/content/common/gpu/image_transport_surface.h |
+++ b/content/common/gpu/image_transport_surface.h |
@@ -26,6 +26,10 @@ |
#include "ui/gfx/swap_result.h" |
#include "ui/gl/gl_surface.h" |
+#if defined(OS_MACOSX) |
+struct AcceleratedSurfaceMsg_BufferPresented_Params; |
+struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
+#endif |
namespace gfx { |
class GLSurface; |
@@ -41,10 +45,6 @@ |
namespace content { |
class GpuChannelManager; |
class GpuCommandBufferStub; |
-#if defined(OS_MACOSX) |
-struct BufferPresentedParams; |
-struct AcceleratedSurfaceBuffersSwappedParams; |
-#endif |
// The GPU process is agnostic as to how it displays results. On some platforms |
// it renders directly to window. On others it renders offscreen and transports |
@@ -64,7 +64,8 @@ |
ImageTransportSurface(); |
#if defined(OS_MACOSX) |
- virtual void BufferPresented(const BufferPresentedParams& params) = 0; |
+ virtual void OnBufferPresented( |
+ const AcceleratedSurfaceMsg_BufferPresented_Params& params) = 0; |
#endif |
virtual void SetLatencyInfo( |
const std::vector<ui::LatencyInfo>& latency_info) = 0; |
@@ -103,23 +104,26 @@ |
}; |
class ImageTransportHelper |
- : public base::SupportsWeakPtr<ImageTransportHelper> { |
+ : public IPC::Listener, |
+ public base::SupportsWeakPtr<ImageTransportHelper> { |
public: |
// Takes weak pointers to objects that outlive the helper. |
ImageTransportHelper(ImageTransportSurface* surface, |
GpuChannelManager* manager, |
GpuCommandBufferStub* stub, |
gfx::PluginWindowHandle handle); |
- ~ImageTransportHelper(); |
+ ~ImageTransportHelper() override; |
bool Initialize(gfx::GLSurface::Format format); |
+ |
+ // IPC::Listener implementation: |
+ bool OnMessageReceived(const IPC::Message& message) override; |
// Helper send functions. Caller fills in the surface specific params |
// like size and surface id. The helper fills in the rest. |
#if defined(OS_MACOSX) |
- void BufferPresented(const BufferPresentedParams& params); |
void SendAcceleratedSurfaceBuffersSwapped( |
- AcceleratedSurfaceBuffersSwappedParams params); |
+ GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params); |
#endif |
// Make the surface's context current. |
@@ -133,6 +137,12 @@ |
private: |
gpu::gles2::GLES2Decoder* Decoder(); |
+ |
+ // IPC::Message handlers. |
+#if defined(OS_MACOSX) |
+ void OnBufferPresented( |
+ const AcceleratedSurfaceMsg_BufferPresented_Params& params); |
+#endif |
// Backbuffer resize callback. |
void Resize(gfx::Size size, float scale_factor); |
@@ -178,7 +188,8 @@ |
// ImageTransportSurface implementation. |
#if defined(OS_MACOSX) |
- void BufferPresented(const BufferPresentedParams& params) override; |
+ void OnBufferPresented( |
+ const AcceleratedSurfaceMsg_BufferPresented_Params& params) override; |
#endif |
gfx::Size GetSize() override; |
void SetLatencyInfo( |