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

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

Issue 1936073003: When filling nested rect path check for empty inner and empty outer rects (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rm skpath.h include Created 4 years, 7 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/GrAAStrokeRectBatch.cpp ('k') | tests/skbug5221.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 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 "GrRectBatchFactory.h" 8 #include "GrRectBatchFactory.h"
9 9
10 #include "GrAAStrokeRectBatch.h" 10 #include "GrAAStrokeRectBatch.h"
11 11
12 #include "SkStrokeRec.h" 12 #include "SkStrokeRec.h"
13 13
14 namespace GrRectBatchFactory { 14 namespace GrRectBatchFactory {
15 15
16 GrDrawBatch* CreateAAFillNestedRects(GrColor color, 16 GrDrawBatch* CreateAAFillNestedRects(GrColor color,
17 const SkMatrix& viewMatrix, 17 const SkMatrix& viewMatrix,
18 const SkRect rects[2]) { 18 const SkRect rects[2]) {
19 SkASSERT(viewMatrix.rectStaysRect()); 19 SkASSERT(viewMatrix.rectStaysRect());
20 SkASSERT(!rects[0].isEmpty() && !rects[1].isEmpty()); 20 SkASSERT(!rects[0].isEmpty() && !rects[1].isEmpty());
21 21
22 SkRect devOutside, devInside; 22 SkRect devOutside, devInside;
23 viewMatrix.mapRect(&devOutside, rects[0]); 23 viewMatrix.mapRect(&devOutside, rects[0]);
24 viewMatrix.mapRect(&devInside, rects[1]); 24 viewMatrix.mapRect(&devInside, rects[1]);
25 if (devInside.isEmpty()) {
26 if (devOutside.isEmpty()) {
27 return nullptr;
28 }
29 return GrAAFillRectBatch::Create(color, viewMatrix, devOutside, devOutsi de);
30 }
25 31
26 return GrAAStrokeRectBatch::Create(color, viewMatrix, devOutside, devOutside , devInside, true, 32 return GrAAStrokeRectBatch::CreateFillBetweenRects(color, viewMatrix, devOut side, devInside);
27 devInside.isEmpty());
28 } 33 }
29 34
30 }; 35 };
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAAStrokeRectBatch.cpp ('k') | tests/skbug5221.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698