| 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 size_t count, const SkPoint pts[], const SkPaint& p
aint) { | 390 size_t count, const SkPoint pts[], const SkPaint& p
aint) { |
| 391 CHECK_FOR_ANNOTATION(paint); | 391 CHECK_FOR_ANNOTATION(paint); |
| 392 CHECK_SHOULD_DRAW(draw, false); | 392 CHECK_SHOULD_DRAW(draw, false); |
| 393 | 393 |
| 394 SkScalar width = paint.getStrokeWidth(); | 394 SkScalar width = paint.getStrokeWidth(); |
| 395 if (width < 0) { | 395 if (width < 0) { |
| 396 return; | 396 return; |
| 397 } | 397 } |
| 398 | 398 |
| 399 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { | 399 if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mod
e) { |
| 400 if (GrDashingEffect::DrawDashLine(pts, paint, this->context())) { | 400 GrStrokeInfo strokeInfo(paint); |
| 401 return; | 401 GrPaint grPaint; |
| 402 } | 402 SkPaint2GrPaintShader(this->context(), paint, true, &grPaint); |
| 403 SkPath path; |
| 404 path.moveTo(pts[0]); |
| 405 path.lineTo(pts[1]); |
| 406 fContext->drawPath(grPaint, path, strokeInfo); |
| 407 return; |
| 403 } | 408 } |
| 404 | 409 |
| 405 // we only handle hairlines and paints without path effects or mask filters, | 410 // we only handle hairlines and paints without path effects or mask filters, |
| 406 // else we let the SkDraw call our drawPath() | 411 // else we let the SkDraw call our drawPath() |
| 407 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) { | 412 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) { |
| 408 draw.drawPoints(mode, count, pts, paint, true); | 413 draw.drawPoints(mode, count, pts, paint, true); |
| 409 return; | 414 return; |
| 410 } | 415 } |
| 411 | 416 |
| 412 GrPaint grPaint; | 417 GrPaint grPaint; |
| (...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2003 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); | 2008 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict
ure, i); |
| 2004 | 2009 |
| 2005 if (NULL != layer->getTexture()) { | 2010 if (NULL != layer->getTexture()) { |
| 2006 fContext->unlockScratchTexture(layer->getTexture()); | 2011 fContext->unlockScratchTexture(layer->getTexture()); |
| 2007 layer->setTexture(NULL); | 2012 layer->setTexture(NULL); |
| 2008 } | 2013 } |
| 2009 } | 2014 } |
| 2010 | 2015 |
| 2011 return true; | 2016 return true; |
| 2012 } | 2017 } |
| OLD | NEW |