OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_ |
| 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_ |
| 7 |
| 8 #include "content/common/gpu/image_transport_surface_fbo_mac.h" |
| 9 #include "ui/gl/gl_bindings.h" |
| 10 |
| 11 // Note that this must be included after gl_bindings.h to avoid conflicts. |
| 12 #include <OpenGL/CGLIOSurface.h> |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // Allocate IOSurface-backed storage for an FBO image transport surface. |
| 17 class IOSurfaceStorageProvider |
| 18 : public ImageTransportSurfaceFBO::StorageProvider { |
| 19 public: |
| 20 IOSurfaceStorageProvider(); |
| 21 virtual ~IOSurfaceStorageProvider(); |
| 22 |
| 23 // ImageTransportSurfaceFBO::StorageProvider implementation: |
| 24 virtual gfx::Size GetRoundedSize(gfx::Size size) OVERRIDE; |
| 25 virtual bool AllocateColorBufferStorage( |
| 26 CGLContextObj context, gfx::Size size) OVERRIDE; |
| 27 virtual void FreeColorBufferStorage() OVERRIDE; |
| 28 virtual uint64 GetSurfaceHandle() const OVERRIDE; |
| 29 |
| 30 private: |
| 31 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
| 32 |
| 33 // The id of |io_surface_| or 0 if that's NULL. |
| 34 IOSurfaceID io_surface_handle_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(IOSurfaceStorageProvider); |
| 37 }; |
| 38 |
| 39 } // namespace content |
| 40 |
| 41 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ |
OLD | NEW |