Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: gm/beziereffects.cpp

Issue 149683004: Add convex polygon rendering effect and GM to test it. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: more cleanup Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | gm/convexpolyeffect.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | gm/convexpolyeffect.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698