| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_YUV420_RGB_CONVERTER_H_ | 5 #ifndef UI_GL_YUV420_RGB_CONVERTER_H_ |
| 6 #define UI_GL_YUV420_RGB_CONVERTER_H_ | 6 #define UI_GL_YUV420_RGB_CONVERTER_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/geometry/size.h" | 8 #include "ui/gfx/geometry/size.h" |
| 9 | 9 |
| 10 namespace gl { | 10 namespace gl { |
| 11 | 11 |
| 12 class YUVToRGBConverter { | 12 class YUVToRGBConverter { |
| 13 public: | 13 public: |
| 14 YUVToRGBConverter(); | 14 YUVToRGBConverter(); |
| 15 ~YUVToRGBConverter(); | 15 ~YUVToRGBConverter(); |
| 16 |
| 17 // The input Y and UV textures should be bound to these texture objects |
| 18 // prior to calling CopyYUV420ToRGB. |
| 19 unsigned y_texture() const { return y_texture_; } |
| 20 unsigned uv_texture() const { return uv_texture_; } |
| 21 |
| 16 void CopyYUV420ToRGB(unsigned target, | 22 void CopyYUV420ToRGB(unsigned target, |
| 17 unsigned y_texture, | |
| 18 unsigned uv_texture, | |
| 19 const gfx::Size& size, | 23 const gfx::Size& size, |
| 20 unsigned rgb_texture); | 24 unsigned rgb_texture); |
| 21 | 25 |
| 22 private: | 26 private: |
| 23 unsigned framebuffer_ = 0; | 27 unsigned framebuffer_ = 0; |
| 24 unsigned vertex_shader_ = 0; | 28 unsigned vertex_shader_ = 0; |
| 25 unsigned fragment_shader_ = 0; | 29 unsigned fragment_shader_ = 0; |
| 26 unsigned program_ = 0; | 30 unsigned program_ = 0; |
| 27 int size_location_ = -1; | 31 int size_location_ = -1; |
| 28 unsigned vertex_buffer_ = 0; | 32 unsigned vertex_buffer_ = 0; |
| 33 unsigned y_texture_ = 0; |
| 34 unsigned uv_texture_ = 0; |
| 29 }; | 35 }; |
| 30 | 36 |
| 31 } // namespace gl | 37 } // namespace gl |
| 32 | 38 |
| 33 #endif // UI_GL_YUV420_RGB_CONVERTER_H_ | 39 #endif // UI_GL_YUV420_RGB_CONVERTER_H_ |
| OLD | NEW |