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 #include "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 size_t count, const SkPoint pts[], const SkPaint& p
aint) { | 379 size_t count, const SkPoint pts[], const SkPaint& p
aint) { |
380 CHECK_FOR_ANNOTATION(paint); | 380 CHECK_FOR_ANNOTATION(paint); |
381 CHECK_SHOULD_DRAW(draw, false); | 381 CHECK_SHOULD_DRAW(draw, false); |
382 | 382 |
383 SkScalar width = paint.getStrokeWidth(); | 383 SkScalar width = paint.getStrokeWidth(); |
384 if (width < 0) { | 384 if (width < 0) { |
385 return; | 385 return; |
386 } | 386 } |
387 | 387 |
388 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { | 388 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { |
389 if (GrDashingEffect::DrawDashLine(pts, paint, this->context())) { | 389 GrStrokeInfo strokeInfo(paint, SkPaint::kStroke_Style); |
390 return; | 390 GrPaint grPaint; |
391 } | 391 SkPaint2GrPaintShader(this->context(), paint, true, &grPaint); |
| 392 SkPath path; |
| 393 path.moveTo(pts[0]); |
| 394 path.lineTo(pts[1]); |
| 395 fContext->drawPath(grPaint, path, strokeInfo); |
| 396 return; |
392 } | 397 } |
393 | 398 |
394 // we only handle hairlines and paints without path effects or mask filters, | 399 // we only handle hairlines and paints without path effects or mask filters, |
395 // else we let the SkDraw call our drawPath() | 400 // else we let the SkDraw call our drawPath() |
396 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) { | 401 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) { |
397 draw.drawPoints(mode, count, pts, paint, true); | 402 draw.drawPoints(mode, count, pts, paint, true); |
398 return; | 403 return; |
399 } | 404 } |
400 | 405 |
401 GrPaint grPaint; | 406 GrPaint grPaint; |
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); | 2002 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); |
1998 | 2003 |
1999 if (NULL != layer->getTexture()) { | 2004 if (NULL != layer->getTexture()) { |
2000 fContext->unlockScratchTexture(layer->getTexture()); | 2005 fContext->unlockScratchTexture(layer->getTexture()); |
2001 layer->setTexture(NULL); | 2006 layer->setTexture(NULL); |
2002 } | 2007 } |
2003 } | 2008 } |
2004 | 2009 |
2005 return true; | 2010 return true; |
2006 } | 2011 } |
OLD | NEW |