OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; | 129 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; |
130 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, p)); | 130 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, p)); |
131 if (!fp) { | 131 if (!fp) { |
132 continue; | 132 continue; |
133 } | 133 } |
134 | 134 |
135 GrDrawState ds; | 135 GrDrawState ds; |
136 SkAutoTUnref<const GrGeometryProcessor> gp( | 136 SkAutoTUnref<const GrGeometryProcessor> gp( |
137 GrDefaultGeoProcFactory::Create(0xff000000)); | 137 GrDefaultGeoProcFactory::Create(0xff000000)); |
138 ds.addCoverageProcessor(fp); | 138 ds.addCoverageProcessor(fp); |
139 ds.setIdentityViewMatrix(); | |
140 ds.setRenderTarget(rt); | 139 ds.setRenderTarget(rt); |
141 | 140 |
142 GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, gp->getVer
texStride(), 0); | 141 GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, gp->getVer
texStride(), 0); |
143 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); | 142 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); |
144 SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices()); | 143 SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices()); |
145 | 144 |
146 SkRect bounds = p.getBounds(); | 145 SkRect bounds = p.getBounds(); |
147 // Make sure any artifacts around the exterior of path are visib
le by using overly | 146 // Make sure any artifacts around the exterior of path are visib
le by using overly |
148 // conservative bounding geometry. | 147 // conservative bounding geometry. |
149 bounds.outset(5.f, 5.f); | 148 bounds.outset(5.f, 5.f); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; | 185 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; |
187 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, rect)); | 186 SkAutoTUnref<GrFragmentProcessor> fp(GrConvexPolyEffect::Create(
edgeType, rect)); |
188 if (!fp) { | 187 if (!fp) { |
189 continue; | 188 continue; |
190 } | 189 } |
191 | 190 |
192 GrDrawState ds; | 191 GrDrawState ds; |
193 SkAutoTUnref<const GrGeometryProcessor> gp( | 192 SkAutoTUnref<const GrGeometryProcessor> gp( |
194 GrDefaultGeoProcFactory::Create(0xff000000)); | 193 GrDefaultGeoProcFactory::Create(0xff000000)); |
195 ds.addCoverageProcessor(fp); | 194 ds.addCoverageProcessor(fp); |
196 ds.setIdentityViewMatrix(); | |
197 ds.setRenderTarget(rt); | 195 ds.setRenderTarget(rt); |
198 | 196 |
199 GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, gp->getVer
texStride(), 0); | 197 GrDrawTarget::AutoReleaseGeometry geo(tt.target(), 4, gp->getVer
texStride(), 0); |
200 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); | 198 SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); |
201 SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices()); | 199 SkPoint* verts = reinterpret_cast<SkPoint*>(geo.vertices()); |
202 | 200 |
203 SkRect bounds = rect; | 201 SkRect bounds = rect; |
204 bounds.outset(5.f, 5.f); | 202 bounds.outset(5.f, 5.f); |
205 bounds.toQuad(verts); | 203 bounds.toQuad(verts); |
206 | 204 |
(...skipping 21 matching lines...) Expand all Loading... |
228 SkTLList<SkPath> fPaths; | 226 SkTLList<SkPath> fPaths; |
229 SkTLList<SkRect> fRects; | 227 SkTLList<SkRect> fRects; |
230 | 228 |
231 typedef GM INHERITED; | 229 typedef GM INHERITED; |
232 }; | 230 }; |
233 | 231 |
234 DEF_GM( return SkNEW(ConvexPolyEffect); ) | 232 DEF_GM( return SkNEW(ConvexPolyEffect); ) |
235 } | 233 } |
236 | 234 |
237 #endif | 235 #endif |
OLD | NEW |