| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_BROWSER_COMPOSITOR_GL_HELPER_SCALING_H_ | 5 #ifndef COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_GL_HELPER_SCALING_H_ | 6 #define COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "content/browser/compositor/gl_helper.h" | 13 #include "components/display_compositor/display_compositor_export.h" |
| 14 #include "components/display_compositor/gl_helper.h" |
| 14 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 15 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 16 | 17 |
| 17 namespace content { | 18 namespace display_compositor { |
| 18 | 19 |
| 19 class ShaderProgram; | 20 class ShaderProgram; |
| 20 class ScalerImpl; | 21 class ScalerImpl; |
| 21 class GLHelperTest; | 22 class GLHelperTest; |
| 22 | 23 |
| 23 // Implements GPU texture scaling methods. | 24 // Implements GPU texture scaling methods. |
| 24 // Note that you should probably not use this class directly. | 25 // Note that you should probably not use this class directly. |
| 25 // See gl_helper.cc::CreateScaler instead. | 26 // See gl_helper.cc::CreateScaler instead. |
| 26 class CONTENT_EXPORT GLHelperScaling { | 27 class DISPLAY_COMPOSITOR_EXPORT GLHelperScaling { |
| 27 public: | 28 public: |
| 28 enum ShaderType { | 29 enum ShaderType { |
| 29 SHADER_BILINEAR, | 30 SHADER_BILINEAR, |
| 30 SHADER_BILINEAR2, | 31 SHADER_BILINEAR2, |
| 31 SHADER_BILINEAR3, | 32 SHADER_BILINEAR3, |
| 32 SHADER_BILINEAR4, | 33 SHADER_BILINEAR4, |
| 33 SHADER_BILINEAR2X2, | 34 SHADER_BILINEAR2X2, |
| 34 SHADER_BICUBIC_UPSCALE, | 35 SHADER_BICUBIC_UPSCALE, |
| 35 SHADER_BICUBIC_HALF_1D, | 36 SHADER_BICUBIC_HALF_1D, |
| 36 SHADER_PLANAR, | 37 SHADER_PLANAR, |
| 37 SHADER_YUV_MRT_PASS1, | 38 SHADER_YUV_MRT_PASS1, |
| 38 SHADER_YUV_MRT_PASS2, | 39 SHADER_YUV_MRT_PASS2, |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 // Similar to ScalerInterface, but can generate multiple outputs. | 42 // Similar to ScalerInterface, but can generate multiple outputs. |
| 42 // Used for YUV conversion in gl_helper.c | 43 // Used for YUV conversion in gl_helper.c |
| 43 class CONTENT_EXPORT ShaderInterface { | 44 class DISPLAY_COMPOSITOR_EXPORT ShaderInterface { |
| 44 public: | 45 public: |
| 45 ShaderInterface() {} | 46 ShaderInterface() {} |
| 46 virtual ~ShaderInterface() {} | 47 virtual ~ShaderInterface() {} |
| 47 // Note that the src_texture will have the min/mag filter set to GL_LINEAR | 48 // Note that the src_texture will have the min/mag filter set to GL_LINEAR |
| 48 // and wrap_s/t set to CLAMP_TO_EDGE in this call. | 49 // and wrap_s/t set to CLAMP_TO_EDGE in this call. |
| 49 virtual void Execute(GLuint source_texture, | 50 virtual void Execute(GLuint source_texture, |
| 50 const std::vector<GLuint>& dest_textures) = 0; | 51 const std::vector<GLuint>& dest_textures) = 0; |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; | 54 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 GLHelper* helper_; | 191 GLHelper* helper_; |
| 191 | 192 |
| 192 // The buffer that holds the vertices and the texture coordinates data for | 193 // The buffer that holds the vertices and the texture coordinates data for |
| 193 // drawing a quad. | 194 // drawing a quad. |
| 194 ScopedBuffer vertex_attributes_buffer_; | 195 ScopedBuffer vertex_attributes_buffer_; |
| 195 | 196 |
| 196 std::map<ShaderProgramKeyType, scoped_refptr<ShaderProgram>> shader_programs_; | 197 std::map<ShaderProgramKeyType, scoped_refptr<ShaderProgram>> shader_programs_; |
| 197 | 198 |
| 198 friend class ShaderProgram; | 199 friend class ShaderProgram; |
| 199 friend class ScalerImpl; | 200 friend class ScalerImpl; |
| 201 friend class GLHelperBenchmark; |
| 200 friend class GLHelperTest; | 202 friend class GLHelperTest; |
| 201 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); | 203 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); |
| 202 }; | 204 }; |
| 203 | 205 |
| 204 } // namespace content | 206 } // namespace display_compositor |
| 205 | 207 |
| 206 #endif // CONTENT_BROWSER_COMPOSITOR_GL_HELPER_SCALING_H_ | 208 #endif // COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ |
| OLD | NEW |