| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "gpu/command_buffer/service/feature_info.h" |
| 9 #include "gpu/command_buffer/service/gl_utils.h" | 10 #include "gpu/command_buffer/service/gl_utils.h" |
| 10 #include "gpu/gpu_export.h" | 11 #include "gpu/gpu_export.h" |
| 11 | 12 |
| 12 namespace gfx { | 13 namespace gfx { |
| 13 class Size; | 14 class Size; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace gpu { | 17 namespace gpu { |
| 17 namespace gles2 { | 18 namespace gles2 { |
| 18 class GLES2Decoder; | 19 class GLES2Decoder; |
| 19 } | 20 } |
| 20 | 21 |
| 21 class GPU_EXPORT ClearFramebufferResourceManager { | 22 class GPU_EXPORT ClearFramebufferResourceManager { |
| 22 public: | 23 public: |
| 23 ClearFramebufferResourceManager(const gles2::GLES2Decoder* decoder); | 24 ClearFramebufferResourceManager( |
| 25 const gles2::GLES2Decoder* decoder, |
| 26 const gles2::FeatureInfo::FeatureFlags& feature_flags); |
| 24 ~ClearFramebufferResourceManager(); | 27 ~ClearFramebufferResourceManager(); |
| 25 | 28 |
| 26 | 29 |
| 27 void ClearFramebuffer(const gles2::GLES2Decoder* decoder, | 30 void ClearFramebuffer(const gles2::GLES2Decoder* decoder, |
| 28 const gfx::Size& framebuffer_size, | 31 const gfx::Size& framebuffer_size, |
| 29 GLbitfield mask, | 32 GLbitfield mask, |
| 30 GLfloat clear_color_red, | 33 GLfloat clear_color_red, |
| 31 GLfloat clear_color_green, | 34 GLfloat clear_color_green, |
| 32 GLfloat clear_color_blue, | 35 GLfloat clear_color_blue, |
| 33 GLfloat clear_color_alpha, | 36 GLfloat clear_color_alpha, |
| 34 GLfloat clear_depth_value, | 37 GLfloat clear_depth_value, |
| 35 GLint clear_stencil_value); | 38 GLint clear_stencil_value); |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 void Initialize(const gles2::GLES2Decoder* decoder); | 41 void Initialize(const gles2::GLES2Decoder* decoder, |
| 42 const gles2::FeatureInfo::FeatureFlags& feature_flags); |
| 39 void Destroy(); | 43 void Destroy(); |
| 40 | 44 |
| 41 // The attributes used during invocation of the extension. | 45 // The attributes used during invocation of the extension. |
| 42 static const GLuint kVertexPositionAttrib = 0; | 46 static const GLuint kVertexPositionAttrib = 0; |
| 43 | 47 |
| 44 bool initialized_; | 48 bool initialized_; |
| 45 GLuint program_; | 49 GLuint program_; |
| 50 GLuint vao_; |
| 46 GLuint depth_handle_; | 51 GLuint depth_handle_; |
| 47 GLuint color_handle_; | 52 GLuint color_handle_; |
| 48 GLuint buffer_id_; | 53 GLuint buffer_id_; |
| 49 | 54 |
| 50 DISALLOW_COPY_AND_ASSIGN(ClearFramebufferResourceManager); | 55 DISALLOW_COPY_AND_ASSIGN(ClearFramebufferResourceManager); |
| 51 }; | 56 }; |
| 52 | 57 |
| 53 } // namespace gpu. | 58 } // namespace gpu. |
| 54 | 59 |
| 55 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ | 60 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_CLEAR_FRAMEBUFFER_H_ |
| OLD | NEW |