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

Side by Side Diff: src/gpu/batches/GrAAHairLinePathRenderer.cpp

Issue 2126083002: Remove fColor from PathRenderer DrawPathArgs struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unnecessary GrPaint::setColor calls Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" 8 #include "GrAAHairLinePathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(), 961 GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
962 "GrAAHairlinePathRenderer::onDrawPath"); 962 "GrAAHairlinePathRenderer::onDrawPath");
963 SkASSERT(!args.fDrawContext->isUnifiedMultisampled()); 963 SkASSERT(!args.fDrawContext->isUnifiedMultisampled());
964 964
965 SkIRect devClipBounds; 965 SkIRect devClipBounds;
966 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont ext->height(), 966 args.fClip->getConservativeBounds(args.fDrawContext->width(), args.fDrawCont ext->height(),
967 &devClipBounds); 967 &devClipBounds);
968 968
969 SkPath path; 969 SkPath path;
970 args.fShape->asPath(&path); 970 args.fShape->asPath(&path);
971 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fColor, *args.fVi ewMatrix, path, 971 SkAutoTUnref<GrDrawBatch> batch(create_hairline_batch(args.fPaint->getColor( ),
972 *args.fViewMatrix, pat h,
972 args.fShape->style(), devClipBounds)); 973 args.fShape->style(), devClipBounds));
973 974
974 GrPipelineBuilder pipelineBuilder(*args.fPaint); 975 GrPipelineBuilder pipelineBuilder(*args.fPaint);
975 pipelineBuilder.setUserStencil(args.fUserStencilSettings); 976 pipelineBuilder.setUserStencil(args.fUserStencilSettings);
976 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch); 977 args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
977 978
978 return true; 979 return true;
979 } 980 }
980 981
981 //////////////////////////////////////////////////////////////////////////////// /////////////////// 982 //////////////////////////////////////////////////////////////////////////////// ///////////////////
982 983
983 #ifdef GR_TEST_UTILS 984 #ifdef GR_TEST_UTILS
984 985
985 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) { 986 DRAW_BATCH_TEST_DEFINE(AAHairlineBatch) {
986 GrColor color = GrRandomColor(random); 987 GrColor color = GrRandomColor(random);
987 SkMatrix viewMatrix = GrTest::TestMatrix(random); 988 SkMatrix viewMatrix = GrTest::TestMatrix(random);
988 SkPath path = GrTest::TestPath(random); 989 SkPath path = GrTest::TestPath(random);
989 SkIRect devClipBounds; 990 SkIRect devClipBounds;
990 devClipBounds.setEmpty(); 991 devClipBounds.setEmpty();
991 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin e(), devClipBounds); 992 return create_hairline_batch(color, viewMatrix, path, GrStyle::SimpleHairlin e(), devClipBounds);
992 } 993 }
993 994
994 #endif 995 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698