OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
9 #include "GrGLUtil.h" | 9 #include "GrGLUtil.h" |
10 #include "SkMatrix.h" | 10 #include "SkMatrix.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 dest[9] = 0; | 257 dest[9] = 0; |
258 dest[10] = 1; | 258 dest[10] = 1; |
259 dest[11] = 0; | 259 dest[11] = 0; |
260 | 260 |
261 // Col 3 | 261 // Col 3 |
262 dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]); | 262 dest[12] = SkScalarToFloat(src[SkMatrix::kMTransX]); |
263 dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]); | 263 dest[13] = SkScalarToFloat(src[SkMatrix::kMTransY]); |
264 dest[14] = 0; | 264 dest[14] = 0; |
265 dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]); | 265 dest[15] = SkScalarToFloat(src[SkMatrix::kMPersp2]); |
266 } | 266 } |
| 267 |
| 268 GrGLenum GrToGLStencilFunc(GrStencilFunc basicFunc) { |
| 269 static const GrGLenum gTable[] = { |
| 270 GR_GL_ALWAYS, // kAlways_StencilFunc |
| 271 GR_GL_NEVER, // kNever_StencilFunc |
| 272 GR_GL_GREATER, // kGreater_StencilFunc |
| 273 GR_GL_GEQUAL, // kGEqual_StencilFunc |
| 274 GR_GL_LESS, // kLess_StencilFunc |
| 275 GR_GL_LEQUAL, // kLEqual_StencilFunc, |
| 276 GR_GL_EQUAL, // kEqual_StencilFunc, |
| 277 GR_GL_NOTEQUAL, // kNotEqual_StencilFunc, |
| 278 }; |
| 279 GR_STATIC_ASSERT(SK_ARRAY_COUNT(gTable) == kBasicStencilFuncCount); |
| 280 GR_STATIC_ASSERT(0 == kAlways_StencilFunc); |
| 281 GR_STATIC_ASSERT(1 == kNever_StencilFunc); |
| 282 GR_STATIC_ASSERT(2 == kGreater_StencilFunc); |
| 283 GR_STATIC_ASSERT(3 == kGEqual_StencilFunc); |
| 284 GR_STATIC_ASSERT(4 == kLess_StencilFunc); |
| 285 GR_STATIC_ASSERT(5 == kLEqual_StencilFunc); |
| 286 GR_STATIC_ASSERT(6 == kEqual_StencilFunc); |
| 287 GR_STATIC_ASSERT(7 == kNotEqual_StencilFunc); |
| 288 SkASSERT((unsigned) basicFunc < kBasicStencilFuncCount); |
| 289 |
| 290 return gTable[basicFunc]; |
| 291 } |
OLD | NEW |