| 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" |
| 11 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
| 12 #include "cc/output/shader.h" | 12 #include "cc/output/shader.h" |
| 13 | 13 |
| 14 namespace WebKit { class WebGraphicsContext3D; } | 14 namespace blink { class WebGraphicsContext3D; } |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 | 17 |
| 18 class ProgramBindingBase { | 18 class ProgramBindingBase { |
| 19 public: | 19 public: |
| 20 ProgramBindingBase(); | 20 ProgramBindingBase(); |
| 21 ~ProgramBindingBase(); | 21 ~ProgramBindingBase(); |
| 22 | 22 |
| 23 bool Init(WebKit::WebGraphicsContext3D* context, | 23 bool Init(blink::WebGraphicsContext3D* context, |
| 24 const std::string& vertex_shader, | 24 const std::string& vertex_shader, |
| 25 const std::string& fragment_shader); | 25 const std::string& fragment_shader); |
| 26 bool Link(WebKit::WebGraphicsContext3D* context); | 26 bool Link(blink::WebGraphicsContext3D* context); |
| 27 void Cleanup(WebKit::WebGraphicsContext3D* context); | 27 void Cleanup(blink::WebGraphicsContext3D* context); |
| 28 | 28 |
| 29 unsigned program() const { return program_; } | 29 unsigned program() const { return program_; } |
| 30 bool initialized() const { return initialized_; } | 30 bool initialized() const { return initialized_; } |
| 31 | 31 |
| 32 protected: | 32 protected: |
| 33 unsigned LoadShader(WebKit::WebGraphicsContext3D* context, | 33 unsigned LoadShader(blink::WebGraphicsContext3D* context, |
| 34 unsigned type, | 34 unsigned type, |
| 35 const std::string& shader_source); | 35 const std::string& shader_source); |
| 36 unsigned CreateShaderProgram(WebKit::WebGraphicsContext3D* context, | 36 unsigned CreateShaderProgram(blink::WebGraphicsContext3D* context, |
| 37 unsigned vertex_shader, | 37 unsigned vertex_shader, |
| 38 unsigned fragment_shader); | 38 unsigned fragment_shader); |
| 39 void CleanupShaders(WebKit::WebGraphicsContext3D* context); | 39 void CleanupShaders(blink::WebGraphicsContext3D* context); |
| 40 | 40 |
| 41 unsigned program_; | 41 unsigned program_; |
| 42 unsigned vertex_shader_id_; | 42 unsigned vertex_shader_id_; |
| 43 unsigned fragment_shader_id_; | 43 unsigned fragment_shader_id_; |
| 44 bool initialized_; | 44 bool initialized_; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(ProgramBindingBase); | 47 DISALLOW_COPY_AND_ASSIGN(ProgramBindingBase); |
| 48 }; | 48 }; |
| 49 | 49 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 private: | 89 private: |
| 90 VertexShader vertex_shader_; | 90 VertexShader vertex_shader_; |
| 91 FragmentShader fragment_shader_; | 91 FragmentShader fragment_shader_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(ProgramBinding); | 93 DISALLOW_COPY_AND_ASSIGN(ProgramBinding); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace cc | 96 } // namespace cc |
| 97 | 97 |
| 98 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ | 98 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ |
| OLD | NEW |