| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/containers/hash_tables.h" |
| 8 #include "base/macros.h" | 11 #include "base/macros.h" |
| 9 #include "gpu/command_buffer/service/gl_utils.h" | 12 #include "gpu/command_buffer/service/gl_utils.h" |
| 10 #include "gpu/gpu_export.h" | 13 #include "gpu/gpu_export.h" |
| 11 | 14 |
| 12 namespace gfx { | 15 namespace gfx { |
| 13 class Size; | 16 class Size; |
| 14 } | 17 } |
| 15 | 18 |
| 16 namespace gpu { | 19 namespace gpu { |
| 17 namespace gles2 { | 20 namespace gles2 { |
| 18 class GLES2Decoder; | 21 class GLES2Decoder; |
| 19 | 22 |
| 20 class GPU_EXPORT ClearFramebufferResourceManager { | 23 class GPU_EXPORT ClearFramebufferResourceManager { |
| 21 public: | 24 public: |
| 22 ClearFramebufferResourceManager(const gles2::GLES2Decoder* decoder); | 25 ClearFramebufferResourceManager(const gles2::GLES2Decoder* decoder, |
| 26 const gl::GLVersionInfo& gl_version_info); |
| 23 ~ClearFramebufferResourceManager(); | 27 ~ClearFramebufferResourceManager(); |
| 24 | 28 |
| 25 | 29 |
| 26 void ClearFramebuffer(const gles2::GLES2Decoder* decoder, | 30 void ClearFramebuffer(const gles2::GLES2Decoder* decoder, |
| 27 const gfx::Size& framebuffer_size, | 31 const gfx::Size& framebuffer_size, |
| 28 GLbitfield mask, | 32 GLbitfield mask, |
| 29 GLfloat clear_color_red, | 33 GLfloat clear_color_red, |
| 30 GLfloat clear_color_green, | 34 GLfloat clear_color_green, |
| 31 GLfloat clear_color_blue, | 35 GLfloat clear_color_blue, |
| 32 GLfloat clear_color_alpha, | 36 GLfloat clear_color_alpha, |
| 33 GLfloat clear_depth_value, | 37 GLfloat clear_depth_value, |
| 34 GLint clear_stencil_value); | 38 GLint clear_stencil_value); |
| 35 | 39 |
| 36 private: | 40 private: |
| 37 void Initialize(const gles2::GLES2Decoder* decoder); | 41 void Initialize(const gles2::GLES2Decoder* decoder); |
| 42 void InitShader(const gles2::GLES2Decoder* decoder, GLenum type); |
| 38 void Destroy(); | 43 void Destroy(); |
| 39 | 44 |
| 40 // The attributes used during invocation of the extension. | 45 // The attributes used during invocation of the extension. |
| 41 static const GLuint kVertexPositionAttrib = 0; | 46 static const GLuint kVertexPositionAttrib = 0; |
| 42 | 47 |
| 43 bool initialized_; | 48 bool initialized_; |
| 49 bool is_desktop_core_profile_; |
| 44 GLuint program_; | 50 GLuint program_; |
| 45 GLuint depth_handle_; | 51 GLuint vao_; |
| 46 GLuint color_handle_; | 52 GLint depth_handle_; |
| 53 GLint color_handle_; |
| 47 GLuint buffer_id_; | 54 GLuint buffer_id_; |
| 55 base::hash_map<std::string, std::string> name_map_; |
| 56 std::string vertex_shader_source_; |
| 57 std::string fragment_shader_source_; |
| 48 | 58 |
| 49 DISALLOW_COPY_AND_ASSIGN(ClearFramebufferResourceManager); | 59 DISALLOW_COPY_AND_ASSIGN(ClearFramebufferResourceManager); |
| 50 }; | 60 }; |
| 51 | 61 |
| 52 } // namespace gles2 | 62 } // namespace gles2 |
| 53 } // namespace gpu | 63 } // namespace gpu |
| 54 | 64 |
| 55 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ | 65 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ |
| OLD | NEW |