| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "ui/surface/io_surface_support_mac.h" | 8 #include "ui/surface/io_surface_support_mac.h" |
| 9 | 9 |
| 10 typedef CFTypeRef (*IOSurfaceCreateProcPtr)(CFDictionaryRef properties); | 10 typedef CFTypeRef (*IOSurfaceCreateProcPtr)(CFDictionaryRef properties); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 CVPixelBufferRef pixel_buffer); | 27 CVPixelBufferRef pixel_buffer); |
| 28 | 28 |
| 29 class IOSurfaceSupportImpl : public IOSurfaceSupport { | 29 class IOSurfaceSupportImpl : public IOSurfaceSupport { |
| 30 public: | 30 public: |
| 31 static IOSurfaceSupportImpl* GetInstance(); | 31 static IOSurfaceSupportImpl* GetInstance(); |
| 32 | 32 |
| 33 bool InitializedSuccessfully() { | 33 bool InitializedSuccessfully() { |
| 34 return initialized_successfully_; | 34 return initialized_successfully_; |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual CFStringRef GetKIOSurfaceWidth(); | 37 virtual CFStringRef GetKIOSurfaceWidth() OVERRIDE; |
| 38 virtual CFStringRef GetKIOSurfaceHeight(); | 38 virtual CFStringRef GetKIOSurfaceHeight() OVERRIDE; |
| 39 virtual CFStringRef GetKIOSurfaceBytesPerElement(); | 39 virtual CFStringRef GetKIOSurfaceBytesPerElement() OVERRIDE; |
| 40 virtual CFStringRef GetKIOSurfaceIsGlobal(); | 40 virtual CFStringRef GetKIOSurfaceIsGlobal() OVERRIDE; |
| 41 | 41 |
| 42 virtual CFTypeRef IOSurfaceCreate(CFDictionaryRef properties); | 42 virtual CFTypeRef IOSurfaceCreate(CFDictionaryRef properties) OVERRIDE; |
| 43 virtual uint32 IOSurfaceGetID(CFTypeRef io_surface); | 43 virtual uint32 IOSurfaceGetID(CFTypeRef io_surface) OVERRIDE; |
| 44 virtual CFTypeRef IOSurfaceLookup(uint32 io_surface_id); | 44 virtual CFTypeRef IOSurfaceLookup(uint32 io_surface_id) OVERRIDE; |
| 45 virtual mach_port_t IOSurfaceCreateMachPort(CFTypeRef io_surface); | 45 virtual mach_port_t IOSurfaceCreateMachPort(CFTypeRef io_surface) OVERRIDE; |
| 46 virtual CFTypeRef IOSurfaceLookupFromMachPort(mach_port_t port); | 46 virtual CFTypeRef IOSurfaceLookupFromMachPort(mach_port_t port) OVERRIDE; |
| 47 | 47 |
| 48 virtual size_t IOSurfaceGetWidth(CFTypeRef io_surface); | 48 virtual size_t IOSurfaceGetWidth(CFTypeRef io_surface) OVERRIDE; |
| 49 virtual size_t IOSurfaceGetHeight(CFTypeRef io_surface); | 49 virtual size_t IOSurfaceGetHeight(CFTypeRef io_surface) OVERRIDE; |
| 50 | 50 |
| 51 virtual CGLError CGLTexImageIOSurface2D(CGLContextObj ctx, | 51 virtual CGLError CGLTexImageIOSurface2D(CGLContextObj ctx, |
| 52 GLenum target, | 52 GLenum target, |
| 53 GLenum internal_format, | 53 GLenum internal_format, |
| 54 GLsizei width, | 54 GLsizei width, |
| 55 GLsizei height, | 55 GLsizei height, |
| 56 GLenum format, | 56 GLenum format, |
| 57 GLenum type, | 57 GLenum type, |
| 58 CFTypeRef io_surface, | 58 CFTypeRef io_surface, |
| 59 GLuint plane); | 59 GLuint plane) OVERRIDE; |
| 60 | 60 |
| 61 virtual CFTypeRef CVPixelBufferGetIOSurface( | 61 virtual CFTypeRef CVPixelBufferGetIOSurface( |
| 62 CVPixelBufferRef pixel_buffer) OVERRIDE; | 62 CVPixelBufferRef pixel_buffer) OVERRIDE; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 IOSurfaceSupportImpl(); | 65 IOSurfaceSupportImpl(); |
| 66 ~IOSurfaceSupportImpl(); | 66 virtual ~IOSurfaceSupportImpl(); |
| 67 | 67 |
| 68 void CloseLibraryHandles(); | 68 void CloseLibraryHandles(); |
| 69 | 69 |
| 70 void* iosurface_handle_; | 70 void* iosurface_handle_; |
| 71 void* opengl_handle_; | 71 void* opengl_handle_; |
| 72 void* core_video_handle_; | 72 void* core_video_handle_; |
| 73 CFStringRef k_io_surface_width_; | 73 CFStringRef k_io_surface_width_; |
| 74 CFStringRef k_io_surface_height_; | 74 CFStringRef k_io_surface_height_; |
| 75 CFStringRef k_io_surface_bytes_per_element_; | 75 CFStringRef k_io_surface_bytes_per_element_; |
| 76 CFStringRef k_io_surface_is_global_; | 76 CFStringRef k_io_surface_is_global_; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 IOSurfaceSupport* IOSurfaceSupport::Initialize() { | 294 IOSurfaceSupport* IOSurfaceSupport::Initialize() { |
| 295 return IOSurfaceSupportImpl::GetInstance(); | 295 return IOSurfaceSupportImpl::GetInstance(); |
| 296 } | 296 } |
| 297 | 297 |
| 298 IOSurfaceSupport::IOSurfaceSupport() { | 298 IOSurfaceSupport::IOSurfaceSupport() { |
| 299 } | 299 } |
| 300 | 300 |
| 301 IOSurfaceSupport::~IOSurfaceSupport() { | 301 IOSurfaceSupport::~IOSurfaceSupport() { |
| 302 } | 302 } |
| 303 | 303 |
| OLD | NEW |