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

Side by Side Diff: src/gpu/GrSoftwarePathRenderer.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 | « src/gpu/GrShape.cpp ('k') | src/gpu/batches/GrAADistanceFieldPathRenderer.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 2012 Google Inc. 2 * Copyright 2012 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 "GrSoftwarePathRenderer.h" 8 #include "GrSoftwarePathRenderer.h"
9 #include "GrAuditTrail.h" 9 #include "GrAuditTrail.h"
10 #include "GrClip.h" 10 #include "GrClip.h"
(...skipping 20 matching lines...) Expand all
31 const SkMatrix& matrix, 31 const SkMatrix& matrix,
32 SkIRect* devShapeBounds, 32 SkIRect* devShapeBounds,
33 SkIRect* devClipBounds) { 33 SkIRect* devClipBounds) {
34 // compute bounds as intersection of rt size, clip, and path 34 // compute bounds as intersection of rt size, clip, and path
35 clip.getConservativeBounds(width, height, devClipBounds); 35 clip.getConservativeBounds(width, height, devClipBounds);
36 36
37 if (devClipBounds->isEmpty()) { 37 if (devClipBounds->isEmpty()) {
38 *devShapeBounds = SkIRect::MakeWH(width, height); 38 *devShapeBounds = SkIRect::MakeWH(width, height);
39 return false; 39 return false;
40 } 40 }
41 SkRect shapeBounds; 41 SkRect shapeBounds = shape.styledBounds();
42 shape.styledBounds(&shapeBounds);
43 if (!shapeBounds.isEmpty()) { 42 if (!shapeBounds.isEmpty()) {
44 SkRect shapeSBounds; 43 SkRect shapeSBounds;
45 matrix.mapRect(&shapeSBounds, shapeBounds); 44 matrix.mapRect(&shapeSBounds, shapeBounds);
46 SkIRect shapeIBounds; 45 SkIRect shapeIBounds;
47 shapeSBounds.roundOut(&shapeIBounds); 46 shapeSBounds.roundOut(&shapeIBounds);
48 *devShapeBounds = *devClipBounds; 47 *devShapeBounds = *devClipBounds;
49 if (!devShapeBounds->intersect(shapeIBounds)) { 48 if (!devShapeBounds->intersect(shapeIBounds)) {
50 // set the correct path bounds, as this would be used later. 49 // set the correct path bounds, as this would be used later.
51 *devShapeBounds = shapeIBounds; 50 *devShapeBounds = shapeIBounds;
52 return false; 51 return false;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 devShapeBounds); 159 devShapeBounds);
161 160
162 if (inverseFilled) { 161 if (inverseFilled) {
163 DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSetti ngs, 162 DrawAroundInvPath(args.fDrawContext, args.fPaint, args.fUserStencilSetti ngs,
164 *args.fClip, args.fColor, 163 *args.fClip, args.fColor,
165 *args.fViewMatrix, devClipBounds, devShapeBounds); 164 *args.fViewMatrix, devClipBounds, devShapeBounds);
166 } 165 }
167 166
168 return true; 167 return true;
169 } 168 }
OLDNEW
« no previous file with comments | « src/gpu/GrShape.cpp ('k') | src/gpu/batches/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698