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

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

Issue 1100073003: Extract gpu line dashing to GrDashLinePathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 8 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/GrDashLinePathRenderer.h ('k') | src/gpu/GrDefaultPathRenderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrDashLinePathRenderer.h"
9
10 #include "GrGpu.h"
11 #include "effects/GrDashingEffect.h"
12
13 GrDashLinePathRenderer::GrDashLinePathRenderer(GrContext* context)
14 : fGpu(SkRef(context->getGpu())) {
15 }
16
17 GrDashLinePathRenderer::~GrDashLinePathRenderer() {
18 }
19
20 bool GrDashLinePathRenderer::canDrawPath(const GrDrawTarget* target,
21 const GrPipelineBuilder* pipelineBuilde r,
22 const SkMatrix& viewMatrix,
23 const SkPath& path,
24 const GrStrokeInfo& stroke,
25 bool antiAlias) const {
26 SkPoint pts[2];
27 if (stroke.isDashed() && path.isLine(pts)) {
28 return GrDashingEffect::CanDrawDashLine(pts, stroke, viewMatrix);
29 }
30 return false;
31 }
32
33 bool GrDashLinePathRenderer::onDrawPath(GrDrawTarget* target,
34 GrPipelineBuilder* pipelineBuilder,
35 GrColor color,
36 const SkMatrix& viewMatrix,
37 const SkPath& path,
38 const GrStrokeInfo& stroke,
39 bool useAA) {
40 SkPoint pts[2];
41 SkAssertResult(path.isLine(pts));
42 return GrDashingEffect::DrawDashLine(fGpu, target, pipelineBuilder, color,
43 viewMatrix, pts, useAA, stroke);
44 }
OLDNEW
« no previous file with comments | « src/gpu/GrDashLinePathRenderer.h ('k') | src/gpu/GrDefaultPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698