Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
| 10 | 10 |
| 11 #include "gm.h" | 11 #include "gm.h" |
| 12 | 12 |
| 13 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
| 14 | 14 |
| 15 #include "GrContext.h" | 15 #include "GrContext.h" |
| 16 #include "GrPathUtils.h" | 16 #include "GrPathUtils.h" |
| 17 #include "GrTest.h" | 17 #include "GrTest.h" |
| 18 #include "SkColorPriv.h" | 18 #include "SkColorPriv.h" |
| 19 #include "SkDevice.h" | 19 #include "SkDevice.h" |
| 20 #include "SkGeometry.h" | 20 #include "SkGeometry.h" |
| 21 | 21 |
| 22 #include "effects/GrBezierEffect.h" | 22 #include "effects/GrBezierEffect.h" |
| 23 | 23 |
| 24 // Position & KLM line eq values. These are the vertex attributes for Bezier cur ves. The last value | 24 // Position & KLM line eq values. These are the vertex attributes for Bezier cur ves. The last value |
| 25 // of the Vec4f is ignored. | 25 // of the Vec4f is ignored. |
| 26 extern const GrVertexAttrib kAttribs[] = { | 26 static const GrVertexAttrib kAttribs[] = { |
|
bsalomon
2014/01/29 20:18:30
I think this will break some compilers because it
robertphillips
2014/01/29 20:57:55
Yep - I seem to recall the extern was required.
| |
| 27 {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding}, | 27 {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding}, |
| 28 {kVec4f_GrVertexAttribType, sizeof(GrPoint), kEffect_GrVertexAttribBinding} | 28 {kVec4f_GrVertexAttribType, sizeof(GrPoint), kEffect_GrVertexAttribBinding} |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 static inline SkScalar eval_line(const SkPoint& p, const SkScalar lineEq[3], SkS calar sign) { | 31 static inline SkScalar eval_line(const SkPoint& p, const SkScalar lineEq[3], SkS calar sign) { |
| 32 return sign * (lineEq[0] * p.fX + lineEq[1] * p.fY + lineEq[2]); | 32 return sign * (lineEq[0] * p.fX + lineEq[1] * p.fY + lineEq[2]); |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace skiagm { | 35 namespace skiagm { |
| 36 /** | 36 /** |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 typedef GM INHERITED; | 509 typedef GM INHERITED; |
| 510 }; | 510 }; |
| 511 | 511 |
| 512 DEF_GM( return SkNEW(BezierCubicEffects); ) | 512 DEF_GM( return SkNEW(BezierCubicEffects); ) |
| 513 DEF_GM( return SkNEW(BezierConicEffects); ) | 513 DEF_GM( return SkNEW(BezierConicEffects); ) |
| 514 DEF_GM( return SkNEW(BezierQuadEffects); ) | 514 DEF_GM( return SkNEW(BezierQuadEffects); ) |
| 515 | 515 |
| 516 } | 516 } |
| 517 | 517 |
| 518 #endif | 518 #endif |
| OLD | NEW |