OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "GrTessellatingPathRenderer.h" | 8 #include "GrTessellatingPathRenderer.h" |
9 | 9 |
10 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), | 264 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont
ext->height(), |
265 &clipBoundsI); | 265 &clipBoundsI); |
266 SkRect clipBounds = SkRect::Make(clipBoundsI); | 266 SkRect clipBounds = SkRect::Make(clipBoundsI); |
267 SkMatrix vmi; | 267 SkMatrix vmi; |
268 if (!args.fViewMatrix->invert(&vmi)) { | 268 if (!args.fViewMatrix->invert(&vmi)) { |
269 return false; | 269 return false; |
270 } | 270 } |
271 vmi.mapRect(&clipBounds); | 271 vmi.mapRect(&clipBounds); |
272 SkPath path; | 272 SkPath path; |
273 args.fShape->asPath(&path); | 273 args.fShape->asPath(&path); |
274 SkAutoTUnref<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fColor, *
args.fShape, | 274 SkAutoTUnref<GrDrawBatch> batch(TessellatingPathBatch::Create(args.fPaint->g
etColor(), |
| 275 *args.fShape, |
275 *args.fViewMat
rix, clipBounds)); | 276 *args.fViewMat
rix, clipBounds)); |
276 | 277 |
277 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHW
AA(*args.fPaint)); | 278 GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->mustUseHW
AA(*args.fPaint)); |
278 pipelineBuilder.setUserStencil(args.fUserStencilSettings); | 279 pipelineBuilder.setUserStencil(args.fUserStencilSettings); |
279 | 280 |
280 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); | 281 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); |
281 | 282 |
282 return true; | 283 return true; |
283 } | 284 } |
284 | 285 |
(...skipping 14 matching lines...) Expand all Loading... |
299 vmi.mapRect(&clipBounds); | 300 vmi.mapRect(&clipBounds); |
300 GrStyle style; | 301 GrStyle style; |
301 do { | 302 do { |
302 GrTest::TestStyle(random, &style); | 303 GrTest::TestStyle(random, &style); |
303 } while (style.strokeRec().isHairlineStyle()); | 304 } while (style.strokeRec().isHairlineStyle()); |
304 GrShape shape(path, style); | 305 GrShape shape(path, style); |
305 return TessellatingPathBatch::Create(color, shape, viewMatrix, clipBounds); | 306 return TessellatingPathBatch::Create(color, shape, viewMatrix, clipBounds); |
306 } | 307 } |
307 | 308 |
308 #endif | 309 #endif |
OLD | NEW |