| 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_PROGRAM_BINDING_H_ | 5 #ifndef CC_PROGRAM_BINDING_H_ |
| 6 #define CC_PROGRAM_BINDING_H_ | 6 #define CC_PROGRAM_BINDING_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 unsigned m_vertexShaderId; | 38 unsigned m_vertexShaderId; |
| 39 unsigned m_fragmentShaderId; | 39 unsigned m_fragmentShaderId; |
| 40 bool m_initialized; | 40 bool m_initialized; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 template<class VertexShader, class FragmentShader> | 43 template<class VertexShader, class FragmentShader> |
| 44 class ProgramBinding : public ProgramBindingBase { | 44 class ProgramBinding : public ProgramBindingBase { |
| 45 public: | 45 public: |
| 46 explicit ProgramBinding(WebKit::WebGraphicsContext3D* context) | 46 explicit ProgramBinding(WebKit::WebGraphicsContext3D* context) |
| 47 { | 47 { |
| 48 ProgramBindingBase::init(context, m_vertexShader.getShaderString(), m_fr
agmentShader.getShaderString()); | 48 ProgramBindingBase::init(context, |
| 49 m_vertexShader.getShaderString(context), |
| 50 m_fragmentShader.getShaderString(context)); |
| 49 } | 51 } |
| 50 | 52 |
| 51 void initialize(WebKit::WebGraphicsContext3D* context, bool usingBindUniform
) | 53 void initialize(WebKit::WebGraphicsContext3D* context, bool usingBindUniform
) |
| 52 { | 54 { |
| 53 DCHECK(context); | 55 DCHECK(context); |
| 54 DCHECK(!m_initialized); | 56 DCHECK(!m_initialized); |
| 55 | 57 |
| 56 if (IsContextLost(context)) | 58 if (IsContextLost(context)) |
| 57 return; | 59 return; |
| 58 | 60 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 76 | 78 |
| 77 private: | 79 private: |
| 78 | 80 |
| 79 VertexShader m_vertexShader; | 81 VertexShader m_vertexShader; |
| 80 FragmentShader m_fragmentShader; | 82 FragmentShader m_fragmentShader; |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 } // namespace cc | 85 } // namespace cc |
| 84 | 86 |
| 85 #endif // CC_PROGRAM_BINDING_H_ | 87 #endif // CC_PROGRAM_BINDING_H_ |
| OLD | NEW |