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

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

Issue 334173006: Clean up GLSurfaceCGL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 years, 6 months 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
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..ccd0a4cb89cae3ec01c0806a25df1cdf232ddac9
--- /dev/null
+++ b/content/common/gpu/image_transport_surface_iosurface_mac.h
@@ -0,0 +1,41 @@
+// 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_fbo_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 {
+
+// Allocate IOSurface-backed storage for an FBO image transport surface.
+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 uint64 GetSurfaceHandle() const OVERRIDE;
+
+ private:
+ base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
+
+ // The id of |io_surface_| or 0 if that's NULL.
+ IOSurfaceID io_surface_handle_;
+
+ DISALLOW_COPY_AND_ASSIGN(IOSurfaceStorageProvider);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_
« no previous file with comments | « content/common/gpu/image_transport_surface_fbo_mac.cc ('k') | content/common/gpu/image_transport_surface_iosurface_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698