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

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

Issue 2108523002: Make lines a special case in GrShape (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: reject empty shape in GrDC::internalDrawPath 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
« no previous file with comments | « no previous file | src/gpu/GrShape.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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 969
970 bool useCoverageAA = should_apply_coverage_aa(paint, fRenderTarget.get()); 970 bool useCoverageAA = should_apply_coverage_aa(paint, fRenderTarget.get());
971 constexpr bool kHasUserStencilSettings = false; 971 constexpr bool kHasUserStencilSettings = false;
972 bool isStencilBufferMSAA = fRenderTarget->isStencilBufferMultisampled(); 972 bool isStencilBufferMSAA = fRenderTarget->isStencilBufferMultisampled();
973 973
974 const GrPathRendererChain::DrawType type = 974 const GrPathRendererChain::DrawType type =
975 useCoverageAA ? GrPathRendererChain::kColorAntiAlias_DrawType 975 useCoverageAA ? GrPathRendererChain::kColorAntiAlias_DrawType
976 : GrPathRendererChain::kColor_DrawType; 976 : GrPathRendererChain::kColor_DrawType;
977 977
978 GrShape shape(path, style); 978 GrShape shape(path, style);
979 if (shape.isEmpty()) {
980 return;
981 }
979 GrPathRenderer::CanDrawPathArgs canDrawArgs; 982 GrPathRenderer::CanDrawPathArgs canDrawArgs;
980 canDrawArgs.fShaderCaps = fDrawingManager->getContext()->caps()->shaderCaps( ); 983 canDrawArgs.fShaderCaps = fDrawingManager->getContext()->caps()->shaderCaps( );
981 canDrawArgs.fViewMatrix = &viewMatrix; 984 canDrawArgs.fViewMatrix = &viewMatrix;
982 canDrawArgs.fShape = &shape; 985 canDrawArgs.fShape = &shape;
983 canDrawArgs.fAntiAlias = useCoverageAA; 986 canDrawArgs.fAntiAlias = useCoverageAA;
984 canDrawArgs.fHasUserStencilSettings = kHasUserStencilSettings; 987 canDrawArgs.fHasUserStencilSettings = kHasUserStencilSettings;
985 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA; 988 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA;
986 989
987 // Try a 1st time without applying any of the style to the geometry (and bar ring sw) 990 // Try a 1st time without applying any of the style to the geometry (and bar ring sw)
988 GrPathRenderer* pr = fDrawingManager->getPathRenderer(canDrawArgs, false, ty pe); 991 GrPathRenderer* pr = fDrawingManager->getPathRenderer(canDrawArgs, false, ty pe);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 1033
1031 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, 1034 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip,
1032 GrDrawBatch* batch) { 1035 GrDrawBatch* batch) {
1033 ASSERT_SINGLE_OWNER 1036 ASSERT_SINGLE_OWNER
1034 RETURN_IF_ABANDONED 1037 RETURN_IF_ABANDONED
1035 SkDEBUGCODE(this->validate();) 1038 SkDEBUGCODE(this->validate();)
1036 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1039 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1037 1040
1038 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 1041 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
1039 } 1042 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrShape.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698