Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: content/common/gpu/image_transport_surface.h

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/common/gpu/image_transport_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface.h
===================================================================
--- content/common/gpu/image_transport_surface.h (revision 108480)
+++ content/common/gpu/image_transport_surface.h (working copy)
@@ -8,9 +8,12 @@
#if defined(ENABLE_GPU)
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_message.h"
+#include "ui/gfx/gl/gl_surface.h"
#include "ui/gfx/size.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/surface/transport_dib.h"
@@ -48,9 +51,13 @@
class ImageTransportSurface {
public:
+ ImageTransportSurface();
+ virtual ~ImageTransportSurface();
+
virtual void OnNewSurfaceACK(
uint64 surface_id, TransportDIB::Handle surface_handle) = 0;
virtual void OnBuffersSwappedACK() = 0;
+ virtual void OnResizeViewACK() = 0;
virtual void OnResize(gfx::Size size) = 0;
// Creates the appropriate surface depending on the GL implementation.
@@ -60,6 +67,8 @@
int32 renderer_id,
int32 command_buffer_id,
gfx::PluginWindowHandle handle);
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ImageTransportSurface);
};
class ImageTransportHelper : public IPC::Channel::Listener {
@@ -87,10 +96,13 @@
GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params);
void SendAcceleratedSurfaceRelease(
GpuHostMsg_AcceleratedSurfaceRelease_Params params);
+ void SendResizeView(const gfx::Size& size);
// Whether or not we should execute more commands.
void SetScheduled(bool is_scheduled);
+ void DeferToFence(base::Closure task);
+
// Make the surface's context current.
bool MakeCurrent();
@@ -101,10 +113,14 @@
// IPC::Message handlers.
void OnNewSurfaceACK(uint64 surface_id, TransportDIB::Handle surface_handle);
void OnBuffersSwappedACK();
+ void OnResizeViewACK();
// Backbuffer resize callback.
void Resize(gfx::Size size);
+ // Set the default swap interval on the surface.
+ void SetSwapInterval();
+
// Weak pointers that point to objects that outlive this helper.
ImageTransportSurface* surface_;
GpuChannelManager* manager_;
@@ -118,6 +134,36 @@
DISALLOW_COPY_AND_ASSIGN(ImageTransportHelper);
};
+// An implementation of ImageTransportSurface that implements GLSurface through
+// GLSurfaceAdapter, thereby forwarding GLSurface methods through to it.
+class PassThroughImageTransportSurface
+ : public gfx::GLSurfaceAdapter,
+ public ImageTransportSurface {
+ public:
+ PassThroughImageTransportSurface(GpuChannelManager* manager,
+ int32 render_view_id,
+ int32 renderer_id,
+ int32 command_buffer_id,
+ gfx::GLSurface* surface);
+ virtual ~PassThroughImageTransportSurface();
+
+ // GLSurface implementation.
+ virtual bool Initialize();
+ virtual void Destroy();
+
+ // ImageTransportSurface implementation.
+ virtual void OnNewSurfaceACK(
+ uint64 surface_id, TransportDIB::Handle surface_handle) OVERRIDE;
+ virtual void OnBuffersSwappedACK() OVERRIDE;
+ virtual void OnResizeViewACK() OVERRIDE;
+ virtual void OnResize(gfx::Size size) OVERRIDE;
+
+ private:
+ scoped_ptr<ImageTransportHelper> helper_;
+
+ DISALLOW_COPY_AND_ASSIGN(PassThroughImageTransportSurface);
+};
+
#endif // defined(ENABLE_GPU)
#endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_H_
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/common/gpu/image_transport_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698