| Index: src/gpu/GrDashLinePathRenderer.cpp
|
| diff --git a/src/gpu/GrDashLinePathRenderer.cpp b/src/gpu/GrDashLinePathRenderer.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..bd49a72156f27a90c9a1f32488a74f42805a06e2
|
| --- /dev/null
|
| +++ b/src/gpu/GrDashLinePathRenderer.cpp
|
| @@ -0,0 +1,44 @@
|
| +/*
|
| + * Copyright 2015 Google Inc.
|
| + *
|
| + * Use of this source code is governed by a BSD-style license that can be
|
| + * found in the LICENSE file.
|
| + */
|
| +
|
| +#include "GrDashLinePathRenderer.h"
|
| +
|
| +#include "GrGpu.h"
|
| +#include "effects/GrDashingEffect.h"
|
| +
|
| +GrDashLinePathRenderer::GrDashLinePathRenderer(GrContext* context)
|
| + : fGpu(SkRef(context->getGpu())) {
|
| +}
|
| +
|
| +GrDashLinePathRenderer::~GrDashLinePathRenderer() {
|
| +}
|
| +
|
| +bool GrDashLinePathRenderer::canDrawPath(const GrDrawTarget* target,
|
| + const GrPipelineBuilder* pipelineBuilder,
|
| + const SkMatrix& viewMatrix,
|
| + const SkPath& path,
|
| + const GrStrokeInfo& stroke,
|
| + bool antiAlias) const {
|
| + SkPoint pts[2];
|
| + if (stroke.isDashed() && path.isLine(pts)) {
|
| + return GrDashingEffect::CanDrawDashLine(pts, stroke, viewMatrix);
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +bool GrDashLinePathRenderer::onDrawPath(GrDrawTarget* target,
|
| + GrPipelineBuilder* pipelineBuilder,
|
| + GrColor color,
|
| + const SkMatrix& viewMatrix,
|
| + const SkPath& path,
|
| + const GrStrokeInfo& stroke,
|
| + bool useAA) {
|
| + SkPoint pts[2];
|
| + SkAssertResult(path.isLine(pts));
|
| + return GrDashingEffect::DrawDashLine(fGpu, target, pipelineBuilder, color,
|
| + viewMatrix, pts, useAA, stroke);
|
| +}
|
|
|