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 = BLEND_MODE_NONE) { | 62 BlendMode blend_mode = BLEND_MODE_NONE, |
63 bool mask_for_background = false) { | |
enne (OOO)
2015/03/04 19:58:44
style nit: no default parameters in Chromium.
| |
63 DCHECK(context_provider); | 64 DCHECK(context_provider); |
64 DCHECK(!initialized_); | 65 DCHECK(!initialized_); |
65 | 66 |
66 if (context_provider->IsContextLost()) | 67 if (context_provider->IsContextLost()) |
67 return; | 68 return; |
68 | 69 |
69 fragment_shader_.set_blend_mode(blend_mode); | 70 fragment_shader_.set_blend_mode(blend_mode); |
71 fragment_shader_.set_mask_for_background(mask_for_background); | |
70 | 72 |
71 if (!ProgramBindingBase::Init( | 73 if (!ProgramBindingBase::Init( |
72 context_provider->ContextGL(), | 74 context_provider->ContextGL(), |
73 vertex_shader_.GetShaderString(), | 75 vertex_shader_.GetShaderString(), |
74 fragment_shader_.GetShaderString(precision, sampler))) { | 76 fragment_shader_.GetShaderString(precision, sampler))) { |
75 DCHECK(context_provider->IsContextLost()); | 77 DCHECK(context_provider->IsContextLost()); |
76 return; | 78 return; |
77 } | 79 } |
78 | 80 |
79 int base_uniform_index = 0; | 81 int base_uniform_index = 0; |
(...skipping 17 matching lines...) Expand all Loading... | |
97 private: | 99 private: |
98 VertexShader vertex_shader_; | 100 VertexShader vertex_shader_; |
99 FragmentShader fragment_shader_; | 101 FragmentShader fragment_shader_; |
100 | 102 |
101 DISALLOW_COPY_AND_ASSIGN(ProgramBinding); | 103 DISALLOW_COPY_AND_ASSIGN(ProgramBinding); |
102 }; | 104 }; |
103 | 105 |
104 } // namespace cc | 106 } // namespace cc |
105 | 107 |
106 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ | 108 #endif // CC_OUTPUT_PROGRAM_BINDING_H_ |
OLD | NEW |