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

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

Issue 1467253002: Restrict query bounds for reduce clip to dev bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rm commented out code and add comment Created 5 years 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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAALinearizingConvexPathRenderer.h" 9 #include "GrAALinearizingConvexPathRenderer.h"
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 sk_free(indices); 257 sk_free(indices);
258 } 258 }
259 259
260 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } 260 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
261 261
262 AAFlatteningConvexPathBatch(const Geometry& geometry) : INHERITED(ClassID()) { 262 AAFlatteningConvexPathBatch(const Geometry& geometry) : INHERITED(ClassID()) {
263 fGeoData.push_back(geometry); 263 fGeoData.push_back(geometry);
264 264
265 // compute bounds 265 // compute bounds
266 fBounds = geometry.fPath.getBounds(); 266 fBounds = geometry.fPath.getBounds();
267 SkScalar w = geometry.fStrokeWidth;
268 if (w > 0) {
269 w /= 2;
270 if (SkPaint::kMiter_Join == geometry.fJoin) {
robertphillips 2015/11/23 17:22:55 Shouldn't this be a max ? Does the miterLimit appl
bsalomon 2015/11/23 17:59:34 hairlines don't get joins applied to them. Do you
271 w *= geometry.fMiterLimit;
272 }
273 fBounds.outset(w, w);
274 }
267 geometry.fViewMatrix.mapRect(&fBounds); 275 geometry.fViewMatrix.mapRect(&fBounds);
268 } 276 }
269 277
270 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { 278 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
271 AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch> (); 279 AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch> ();
272 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pi peline(), 280 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pi peline(),
273 that->bounds(), caps)) { 281 that->bounds(), caps)) {
274 return false; 282 return false;
275 } 283 }
276 284
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { 346 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) {
339 AAFlatteningConvexPathBatch::Geometry geometry; 347 AAFlatteningConvexPathBatch::Geometry geometry;
340 geometry.fColor = GrRandomColor(random); 348 geometry.fColor = GrRandomColor(random);
341 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); 349 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random);
342 geometry.fPath = GrTest::TestPathConvex(random); 350 geometry.fPath = GrTest::TestPathConvex(random);
343 351
344 return AAFlatteningConvexPathBatch::Create(geometry); 352 return AAFlatteningConvexPathBatch::Create(geometry);
345 } 353 }
346 354
347 #endif 355 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698