OLD | NEW |
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 "GrTessellatingPathRenderer.h" | 8 #include "GrTessellatingPathRenderer.h" |
9 | 9 |
10 #include "GrAuditTrail.h" | 10 #include "GrAuditTrail.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 const SkRect& clipBounds) | 231 const SkRect& clipBounds) |
232 : INHERITED(ClassID()) | 232 : INHERITED(ClassID()) |
233 , fColor(color) | 233 , fColor(color) |
234 , fShape(shape) | 234 , fShape(shape) |
235 , fViewMatrix(viewMatrix) { | 235 , fViewMatrix(viewMatrix) { |
236 const SkRect& pathBounds = shape.bounds(); | 236 const SkRect& pathBounds = shape.bounds(); |
237 fClipBounds = clipBounds; | 237 fClipBounds = clipBounds; |
238 // Because the clip bounds are used to add a contour for inverse fills,
they must also | 238 // Because the clip bounds are used to add a contour for inverse fills,
they must also |
239 // include the path bounds. | 239 // include the path bounds. |
240 fClipBounds.join(pathBounds); | 240 fClipBounds.join(pathBounds); |
241 if (shape.inverseFilled()) { | 241 const SkRect& srcBounds = shape.inverseFilled() ? fClipBounds : pathBoun
ds; |
242 fBounds = fClipBounds; | 242 this->setTransformedBounds(srcBounds, viewMatrix, HasAABloat::kNo, IsZer
oArea::kNo); |
243 } else { | |
244 fBounds = pathBounds; | |
245 } | |
246 viewMatrix.mapRect(&fBounds); | |
247 } | 243 } |
248 | 244 |
249 GrColor fColor; | 245 GrColor fColor; |
250 GrShape fShape; | 246 GrShape fShape; |
251 SkMatrix fViewMatrix; | 247 SkMatrix fViewMatrix; |
252 SkRect fClipBounds; // in source space | 248 SkRect fClipBounds; // in source space |
253 GrXPOverridesForBatch fPipelineInfo; | 249 GrXPOverridesForBatch fPipelineInfo; |
254 | 250 |
255 typedef GrVertexBatch INHERITED; | 251 typedef GrVertexBatch INHERITED; |
256 }; | 252 }; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 vmi.mapRect(&clipBounds); | 296 vmi.mapRect(&clipBounds); |
301 GrStyle style; | 297 GrStyle style; |
302 do { | 298 do { |
303 GrTest::TestStyle(random, &style); | 299 GrTest::TestStyle(random, &style); |
304 } while (style.strokeRec().isHairlineStyle()); | 300 } while (style.strokeRec().isHairlineStyle()); |
305 GrShape shape(path, style); | 301 GrShape shape(path, style); |
306 return TessellatingPathBatch::Create(color, shape, viewMatrix, clipBounds); | 302 return TessellatingPathBatch::Create(color, shape, viewMatrix, clipBounds); |
307 } | 303 } |
308 | 304 |
309 #endif | 305 #endif |
OLD | NEW |