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

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

Issue 1541903002: added support for PLS path rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for ASAN failure Created 4 years, 10 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/batches/GrNinePatch.cpp ('k') | src/gpu/batches/GrPLSPathRenderer.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 "GrNonAAStrokeRectBatch.h" 8 #include "GrNonAAStrokeRectBatch.h"
9 9
10 #include "GrBatchTest.h" 10 #include "GrBatchTest.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 const char* name() const override { return "GrStrokeRectBatch"; } 55 const char* name() const override { return "GrStrokeRectBatch"; }
56 56
57 void computePipelineOptimizations(GrInitInvariantOutput* color, 57 void computePipelineOptimizations(GrInitInvariantOutput* color,
58 GrInitInvariantOutput* coverage, 58 GrInitInvariantOutput* coverage,
59 GrBatchToXPOverrides* overrides) const ove rride { 59 GrBatchToXPOverrides* overrides) const ove rride {
60 // When this is called on a batch, there is only one geometry bundle 60 // When this is called on a batch, there is only one geometry bundle
61 color->setKnownFourComponents(fGeoData[0].fColor); 61 color->setKnownFourComponents(fGeoData[0].fColor);
62 coverage->setKnownSingleComponent(0xff); 62 coverage->setKnownSingleComponent(0xff);
63 overrides->fUsePLSDstRead = false;
64 } 63 }
65 64
66 void append(GrColor color, const SkMatrix& viewMatrix, const SkRect& rect, 65 void append(GrColor color, const SkMatrix& viewMatrix, const SkRect& rect,
67 SkScalar strokeWidth) { 66 SkScalar strokeWidth) {
68 Geometry& geometry = fGeoData.push_back(); 67 Geometry& geometry = fGeoData.push_back();
69 geometry.fViewMatrix = viewMatrix; 68 geometry.fViewMatrix = viewMatrix;
70 geometry.fRect = rect; 69 geometry.fRect = rect;
71 geometry.fStrokeWidth = strokeWidth; 70 geometry.fStrokeWidth = strokeWidth;
72 geometry.fColor = color; 71 geometry.fColor = color;
73 72
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 DRAW_BATCH_TEST_DEFINE(NonAAStrokeRectBatch) { 244 DRAW_BATCH_TEST_DEFINE(NonAAStrokeRectBatch) {
246 SkMatrix viewMatrix = GrTest::TestMatrix(random); 245 SkMatrix viewMatrix = GrTest::TestMatrix(random);
247 GrColor color = GrRandomColor(random); 246 GrColor color = GrRandomColor(random);
248 SkRect rect = GrTest::TestRect(random); 247 SkRect rect = GrTest::TestRect(random);
249 SkScalar strokeWidth = random->nextBool() ? 0.0f : 1.0f; 248 SkScalar strokeWidth = random->nextBool() ? 0.0f : 1.0f;
250 249
251 return GrNonAAStrokeRectBatch::Create(color, viewMatrix, rect, strokeWidth, random->nextBool()); 250 return GrNonAAStrokeRectBatch::Create(color, viewMatrix, rect, strokeWidth, random->nextBool());
252 } 251 }
253 252
254 #endif 253 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrNinePatch.cpp ('k') | src/gpu/batches/GrPLSPathRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698