| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CC_OUTPUT_PROGRAM_BINDING_H_ | 5 #ifndef CC_OUTPUT_PROGRAM_BINDING_H_ |
| 6 #define CC_OUTPUT_PROGRAM_BINDING_H_ | 6 #define CC_OUTPUT_PROGRAM_BINDING_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 unsigned CreateShaderProgram(WebKit::WebGraphicsContext3D* context, | 34 unsigned CreateShaderProgram(WebKit::WebGraphicsContext3D* context, |
| 35 unsigned vertex_shader, | 35 unsigned vertex_shader, |
| 36 unsigned fragment_shader); | 36 unsigned fragment_shader); |
| 37 void CleanupShaders(WebKit::WebGraphicsContext3D* context); | 37 void CleanupShaders(WebKit::WebGraphicsContext3D* context); |
| 38 bool IsContextLost(WebKit::WebGraphicsContext3D* context); | 38 bool IsContextLost(WebKit::WebGraphicsContext3D* context); |
| 39 | 39 |
| 40 unsigned program_; | 40 unsigned program_; |
| 41 unsigned vertex_shader_id_; | 41 unsigned vertex_shader_id_; |
| 42 unsigned fragment_shader_id_; | 42 unsigned fragment_shader_id_; |
| 43 bool initialized_; | 43 bool initialized_; |
| 44 |
| 45 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(ProgramBindingBase); |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 template <class VertexShader, class FragmentShader> | 49 template <class VertexShader, class FragmentShader> |
| 47 class ProgramBinding : public ProgramBindingBase { | 50 class ProgramBinding : public ProgramBindingBase { |
| 48 public: | 51 public: |
| 49 explicit ProgramBinding(WebKit::WebGraphicsContext3D* context) { | 52 explicit ProgramBinding(WebKit::WebGraphicsContext3D* context) { |
| 50 ProgramBindingBase::Init(context, | 53 ProgramBindingBase::Init(context, |
| 51 vertex_shader_.GetShaderString(), | 54 vertex_shader_.GetShaderString(), |
| 52 fragment_shader_.GetShaderString()); | 55 fragment_shader_.GetShaderString()); |
| 53 } | 56 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 76 | 79 |
| 77 initialized_ = true; | 80 initialized_ = true; |
| 78 } | 81 } |
| 79 | 82 |
| 80 const VertexShader& vertex_shader() const { return vertex_shader_; } | 83 const VertexShader& vertex_shader() const { return vertex_shader_; } |
| 81 const FragmentShader& fragment_shader() const { return fragment_shader_; } | 84 const FragmentShader& fragment_shader() const { return fragment_shader_; } |
| 82 | 85 |
| 83 private: | 86 private: |
| 84 VertexShader vertex_shader_; | 87 VertexShader vertex_shader_; |
| 85 FragmentShader fragment_shader_; | 88 FragmentShader fragment_shader_; |
| 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(ProgramBinding); |
| 86 }; | 91 }; |
| 87 | 92 |
| 88 } // namespace cc | 93 } // namespace cc |
| 89 | 94 |
| 90 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ | 95 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ |
| OLD | NEW |