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 <IOSurface/IOSurface.h> | 8 #include <IOSurface/IOSurface.h> |
9 | 9 |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const gfx::RectF& crop_rect) override; | 46 const gfx::RectF& crop_rect) override; |
47 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 47 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
48 uint64_t process_tracing_id, | 48 uint64_t process_tracing_id, |
49 const std::string& dump_name) override; | 49 const std::string& dump_name) override; |
50 | 50 |
51 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } | 51 gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } |
52 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); | 52 base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); |
53 | 53 |
54 static void SetLayerForWidget(gfx::AcceleratedWidget widget, CALayer* layer); | 54 static void SetLayerForWidget(gfx::AcceleratedWidget widget, CALayer* layer); |
55 | 55 |
| 56 static unsigned GetInternalFormatForTesting(gfx::BufferFormat format); |
| 57 |
56 protected: | 58 protected: |
57 ~GLImageIOSurface() override; | 59 ~GLImageIOSurface() override; |
58 | 60 |
59 private: | 61 private: |
60 const gfx::Size size_; | 62 const gfx::Size size_; |
61 const unsigned internalformat_; | 63 const unsigned internalformat_; |
62 gfx::BufferFormat format_; | 64 gfx::BufferFormat format_; |
63 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; | 65 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; |
64 gfx::GenericSharedMemoryId io_surface_id_; | 66 gfx::GenericSharedMemoryId io_surface_id_; |
65 base::ThreadChecker thread_checker_; | 67 base::ThreadChecker thread_checker_; |
66 | 68 |
| 69 // GL state to support 420v IOSurface conversion to RGB. |
| 70 unsigned framebuffer_ = 0; |
| 71 unsigned vertex_shader_ = 0; |
| 72 unsigned fragment_shader_ = 0; |
| 73 unsigned program_ = 0; |
| 74 int size_location_ = -1; |
| 75 unsigned vertex_buffer_ = 0; |
| 76 unsigned yuv_textures_[2] = {}; |
| 77 |
67 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); | 78 DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); |
68 }; | 79 }; |
69 | 80 |
70 } // namespace gl | 81 } // namespace gl |
71 | 82 |
72 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ | 83 #endif // UI_GL_GL_IMAGE_IO_SURFACE_H_ |
OLD | NEW |