| 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 COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ | 5 #ifndef COMPONENTS_VIZ_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ |
| 6 #define COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ | 6 #define COMPONENTS_VIZ_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 "components/display_compositor/display_compositor_export.h" | 13 #include "components/viz/display_compositor/gl_helper.h" |
| 14 #include "components/display_compositor/gl_helper.h" | 14 #include "components/viz/viz_export.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 17 | 17 |
| 18 namespace display_compositor { | 18 namespace viz { |
| 19 | 19 |
| 20 class ShaderProgram; | 20 class ShaderProgram; |
| 21 class ScalerImpl; | 21 class ScalerImpl; |
| 22 class GLHelperTest; | 22 class GLHelperTest; |
| 23 | 23 |
| 24 // Implements GPU texture scaling methods. | 24 // Implements GPU texture scaling methods. |
| 25 // Note that you should probably not use this class directly. | 25 // Note that you should probably not use this class directly. |
| 26 // See gl_helper.cc::CreateScaler instead. | 26 // See gl_helper.cc::CreateScaler instead. |
| 27 class DISPLAY_COMPOSITOR_EXPORT GLHelperScaling { | 27 class VIZ_EXPORT GLHelperScaling { |
| 28 public: | 28 public: |
| 29 enum ShaderType { | 29 enum ShaderType { |
| 30 SHADER_BILINEAR, | 30 SHADER_BILINEAR, |
| 31 SHADER_BILINEAR2, | 31 SHADER_BILINEAR2, |
| 32 SHADER_BILINEAR3, | 32 SHADER_BILINEAR3, |
| 33 SHADER_BILINEAR4, | 33 SHADER_BILINEAR4, |
| 34 SHADER_BILINEAR2X2, | 34 SHADER_BILINEAR2X2, |
| 35 SHADER_BICUBIC_UPSCALE, | 35 SHADER_BICUBIC_UPSCALE, |
| 36 SHADER_BICUBIC_HALF_1D, | 36 SHADER_BICUBIC_HALF_1D, |
| 37 SHADER_PLANAR, | 37 SHADER_PLANAR, |
| 38 SHADER_YUV_MRT_PASS1, | 38 SHADER_YUV_MRT_PASS1, |
| 39 SHADER_YUV_MRT_PASS2, | 39 SHADER_YUV_MRT_PASS2, |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Similar to ScalerInterface, but can generate multiple outputs. | 42 // Similar to ScalerInterface, but can generate multiple outputs. |
| 43 // Used for YUV conversion in gl_helper.c | 43 // Used for YUV conversion in gl_helper.c |
| 44 class DISPLAY_COMPOSITOR_EXPORT ShaderInterface { | 44 class VIZ_EXPORT ShaderInterface { |
| 45 public: | 45 public: |
| 46 ShaderInterface() {} | 46 ShaderInterface() {} |
| 47 virtual ~ShaderInterface() {} | 47 virtual ~ShaderInterface() {} |
| 48 // 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 |
| 49 // 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. |
| 50 virtual void Execute(GLuint source_texture, | 50 virtual void Execute(GLuint source_texture, |
| 51 const std::vector<GLuint>& dest_textures) = 0; | 51 const std::vector<GLuint>& dest_textures) = 0; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; | 54 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 std::map<ShaderProgramKeyType, scoped_refptr<ShaderProgram>> shader_programs_; | 197 std::map<ShaderProgramKeyType, scoped_refptr<ShaderProgram>> shader_programs_; |
| 198 | 198 |
| 199 friend class ShaderProgram; | 199 friend class ShaderProgram; |
| 200 friend class ScalerImpl; | 200 friend class ScalerImpl; |
| 201 friend class GLHelperBenchmark; | 201 friend class GLHelperBenchmark; |
| 202 friend class GLHelperTest; | 202 friend class GLHelperTest; |
| 203 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); | 203 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 } // namespace display_compositor | 206 } // namespace viz |
| 207 | 207 |
| 208 #endif // COMPONENTS_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ | 208 #endif // COMPONENTS_VIZ_DISPLAY_COMPOSITOR_GL_HELPER_SCALING_H_ |
| OLD | NEW |