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 <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual ~ShaderInterface() {} | 45 virtual ~ShaderInterface() {} |
46 // Note that the src_texture will have the min/mag filter set to GL_LINEAR | 46 // Note that the src_texture will have the min/mag filter set to GL_LINEAR |
47 // and wrap_s/t set to CLAMP_TO_EDGE in this call. | 47 // and wrap_s/t set to CLAMP_TO_EDGE in this call. |
48 virtual void Execute(GLuint source_texture, | 48 virtual void Execute(GLuint source_texture, |
49 const std::vector<GLuint>& dest_textures) = 0; | 49 const std::vector<GLuint>& dest_textures) = 0; |
50 }; | 50 }; |
51 | 51 |
52 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; | 52 typedef std::pair<ShaderType, bool> ShaderProgramKeyType; |
53 | 53 |
54 GLHelperScaling(gpu::gles2::GLES2Interface* gl, | 54 GLHelperScaling(gpu::gles2::GLES2Interface* gl, |
| 55 gpu::ContextSupport* context_support, |
55 GLHelper* helper); | 56 GLHelper* helper); |
56 ~GLHelperScaling(); | 57 ~GLHelperScaling(); |
57 void InitBuffer(); | 58 void InitBuffer(); |
58 | 59 |
59 GLHelper::ScalerInterface* CreateScaler( | 60 GLHelper::ScalerInterface* CreateScaler( |
60 GLHelper::ScalerQuality quality, | 61 GLHelper::ScalerQuality quality, |
61 gfx::Size src_size, | 62 gfx::Size src_size, |
62 gfx::Rect src_subrect, | 63 gfx::Rect src_subrect, |
63 const gfx::Size& dst_size, | 64 const gfx::Size& dst_size, |
64 bool vertically_flip_texture, | 65 bool vertically_flip_texture, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 std::vector<ScalerStage> *scaler_stages); | 185 std::vector<ScalerStage> *scaler_stages); |
185 | 186 |
186 | 187 |
187 scoped_refptr<ShaderProgram> GetShaderProgram(ShaderType type, bool swizzle); | 188 scoped_refptr<ShaderProgram> GetShaderProgram(ShaderType type, bool swizzle); |
188 | 189 |
189 // Interleaved array of 2-dimentional vertex positions (x, y) and | 190 // Interleaved array of 2-dimentional vertex positions (x, y) and |
190 // 2-dimentional texture coordinates (s, t). | 191 // 2-dimentional texture coordinates (s, t). |
191 static const GLfloat kVertexAttributes[]; | 192 static const GLfloat kVertexAttributes[]; |
192 | 193 |
193 gpu::gles2::GLES2Interface* gl_; | 194 gpu::gles2::GLES2Interface* gl_; |
| 195 gpu::ContextSupport* context_support_; |
194 GLHelper* helper_; | 196 GLHelper* helper_; |
195 | 197 |
196 // The buffer that holds the vertices and the texture coordinates data for | 198 // The buffer that holds the vertices and the texture coordinates data for |
197 // drawing a quad. | 199 // drawing a quad. |
198 ScopedBuffer vertex_attributes_buffer_; | 200 ScopedBuffer vertex_attributes_buffer_; |
199 | 201 |
200 std::map<ShaderProgramKeyType, | 202 std::map<ShaderProgramKeyType, |
201 scoped_refptr<ShaderProgram> > shader_programs_; | 203 scoped_refptr<ShaderProgram> > shader_programs_; |
202 | 204 |
203 friend class ShaderProgram; | 205 friend class ShaderProgram; |
204 friend class ScalerImpl; | 206 friend class ScalerImpl; |
205 friend class GLHelperTest; | 207 friend class GLHelperTest; |
206 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); | 208 DISALLOW_COPY_AND_ASSIGN(GLHelperScaling); |
207 }; | 209 }; |
208 | 210 |
209 | 211 |
210 } // namespace content | 212 } // namespace content |
211 | 213 |
212 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ | 214 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ |
OLD | NEW |