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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 }; | 52 }; |
53 | 53 |
54 template <class VertexShader, class FragmentShader> | 54 template <class VertexShader, class FragmentShader> |
55 class ProgramBinding : public ProgramBindingBase { | 55 class ProgramBinding : public ProgramBindingBase { |
56 public: | 56 public: |
57 ProgramBinding() {} | 57 ProgramBinding() {} |
58 | 58 |
59 void Initialize(ContextProvider* context_provider, | 59 void Initialize(ContextProvider* context_provider, |
60 TexCoordPrecision precision, | 60 TexCoordPrecision precision, |
61 SamplerType sampler, | 61 SamplerType sampler, |
62 BlendMode blend_mode = BlendModeNormal) { | 62 BlendMode blend_mode = BlendModeNone) { |
63 DCHECK(context_provider); | 63 DCHECK(context_provider); |
64 DCHECK(!initialized_); | 64 DCHECK(!initialized_); |
65 | 65 |
66 if (context_provider->IsContextLost()) | 66 if (context_provider->IsContextLost()) |
67 return; | 67 return; |
68 | 68 |
69 fragment_shader_.set_blend_mode(blend_mode); | 69 fragment_shader_.set_blend_mode(blend_mode); |
70 | 70 |
71 if (!ProgramBindingBase::Init( | 71 if (!ProgramBindingBase::Init( |
72 context_provider->ContextGL(), | 72 context_provider->ContextGL(), |
(...skipping 24 matching lines...) Expand all Loading... |
97 private: | 97 private: |
98 VertexShader vertex_shader_; | 98 VertexShader vertex_shader_; |
99 FragmentShader fragment_shader_; | 99 FragmentShader fragment_shader_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(ProgramBinding); | 101 DISALLOW_COPY_AND_ASSIGN(ProgramBinding); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace cc | 104 } // namespace cc |
105 | 105 |
106 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ | 106 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ |
OLD | NEW |