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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 326103002: Use vertex attributes for dash effect in gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@dashPlumb2
Patch Set: Remove commented lines Created 6 years, 6 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
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 SkPaint p(paint);
390 return; 390 p.setStyle(SkPaint::kStroke_Style);
391 } 391 GrStrokeInfo strokeInfo(p);
bsalomon 2014/06/11 21:43:37 Do we need to construct this from a paint if we kn
egdaniel 2014/06/12 12:13:11 Added an optional parameter to ctor of strokeInfo
392 GrPaint grPaint;
393 SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
394 SkPath path;
395 path.moveTo(pts[0]);
396 path.lineTo(pts[1]);
397 fContext->drawPath(grPaint, path, strokeInfo);
398 return;
392 } 399 }
393 400
394 // we only handle hairlines and paints without path effects or mask filters, 401 // we only handle hairlines and paints without path effects or mask filters,
395 // else we let the SkDraw call our drawPath() 402 // else we let the SkDraw call our drawPath()
396 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) { 403 if (width > 0 || paint.getPathEffect() || paint.getMaskFilter()) {
397 draw.drawPoints(mode, count, pts, paint, true); 404 draw.drawPoints(mode, count, pts, paint, true);
398 return; 405 return;
399 } 406 }
400 407
401 GrPaint grPaint; 408 GrPaint grPaint;
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict ure, i); 2004 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(pict ure, i);
1998 2005
1999 if (NULL != layer->getTexture()) { 2006 if (NULL != layer->getTexture()) {
2000 fContext->unlockScratchTexture(layer->getTexture()); 2007 fContext->unlockScratchTexture(layer->getTexture());
2001 layer->setTexture(NULL); 2008 layer->setTexture(NULL);
2002 } 2009 }
2003 } 2010 }
2004 2011
2005 return true; 2012 return true;
2006 } 2013 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698