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

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

Issue 1967513002: Revert of Replace GrStrokeInfo with GrStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@resscale
Patch Set: Created 4 years, 7 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/GrSWMaskHelper.cpp ('k') | src/gpu/GrStrokeInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrSoftwarePathRenderer.h" 8 #include "GrSoftwarePathRenderer.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrSWMaskHelper.h" 10 #include "GrSWMaskHelper.h"
11 #include "batches/GrRectBatchFactory.h" 11 #include "batches/GrRectBatchFactory.h"
12 12
13 //////////////////////////////////////////////////////////////////////////////// 13 ////////////////////////////////////////////////////////////////////////////////
14 bool GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { 14 bool GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
15 return SkToBool(fContext); 15 if (nullptr == fContext) {
16 return false;
17 }
18 if (args.fStroke->isDashed()) {
19 return false;
20 }
21 return true;
16 } 22 }
17 23
18 namespace { 24 namespace {
19 25
20 //////////////////////////////////////////////////////////////////////////////// 26 ////////////////////////////////////////////////////////////////////////////////
21 // gets device coord bounds of path (not considering the fill) and clip. The 27 // gets device coord bounds of path (not considering the fill) and clip. The
22 // path bounds will be a subset of the clip bounds. returns false if 28 // path bounds will be a subset of the clip bounds. returns false if
23 // path bounds would be empty. 29 // path bounds would be empty.
24 bool get_path_and_clip_bounds(const GrPipelineBuilder* pipelineBuilder, 30 bool get_path_and_clip_bounds(const GrPipelineBuilder* pipelineBuilder,
25 const SkPath& path, 31 const SkPath& path,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 if (!get_path_and_clip_bounds(args.fPipelineBuilder, *args.fPath, 123 if (!get_path_and_clip_bounds(args.fPipelineBuilder, *args.fPath,
118 *args.fViewMatrix, &devPathBounds, &devClipBou nds)) { 124 *args.fViewMatrix, &devPathBounds, &devClipBou nds)) {
119 if (args.fPath->isInverseFillType()) { 125 if (args.fPath->isInverseFillType()) {
120 draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColo r, 126 draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColo r,
121 *args.fViewMatrix, devClipBounds, devPathBounds ); 127 *args.fViewMatrix, devClipBounds, devPathBounds );
122 } 128 }
123 return true; 129 return true;
124 } 130 }
125 131
126 SkAutoTUnref<GrTexture> texture( 132 SkAutoTUnref<GrTexture> texture(
127 GrSWMaskHelper::DrawPathMaskToTexture(fContext, *args.fPath, *args.f Style, 133 GrSWMaskHelper::DrawPathMaskToTexture(fContext, *args.fPath, *args.f Stroke,
128 devPathBounds, 134 devPathBounds,
129 args.fAntiAlias, args.fViewMat rix)); 135 args.fAntiAlias, args.fViewMat rix));
130 if (nullptr == texture) { 136 if (nullptr == texture) {
131 return false; 137 return false;
132 } 138 }
133 139
134 GrSWMaskHelper::DrawToTargetWithPathMask(texture, args.fTarget, args.fPipeli neBuilder, 140 GrSWMaskHelper::DrawToTargetWithPathMask(texture, args.fTarget, args.fPipeli neBuilder,
135 args.fColor, *args.fViewMatrix, dev PathBounds); 141 args.fColor, *args.fViewMatrix, dev PathBounds);
136 142
137 if (args.fPath->isInverseFillType()) { 143 if (args.fPath->isInverseFillType()) {
138 draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColor, * args.fViewMatrix, 144 draw_around_inv_path(args.fTarget, args.fPipelineBuilder, args.fColor, * args.fViewMatrix,
139 devClipBounds, devPathBounds); 145 devClipBounds, devPathBounds);
140 } 146 }
141 147
142 return true; 148 return true;
143 } 149 }
OLDNEW
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/GrStrokeInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698