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

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

Issue 1889453002: Tweak distance field path renderer behavior in gamma-correct mode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebased, plumbed gamma-correctness via DrawPathArgs, fixed typos from most recent change Created 4 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/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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "GrBatchTest.h" 8 #include "GrBatchTest.h"
9 #include "GrColor.h" 9 #include "GrColor.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 915
916 GrPathRenderer::DrawPathArgs args; 916 GrPathRenderer::DrawPathArgs args;
917 args.fTarget = fDrawContext->getDrawTarget(); 917 args.fTarget = fDrawContext->getDrawTarget();
918 args.fResourceProvider = fDrawContext->fDrawingManager->getContext()->resour ceProvider(); 918 args.fResourceProvider = fDrawContext->fDrawingManager->getContext()->resour ceProvider();
919 args.fPipelineBuilder = &pipelineBuilder; 919 args.fPipelineBuilder = &pipelineBuilder;
920 args.fColor = GrColor_WHITE; 920 args.fColor = GrColor_WHITE;
921 args.fViewMatrix = &viewMatrix; 921 args.fViewMatrix = &viewMatrix;
922 args.fPath = &path; 922 args.fPath = &path;
923 args.fStroke = &GrStrokeInfo::FillInfo(); 923 args.fStroke = &GrStrokeInfo::FillInfo();
924 args.fAntiAlias = useCoverageAA; 924 args.fAntiAlias = useCoverageAA;
925 args.fGammaCorrect = fDrawContext->isGammaCorrect();
925 pr->drawPath(args); 926 pr->drawPath(args);
926 return true; 927 return true;
927 } 928 }
928 929
929 void GrDrawContext::internalDrawPath(const GrClip& clip, 930 void GrDrawContext::internalDrawPath(const GrClip& clip,
930 const GrPaint& paint, 931 const GrPaint& paint,
931 const SkMatrix& viewMatrix, 932 const SkMatrix& viewMatrix,
932 const SkPath& path, 933 const SkPath& path,
933 const GrStrokeInfo& strokeInfo) { 934 const GrStrokeInfo& strokeInfo) {
934 ASSERT_SINGLE_OWNER 935 ASSERT_SINGLE_OWNER
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 1019
1019 GrPathRenderer::DrawPathArgs args; 1020 GrPathRenderer::DrawPathArgs args;
1020 args.fTarget = this->getDrawTarget(); 1021 args.fTarget = this->getDrawTarget();
1021 args.fResourceProvider = fDrawingManager->getContext()->resourceProvider(); 1022 args.fResourceProvider = fDrawingManager->getContext()->resourceProvider();
1022 args.fPipelineBuilder = &pipelineBuilder; 1023 args.fPipelineBuilder = &pipelineBuilder;
1023 args.fColor = paint.getColor(); 1024 args.fColor = paint.getColor();
1024 args.fViewMatrix = &viewMatrix; 1025 args.fViewMatrix = &viewMatrix;
1025 args.fPath = pathPtr; 1026 args.fPath = pathPtr;
1026 args.fStroke = strokeInfoPtr; 1027 args.fStroke = strokeInfoPtr;
1027 args.fAntiAlias = useCoverageAA; 1028 args.fAntiAlias = useCoverageAA;
1029 args.fGammaCorrect = this->isGammaCorrect();
1028 pr->drawPath(args); 1030 pr->drawPath(args);
1029 } 1031 }
1030 1032
1031 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 1033 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
1032 ASSERT_SINGLE_OWNER 1034 ASSERT_SINGLE_OWNER
1033 RETURN_IF_ABANDONED 1035 RETURN_IF_ABANDONED
1034 SkDEBUGCODE(this->validate();) 1036 SkDEBUGCODE(this->validate();)
1035 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1037 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1036 1038
1037 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); 1039 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
1038 } 1040 }
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