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

Unified Diff: gm/convexpolyeffect.cpp

Issue 1839743002: Fix GrConvexPolyEffect to deal with line paths. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix include to use "" instead of <> Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/convexpolyeffect.cpp
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 57ee30731d856212cd4d220b718f8e307978a7d9..412e47893d15c2c8c871b3deaada51232f5ad993 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -135,6 +135,11 @@ protected:
ngon.transform(scaleM);
fPaths.addToTail(ngon);
+ SkPath linePath;
+ linePath.moveTo(5.f, 5.f);
+ linePath.lineTo(6.f, 6.f);
+ fPaths.addToTail(linePath);
+
// integer edges
fRects.addToTail(SkRect::MakeLTRB(5.f, 1.f, 30.f, 25.f));
// half-integer edges
@@ -175,6 +180,7 @@ protected:
GrDefaultGeoProcFactory::Create(color, coverage, localCoords, SkMatrix::I()));
SkScalar y = 0;
+ static const SkScalar kDX = 12.f;
for (PathList::Iter iter(fPaths, PathList::Iter::kHead_IterStart);
iter.get();
iter.next()) {
@@ -207,7 +213,7 @@ protected:
drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBuilder, batch);
- x += SkScalarCeilToScalar(path->getBounds().width() + 10.f);
+ x += SkScalarCeilToScalar(path->getBounds().width() + kDX);
}
// Draw AA and non AA paths using normal API for reference.
@@ -254,7 +260,7 @@ protected:
drawContext->drawContextPriv().testingOnly_drawBatch(pipelineBuilder, batch);
- x += SkScalarCeilToScalar(rect.width() + 10.f);
+ x += SkScalarCeilToScalar(rect.width() + kDX);
}
// Draw rect without and with AA using normal API for reference
@@ -262,7 +268,7 @@ protected:
canvas->translate(x, y);
SkPaint paint;
canvas->drawRect(*iter.get(), paint);
- x += SkScalarCeilToScalar(iter.get()->width() + 10.f);
+ x += SkScalarCeilToScalar(iter.get()->width() + kDX);
paint.setAntiAlias(true);
canvas->drawRect(*iter.get(), paint);
canvas->restore();
« no previous file with comments | « no previous file | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698