| 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_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "content/common/gpu/client/gl_helper.h" | 10 #include "content/common/gpu/client/gl_helper.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Similar to ScalerInterface, but can generate multiple outputs. | 36 // Similar to ScalerInterface, but can generate multiple outputs. |
| 37 // Used for YUV conversion in gl_helper.c | 37 // Used for YUV conversion in gl_helper.c |
| 38 class CONTENT_EXPORT ShaderInterface { | 38 class CONTENT_EXPORT ShaderInterface { |
| 39 public: | 39 public: |
| 40 ShaderInterface() {} | 40 ShaderInterface() {} |
| 41 virtual ~ShaderInterface() {} | 41 virtual ~ShaderInterface() {} |
| 42 // Note that the src_texture will have the min/mag filter set to GL_LINEAR | 42 // Note that the src_texture will have the min/mag filter set to GL_LINEAR |
| 43 // and wrap_s/t set to CLAMP_TO_EDGE in this call. | 43 // and wrap_s/t set to CLAMP_TO_EDGE in this call. |
| 44 virtual void Execute(WebKit::WebGLId source_texture, | 44 virtual void Execute(blink::WebGLId source_texture, |
| 45 const std::vector<WebKit::WebGLId>& dest_textures) = 0; | 45 const std::vector<blink::WebGLId>& dest_textures) = 0; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; | 48 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; |
| 49 | 49 |
| 50 GLHelperScaling(WebKit::WebGraphicsContext3D* context, | 50 GLHelperScaling(blink::WebGraphicsContext3D* context, |
| 51 GLHelper* helper); | 51 GLHelper* helper); |
| 52 ~GLHelperScaling(); | 52 ~GLHelperScaling(); |
| 53 void InitBuffer(); | 53 void InitBuffer(); |
| 54 | 54 |
| 55 GLHelper::ScalerInterface* CreateScaler( | 55 GLHelper::ScalerInterface* CreateScaler( |
| 56 GLHelper::ScalerQuality quality, | 56 GLHelper::ScalerQuality quality, |
| 57 gfx::Size src_size, | 57 gfx::Size src_size, |
| 58 gfx::Rect src_subrect, | 58 gfx::Rect src_subrect, |
| 59 const gfx::Size& dst_size, | 59 const gfx::Size& dst_size, |
| 60 bool vertically_flip_texture, | 60 bool vertically_flip_texture, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 bool swizzle, | 175 bool swizzle, |
| 176 std::deque<GLHelperScaling::ScaleOp>* x_ops, | 176 std::deque<GLHelperScaling::ScaleOp>* x_ops, |
| 177 std::deque<GLHelperScaling::ScaleOp>* y_ops, | 177 std::deque<GLHelperScaling::ScaleOp>* y_ops, |
| 178 std::vector<ScalerStage> *scaler_stages); | 178 std::vector<ScalerStage> *scaler_stages); |
| 179 | 179 |
| 180 | 180 |
| 181 scoped_refptr<ShaderProgram> GetShaderProgram(ShaderType type, bool swizzle); | 181 scoped_refptr<ShaderProgram> GetShaderProgram(ShaderType type, bool swizzle); |
| 182 | 182 |
| 183 // Interleaved array of 2-dimentional vertex positions (x, y) and | 183 // Interleaved array of 2-dimentional vertex positions (x, y) and |
| 184 // 2-dimentional texture coordinates (s, t). | 184 // 2-dimentional texture coordinates (s, t). |
| 185 static const WebKit::WGC3Dfloat kVertexAttributes[]; | 185 static const blink::WGC3Dfloat kVertexAttributes[]; |
| 186 | 186 |
| 187 WebKit::WebGraphicsContext3D* context_; | 187 blink::WebGraphicsContext3D* context_; |
| 188 GLHelper* helper_; | 188 GLHelper* helper_; |
| 189 | 189 |
| 190 // The buffer that holds the vertices and the texture coordinates data for | 190 // The buffer that holds the vertices and the texture coordinates data for |
| 191 // drawing a quad. | 191 // drawing a quad. |
| 192 ScopedBuffer vertex_attributes_buffer_; | 192 ScopedBuffer vertex_attributes_buffer_; |
| 193 | 193 |
| 194 std::map<ShaderProgramKeyType, | 194 std::map<ShaderProgramKeyType, |
| 195 scoped_refptr<ShaderProgram> > shader_programs_; | 195 scoped_refptr<ShaderProgram> > shader_programs_; |
| 196 | 196 |
| 197 friend class ShaderProgram; | 197 friend class ShaderProgram; |
| 198 friend class ScalerImpl; | 198 friend class ScalerImpl; |
| 199 friend class GLHelperTest; | 199 friend class GLHelperTest; |
| 200 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); | 200 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 | 203 |
| 204 } // namespace content | 204 } // namespace content |
| 205 | 205 |
| 206 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ | 206 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ |
| OLD | NEW |