| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef UI_GL_GL_IMAGE_IO_SURFACE_H_ | 5 #ifndef UI_GL_GL_IMAGE_IO_SURFACE_H_ |
| 6 #define UI_GL_GL_IMAGE_IO_SURFACE_H_ | 6 #define UI_GL_GL_IMAGE_IO_SURFACE_H_ |
| 7 | 7 |
| 8 #include <CoreVideo/CVPixelBuffer.h> | 8 #include <CoreVideo/CVPixelBuffer.h> |
| 9 #include <IOSurface/IOSurface.h> | 9 #include <IOSurface/IOSurface.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } | 62 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } |
| 63 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); | 63 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); |
| 64 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer(); | 64 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer(); |
| 65 | 65 |
| 66 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format); | 66 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format); |
| 67 | 67 |
| 68 protected: | 68 protected: |
| 69 ~GLImageIOSurface() override; | 69 ~GLImageIOSurface() override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 class RGBConverter; |
| 73 |
| 72 const gfx::Size size_; | 74 const gfx::Size size_; |
| 73 const unsigned internalformat_; | 75 const unsigned internalformat_; |
| 74 gfx::BufferFormat format_; | 76 gfx::BufferFormat format_; |
| 75 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; | 77 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
| 76 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_; | 78 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_; |
| 77 gfx::GenericSharedMemoryId io_surface_id_; | 79 gfx::GenericSharedMemoryId io_surface_id_; |
| 78 base::ThreadChecker thread_checker_; | 80 base::ThreadChecker thread_checker_; |
| 79 | 81 |
| 80 // GL state to support 420v IOSurface conversion to RGB. | 82 // GL state to support 420v IOSurface conversion to RGB. This is retained |
| 81 unsigned framebuffer_ = 0; | 83 // to avoid re-creating the necessary GL programs every frame. |
| 82 unsigned vertex_shader_ = 0; | 84 scoped_refptr<RGBConverter> rgb_converter_; |
| 83 unsigned fragment_shader_ = 0; | |
| 84 unsigned program_ = 0; | |
| 85 int size_location_ = -1; | |
| 86 unsigned vertex_buffer_ = 0; | |
| 87 | 85 |
| 88 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); | 86 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); |
| 89 }; | 87 }; |
| 90 | 88 |
| 91 } // namespace gl | 89 } // namespace gl |
| 92 | 90 |
| 93 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ | 91 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ |
| OLD | NEW |