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_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 // We are backed by an offscreen surface for the purposes of creating |
| 17 // a context, but use FBOs to render to texture backed IOSurface |
| 18 class IOSurfaceStorageProvider |
| 19 : public ImageTransportSurfaceFBO::StorageProvider { |
| 20 public: |
| 21 IOSurfaceStorageProvider(); |
| 22 virtual ~IOSurfaceStorageProvider(); |
| 23 |
| 24 // ImageTransportSurfaceFBO::StorageProvider implementation: |
| 25 virtual gfx::Size GetRoundedSize(gfx::Size size) OVERRIDE; |
| 26 virtual bool AllocateColorBufferStorage( |
| 27 CGLContextObj context, gfx::Size size) OVERRIDE; |
| 28 virtual void FreeColorBufferStorage() OVERRIDE; |
| 29 virtual void PopulateSwapBuffersStorageParams( |
| 30 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params* params) OVERRIDE; |
| 31 virtual void PopulateSubBufferStorageParams( |
| 32 GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params* params) OVERRIDE; |
| 33 |
| 34 private: |
| 35 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
| 36 |
| 37 // The id of |io_surface_| or 0 if that's NULL. |
| 38 uint64 io_surface_handle_; |
| 39 }; |
| 40 |
| 41 } // namespace content |
| 42 |
| 43 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ |
OLD | NEW |