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

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

Issue 1087323002: Implement caching in the tessellating path renderer, including strokes. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: NULL -> nullptr Created 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrPathRenderer.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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAARectRenderer.h" 9 #include "GrAARectRenderer.h"
10 #include "GrAtlasTextContext.h" 10 #include "GrAtlasTextContext.h"
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 } 1051 }
1052 1052
1053 return allEq || allGoE1; 1053 return allEq || allGoE1;
1054 } 1054 }
1055 1055
1056 void GrDrawContext::drawPath(GrRenderTarget* rt, 1056 void GrDrawContext::drawPath(GrRenderTarget* rt,
1057 const GrClip& clip, 1057 const GrClip& clip,
1058 const GrPaint& paint, 1058 const GrPaint& paint,
1059 const SkMatrix& viewMatrix, 1059 const SkMatrix& viewMatrix,
1060 const SkPath& path, 1060 const SkPath& path,
1061 const GrStrokeInfo& strokeInfo) { 1061 const GrStrokeInfo& strokeInfo,
1062 const SkPath* origSrcPath,
1063 const GrStrokeInfo* origStrokeInfo) {
1062 RETURN_IF_ABANDONED 1064 RETURN_IF_ABANDONED
1063 if (path.isEmpty()) { 1065 if (path.isEmpty()) {
1064 if (path.isInverseFillType()) { 1066 if (path.isInverseFillType()) {
1065 this->drawPaint(rt, clip, paint, viewMatrix); 1067 this->drawPaint(rt, clip, paint, viewMatrix);
1066 } 1068 }
1067 return; 1069 return;
1068 } 1070 }
1069 1071
1070 GrColor color = paint.getColor(); 1072 GrColor color = paint.getColor();
1071 1073
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 color, 1105 color,
1104 viewMatrix, 1106 viewMatrix,
1105 paint.isAntiAlias(), 1107 paint.isAntiAlias(),
1106 ovalRect, 1108 ovalRect,
1107 strokeInfo)) { 1109 strokeInfo)) {
1108 return; 1110 return;
1109 } 1111 }
1110 } 1112 }
1111 } 1113 }
1112 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, pai nt.isAntiAlias(), 1114 this->internalDrawPath(fDrawTarget, &pipelineBuilder, viewMatrix, color, pai nt.isAntiAlias(),
1113 path, strokeInfo); 1115 path, strokeInfo, origSrcPath, origStrokeInfo);
1114 } 1116 }
1115 1117
1116 void GrDrawContext::internalDrawPath(GrDrawTarget* target, 1118 void GrDrawContext::internalDrawPath(GrDrawTarget* target,
1117 GrPipelineBuilder* pipelineBuilder, 1119 GrPipelineBuilder* pipelineBuilder,
1118 const SkMatrix& viewMatrix, 1120 const SkMatrix& viewMatrix,
1119 GrColor color, 1121 GrColor color,
1120 bool useAA, 1122 bool useAA,
1121 const SkPath& path, 1123 const SkPath& path,
1122 const GrStrokeInfo& strokeInfo) { 1124 const GrStrokeInfo& strokeInfo,
1125 const SkPath* origSrcPath,
1126 const GrStrokeInfo* origStrokeInfo) {
1123 RETURN_IF_ABANDONED 1127 RETURN_IF_ABANDONED
1124 SkASSERT(!path.isEmpty()); 1128 SkASSERT(!path.isEmpty());
1125 1129
1126 1130
1127 // An Assumption here is that path renderer would use some form of tweaking 1131 // An Assumption here is that path renderer would use some form of tweaking
1128 // the src color (either the input alpha or in the frag shader) to implement 1132 // the src color (either the input alpha or in the frag shader) to implement
1129 // aa. If we have some future driver-mojo path AA that can do the right 1133 // aa. If we have some future driver-mojo path AA that can do the right
1130 // thing WRT to the blend then we'll need some query on the PR. 1134 // thing WRT to the blend then we'll need some query on the PR.
1131 bool useCoverageAA = useAA && 1135 bool useCoverageAA = useAA &&
1132 !pipelineBuilder->getRenderTarget()->isUnifiedMultisampled(); 1136 !pipelineBuilder->getRenderTarget()->isUnifiedMultisampled();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 1196
1193 GrPathRenderer::DrawPathArgs args; 1197 GrPathRenderer::DrawPathArgs args;
1194 args.fTarget = target; 1198 args.fTarget = target;
1195 args.fResourceProvider = fContext->resourceProvider(); 1199 args.fResourceProvider = fContext->resourceProvider();
1196 args.fPipelineBuilder = pipelineBuilder; 1200 args.fPipelineBuilder = pipelineBuilder;
1197 args.fColor = color; 1201 args.fColor = color;
1198 args.fViewMatrix = &viewMatrix; 1202 args.fViewMatrix = &viewMatrix;
1199 args.fPath = pathPtr; 1203 args.fPath = pathPtr;
1200 args.fStroke = strokeInfoPtr; 1204 args.fStroke = strokeInfoPtr;
1201 args.fAntiAlias = useCoverageAA; 1205 args.fAntiAlias = useCoverageAA;
1206 args.fOrigSrcPath = origSrcPath;
1207 args.fOrigStrokeInfo = origStrokeInfo;
1202 pr->drawPath(args); 1208 pr->drawPath(args);
1203 } 1209 }
1204 1210
1205 bool GrDrawContext::prepareToDraw(GrRenderTarget* rt) { 1211 bool GrDrawContext::prepareToDraw(GrRenderTarget* rt) {
1206 RETURN_FALSE_IF_ABANDONED 1212 RETURN_FALSE_IF_ABANDONED
1207 1213
1208 ASSERT_OWNED_RESOURCE(rt); 1214 ASSERT_OWNED_RESOURCE(rt);
1209 SkASSERT(rt); 1215 SkASSERT(rt);
1210 return true; 1216 return true;
1211 } 1217 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 return DrawVerticesBatch::Create(geometry, type, viewMatrix, 1340 return DrawVerticesBatch::Create(geometry, type, viewMatrix,
1335 positions.begin(), vertexCount, 1341 positions.begin(), vertexCount,
1336 indices.begin(), hasIndices ? vertexCount : 0, 1342 indices.begin(), hasIndices ? vertexCount : 0,
1337 colors.begin(), 1343 colors.begin(),
1338 texCoords.begin(), 1344 texCoords.begin(),
1339 bounds); 1345 bounds);
1340 } 1346 }
1341 1347
1342 #endif 1348 #endif
1343 1349
OLDNEW
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698