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

Side by Side Diff: src/gpu/GrClipMaskManager.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 | « include/gpu/GrPaint.h ('k') | src/gpu/GrDrawContext.cpp » ('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 "GrClipMaskManager.h" 8 #include "GrClipMaskManager.h"
9 #include "GrCaps.h" 9 #include "GrCaps.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 849
850 GrPathRenderer::DrawPathArgs args; 850 GrPathRenderer::DrawPathArgs args;
851 args.fTarget = fDrawTarget; 851 args.fTarget = fDrawTarget;
852 args.fResourceProvider = this->getContext()->resourc eProvider(); 852 args.fResourceProvider = this->getContext()->resourc eProvider();
853 args.fPipelineBuilder = &pipelineBuilder; 853 args.fPipelineBuilder = &pipelineBuilder;
854 args.fColor = GrColor_WHITE; 854 args.fColor = GrColor_WHITE;
855 args.fViewMatrix = &viewMatrix; 855 args.fViewMatrix = &viewMatrix;
856 args.fPath = &clipPath; 856 args.fPath = &clipPath;
857 args.fStroke = &stroke; 857 args.fStroke = &stroke;
858 args.fAntiAlias = false; 858 args.fAntiAlias = false;
859 args.fGammaCorrect = false;
859 pr->drawPath(args); 860 pr->drawPath(args);
860 } else { 861 } else {
861 GrPathRenderer::StencilPathArgs args; 862 GrPathRenderer::StencilPathArgs args;
862 args.fTarget = fDrawTarget; 863 args.fTarget = fDrawTarget;
863 args.fResourceProvider = this->getContext()->resourc eProvider(); 864 args.fResourceProvider = this->getContext()->resourc eProvider();
864 args.fPipelineBuilder = &pipelineBuilder; 865 args.fPipelineBuilder = &pipelineBuilder;
865 args.fViewMatrix = &viewMatrix; 866 args.fViewMatrix = &viewMatrix;
866 args.fPath = &clipPath; 867 args.fPath = &clipPath;
867 args.fStroke = &stroke; 868 args.fStroke = &stroke;
868 pr->stencilPath(args); 869 pr->stencilPath(args);
(...skipping 15 matching lines...) Expand all
884 } else { 885 } else {
885 GrPathRenderer::DrawPathArgs args; 886 GrPathRenderer::DrawPathArgs args;
886 args.fTarget = fDrawTarget; 887 args.fTarget = fDrawTarget;
887 args.fResourceProvider = this->getContext()->resourcePro vider(); 888 args.fResourceProvider = this->getContext()->resourcePro vider();
888 args.fPipelineBuilder = &pipelineBuilder; 889 args.fPipelineBuilder = &pipelineBuilder;
889 args.fColor = GrColor_WHITE; 890 args.fColor = GrColor_WHITE;
890 args.fViewMatrix = &viewMatrix; 891 args.fViewMatrix = &viewMatrix;
891 args.fPath = &clipPath; 892 args.fPath = &clipPath;
892 args.fStroke = &stroke; 893 args.fStroke = &stroke;
893 args.fAntiAlias = false; 894 args.fAntiAlias = false;
895 args.fGammaCorrect = false;
894 pr->drawPath(args); 896 pr->drawPath(args);
895 } 897 }
896 } else { 898 } else {
897 // The view matrix is setup to do clip space -> stencil spac e translation, so 899 // The view matrix is setup to do clip space -> stencil spac e translation, so
898 // draw rect in clip space. 900 // draw rect in clip space.
899 draw_non_aa_rect(fDrawTarget, pipelineBuilder, GrColor_WHITE , viewMatrix, 901 draw_non_aa_rect(fDrawTarget, pipelineBuilder, GrColor_WHITE , viewMatrix,
900 SkRect::Make(clipSpaceIBounds)); 902 SkRect::Make(clipSpaceIBounds));
901 } 903 }
902 } 904 }
903 } 905 }
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 1156
1155 //////////////////////////////////////////////////////////////////////////////// 1157 ////////////////////////////////////////////////////////////////////////////////
1156 1158
1157 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment, 1159 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc ilAttachment,
1158 GrStencilSettings* settings) { 1160 GrStencilSettings* settings) {
1159 if (stencilAttachment) { 1161 if (stencilAttachment) {
1160 int stencilBits = stencilAttachment->bits(); 1162 int stencilBits = stencilAttachment->bits();
1161 this->adjustStencilParams(settings, fClipMode, stencilBits); 1163 this->adjustStencilParams(settings, fClipMode, stencilBits);
1162 } 1164 }
1163 } 1165 }
OLDNEW
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698