Index: content/common/gpu/image_transport_surface_iosurface_mac.h |
diff --git a/content/common/gpu/image_transport_surface_iosurface_mac.h b/content/common/gpu/image_transport_surface_iosurface_mac.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0f2a14168118d88bc70e083f96bbf66d975bc45a |
--- /dev/null |
+++ b/content/common/gpu/image_transport_surface_iosurface_mac.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_ |
+#define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_ |
+ |
+#include "content/common/gpu/image_transport_surface_mac.h" |
+#include "ui/gl/gl_bindings.h" |
+ |
+// Note that this must be included after gl_bindings.h to avoid conflicts. |
+#include <OpenGL/CGLIOSurface.h> |
+ |
+namespace content { |
+ |
+// We are backed by an offscreen surface for the purposes of creating |
+// a context, but use FBOs to render to texture backed IOSurface |
+class IOSurfaceStorageProvider |
+ : public ImageTransportSurfaceFBO::StorageProvider { |
+ public: |
+ IOSurfaceStorageProvider(); |
+ virtual ~IOSurfaceStorageProvider(); |
+ |
+ // ImageTransportSurfaceFBO::StorageProvider implementation: |
+ virtual gfx::Size GetRoundedSize(gfx::Size size) OVERRIDE; |
+ virtual bool AllocateColorBufferStorage( |
+ CGLContextObj context, gfx::Size size) OVERRIDE; |
+ virtual void FreeColorBufferStorage() OVERRIDE; |
+ virtual void PopulateSwapBuffersStorageParams( |
+ GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params* params) OVERRIDE; |
+ virtual void PopulateSubBufferStorageParams( |
+ GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params* params) OVERRIDE; |
+ |
+ private: |
+ base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
+ |
+ // The id of |io_surface_| or 0 if that's NULL. |
+ uint64 io_surface_handle_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ |