| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrGLSL_impl_DEFINED | 8 #ifndef GrGLSL_impl_DEFINED |
| 9 #define GrGLSL_impl_DEFINED | 9 #define GrGLSL_impl_DEFINED |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 template<> | 32 template<> |
| 33 inline const char* GrGLSLExpr<1>::zerosStr() { | 33 inline const char* GrGLSLExpr<1>::zerosStr() { |
| 34 return "0"; | 34 return "0"; |
| 35 } | 35 } |
| 36 | 36 |
| 37 template<> | 37 template<> |
| 38 inline const char* GrGLSLExpr<1>::onesStr() { | 38 inline const char* GrGLSLExpr<1>::onesStr() { |
| 39 return "1"; | 39 return "1"; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // GrGLSLExpr<1>::expandComponentStr() is unimplemented because using it | 42 // GrGLSLExpr<1>::expandComponentStr() is unimplemented because using it is |
| 43 // is likely an error. This is now caught compile-time. | 43 // likely an error. This is now caught compile-time. |
| 44 | 44 |
| 45 template<> | 45 template<> |
| 46 inline const char* GrGLSLExpr<1>::castStr() { | 46 inline const char* GrGLSLExpr<1>::castStr() { |
| 47 return "(%s)"; | 47 return "(%s)"; |
| 48 } | 48 } |
| 49 | 49 |
| 50 template<> | 50 template<> |
| 51 template<> | 51 template<> |
| 52 inline GrGLSLExpr<4> GrGLSLExpr<4>::VectorCast(const GrGLSLExpr<4>& other) { | 52 inline GrGLSLExpr<4> GrGLSLExpr<4>::VectorCast(const GrGLSLExpr<4>& other) { |
| 53 return other; | 53 return other; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 template<int N> | 120 template<int N> |
| 121 GrGLSLExpr<N> GrGLSLExpr<N>::expandComponent(GrColorComponentFlags component) co
nst { | 121 GrGLSLExpr<N> GrGLSLExpr<N>::expandComponent(GrColorComponentFlags component) co
nst { |
| 122 if (this->isZeros() || this->isOnes()) { | 122 if (this->isZeros() || this->isOnes()) { |
| 123 return *this; | 123 return *this; |
| 124 } | 124 } |
| 125 return GrGLSLExpr<N>(this->expandComponentStr(), this->c_str(), GrColorCompo
nentFlagToChar(component)); | 125 return GrGLSLExpr<N>(this->expandComponentStr(), this->c_str(), GrColorCompo
nentFlagToChar(component)); |
| 126 } | 126 } |
| 127 | 127 |
| 128 #endif | 128 #endif |
| OLD | NEW |