diff options
author | 2014-09-04 08:56:46 -0700 | |
---|---|---|
committer | 2014-09-04 08:56:46 -0700 | |
commit | bd769d0f1c8cf6ccbb2738dfad1624a4c828e4eb (patch) | |
tree | 1fb4cd896c5d63bf3eb0dddbbd7259edab8703e3 /src/gpu/GrOvalRenderer.cpp | |
parent | c5ba71d2e5cd426def66fa49dcf003e5b2c98dc7 (diff) |
Initial change to create GeometryProcessor
BUG=skia:
R=bsalomon@google.com, robertphillips@google.com, egdaniel@google.com, jvanverth@google.com
Author: joshualitt@chromium.org
Review URL: https://codereview.chromium.org/509153002
Diffstat (limited to 'src/gpu/GrOvalRenderer.cpp')
-rw-r--r-- | src/gpu/GrOvalRenderer.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index f368dc8d89..330d4e9289 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -553,7 +553,7 @@ void GrOvalRenderer::drawCircle(GrDrawTarget* target, GrEffect* effect = CircleEdgeEffect::Create(isStrokeOnly && innerRadius > 0); static const int kCircleEdgeAttrIndex = 1; - drawState->addCoverageEffect(effect, kCircleEdgeAttrIndex)->unref(); + drawState->setGeometryProcessor(effect, kCircleEdgeAttrIndex)->unref(); // The radii are outset for two reasons. First, it allows the shader to simply perform // clamp(distance-to-center - radius, 0, 1). Second, the outer radius is used to compute the @@ -696,7 +696,7 @@ bool GrOvalRenderer::drawEllipse(GrDrawTarget* target, static const int kEllipseCenterAttrIndex = 1; static const int kEllipseEdgeAttrIndex = 2; - drawState->addCoverageEffect(effect, kEllipseCenterAttrIndex, kEllipseEdgeAttrIndex)->unref(); + drawState->setGeometryProcessor(effect, kEllipseCenterAttrIndex, kEllipseEdgeAttrIndex)->unref(); // Compute the reciprocals of the radii here to save time in the shader SkScalar xRadRecip = SkScalarInvert(xRadius); @@ -814,8 +814,8 @@ bool GrOvalRenderer::drawDIEllipse(GrDrawTarget* target, static const int kEllipseOuterOffsetAttrIndex = 1; static const int kEllipseInnerOffsetAttrIndex = 2; - drawState->addCoverageEffect(effect, kEllipseOuterOffsetAttrIndex, - kEllipseInnerOffsetAttrIndex)->unref(); + drawState->setGeometryProcessor(effect, kEllipseOuterOffsetAttrIndex, + kEllipseInnerOffsetAttrIndex)->unref(); // This expands the outer rect so that after CTM we end up with a half-pixel border SkScalar a = vm[SkMatrix::kMScaleX]; @@ -1063,7 +1063,7 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us GrEffect* effect = CircleEdgeEffect::Create(isStrokeOnly); static const int kCircleEdgeAttrIndex = 1; - drawState->addCoverageEffect(effect, kCircleEdgeAttrIndex)->unref(); + drawState->setGeometryProcessor(effect, kCircleEdgeAttrIndex)->unref(); // The radii are outset for two reasons. First, it allows the shader to simply perform // clamp(distance-to-center - radius, 0, 1). Second, the outer radius is used to compute the @@ -1168,8 +1168,9 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us GrEffect* effect = EllipseEdgeEffect::Create(isStrokeOnly); static const int kEllipseOffsetAttrIndex = 1; static const int kEllipseRadiiAttrIndex = 2; - drawState->addCoverageEffect(effect, - kEllipseOffsetAttrIndex, kEllipseRadiiAttrIndex)->unref(); + drawState->setGeometryProcessor(effect, + kEllipseOffsetAttrIndex, + kEllipseRadiiAttrIndex)->unref(); // Compute the reciprocals of the radii here to save time in the shader SkScalar xRadRecip = SkScalarInvert(xRadius); |