summaryrefslogtreecommitdiffstats
path: root/content/common/gpu/image_transport_surface.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/common/gpu/image_transport_surface.h')
-rw-r--r--content/common/gpu/image_transport_surface.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/content/common/gpu/image_transport_surface.h b/content/common/gpu/image_transport_surface.h
index 130d5cb..d432708 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 @@ class GLES2Decoder;
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 @@ class ImageTransportSurface {
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 ImageTransportSurface {
};
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.
@@ -134,6 +138,12 @@ class ImageTransportHelper
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 @@ class PassThroughImageTransportSurface
// 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(