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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2259323003: GPU implementation of drawArc. (Closed) Base URL: https://chromium.googlesource.com/skia.git@drawArc
Patch Set: Address comments Created 4 years, 4 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 | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrOvalRenderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 7044b499fa953e96326d73efe8b32a8fa8ea2f9a..3b346b6efd302c68541db2a48701360f57aef9e0 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -997,6 +997,44 @@ void GrDrawContext::drawOval(const GrClip& clip,
this->internalDrawPath(clip, paint, viewMatrix, path, style);
}
+void GrDrawContext::drawArc(const GrClip& clip,
+ const GrPaint& paint,
+ const SkMatrix& viewMatrix,
+ const SkRect& oval,
+ SkScalar startAngle,
+ SkScalar sweepAngle,
+ bool useCenter,
+ const GrStyle& style) {
+ bool useHWAA;
+ if (should_apply_coverage_aa(paint, fRenderTarget.get(), &useHWAA)) {
+ GrShaderCaps* shaderCaps = fContext->caps()->shaderCaps();
+ SkAutoTUnref<GrDrawBatch> batch(GrOvalRenderer::CreateArcBatch(paint.getColor(),
+ viewMatrix,
+ oval,
+ startAngle,
+ sweepAngle,
+ useCenter,
+ style,
+ shaderCaps));
+ if (batch) {
+ GrPipelineBuilder pipelineBuilder(paint, useHWAA);
+ this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
+ return;
+ }
+ }
+ SkPath path;
+ path.setIsVolatile(true);
+ if (useCenter) {
+ path.moveTo(oval.centerX(), oval.centerY());
+ }
+ path.arcTo(oval, startAngle, sweepAngle, !useCenter);
+ if (useCenter) {
+ path.close();
+ }
+ this->internalDrawPath(clip, paint, viewMatrix, path, style);
+ return;
+}
+
void GrDrawContext::drawImageLattice(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrOvalRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698