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

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

Issue 1467253002: Restrict query bounds for reduce clip to dev bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 1 month 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/GrBatch.h ('k') | no next file » | 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 "GrTessellatingPathRenderer.h" 8 #include "GrTessellatingPathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 1585
1586 TessellatingPathBatch(const GrColor& color, 1586 TessellatingPathBatch(const GrColor& color,
1587 const SkPath& path, 1587 const SkPath& path,
1588 const GrStrokeInfo& stroke, 1588 const GrStrokeInfo& stroke,
1589 const SkMatrix& viewMatrix, 1589 const SkMatrix& viewMatrix,
1590 const SkRect& clipBounds) 1590 const SkRect& clipBounds)
1591 : INHERITED(ClassID()) 1591 : INHERITED(ClassID())
1592 , fColor(color) 1592 , fColor(color)
1593 , fPath(path) 1593 , fPath(path)
1594 , fStroke(stroke) 1594 , fStroke(stroke)
1595 , fViewMatrix(viewMatrix) 1595 , fViewMatrix(viewMatrix) {
1596 , fClipBounds(clipBounds) { 1596 const SkRect& pathBounds = path.getBounds();
1597 fBounds = path.getBounds(); 1597 fClipBounds = clipBounds;
1598 // Because the clip bounds are used to add a contour for inverse fills, they must also
1599 // include the path bounds.
1600 fClipBounds.join(pathBounds);
1601 if (path.isInverseFillType()) {
1602 fBounds = fClipBounds;
1603 } else {
1604 fBounds = path.getBounds();
1605 }
1598 if (!stroke.isFillStyle()) { 1606 if (!stroke.isFillStyle()) {
1599 SkScalar radius = SkScalarHalf(stroke.getWidth()); 1607 SkScalar radius = SkScalarHalf(stroke.getWidth());
1600 if (stroke.getJoin() == SkPaint::kMiter_Join) { 1608 if (stroke.getJoin() == SkPaint::kMiter_Join) {
1601 SkScalar scale = stroke.getMiter(); 1609 SkScalar scale = stroke.getMiter();
1602 if (scale > SK_Scalar1) { 1610 if (scale > SK_Scalar1) {
1603 radius = SkScalarMul(radius, scale); 1611 radius = SkScalarMul(radius, scale);
1604 } 1612 }
1605 } 1613 }
1606 fBounds.outset(radius, radius); 1614 fBounds.outset(radius, radius);
1607 } 1615 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 bool result = viewMatrix.invert(&vmi); 1662 bool result = viewMatrix.invert(&vmi);
1655 if (!result) { 1663 if (!result) {
1656 SkFAIL("Cannot invert matrix\n"); 1664 SkFAIL("Cannot invert matrix\n");
1657 } 1665 }
1658 vmi.mapRect(&clipBounds); 1666 vmi.mapRect(&clipBounds);
1659 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random); 1667 GrStrokeInfo strokeInfo = GrTest::TestStrokeInfo(random);
1660 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl ipBounds); 1668 return TessellatingPathBatch::Create(color, path, strokeInfo, viewMatrix, cl ipBounds);
1661 } 1669 }
1662 1670
1663 #endif 1671 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698