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

Side by Side Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 15465005: Reland path bounds change with correct bounds for convex and hairline path renderers. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tighter tolerances Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/gpu/GrAAHairLinePathRenderer.h » ('j') | src/gpu/GrAAHairLinePathRenderer.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 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 "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 10
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if (!arg.succeeded()) { 653 if (!arg.succeeded()) {
654 return false; 654 return false;
655 } 655 }
656 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize()); 656 GrAssert(sizeof(QuadVertex) == drawState->getVertexSize());
657 verts = reinterpret_cast<QuadVertex*>(arg.vertices()); 657 verts = reinterpret_cast<QuadVertex*>(arg.vertices());
658 idxs = reinterpret_cast<uint16_t*>(arg.indices()); 658 idxs = reinterpret_cast<uint16_t*>(arg.indices());
659 659
660 SkSTArray<kPreallocDrawCnt, Draw, true> draws; 660 SkSTArray<kPreallocDrawCnt, Draw, true> draws;
661 create_vertices(segments, fanPt, &draws, verts, idxs); 661 create_vertices(segments, fanPt, &draws, verts, idxs);
662 662
663 // This is valid because all the computed verts are within 1 pixel of the pa th control points.
664 SkRect devBounds;
665 devBounds = origPath.getBounds();
666 adcd.getOriginalMatrix().mapRect(&devBounds);
667 devBounds.outset(SK_Scalar1, SK_Scalar1);
668
669 // Check devBounds
670 #if GR_DEBUG
671 SkRect tolDevBounds = devBounds;
672 tolDevBounds.outset(SK_Scalar1 / 10000, SK_Scalar1 / 10000);
673 SkRect actualBounds;
674 actualBounds.set(verts[0].fPos, verts[1].fPos);
675 for (int i = 2; i < vCount; ++i) {
676 actualBounds.growToInclude(verts[i].fPos.fX, verts[i].fPos.fY);
677 }
678 GrAssert(tolDevBounds.contains(actualBounds));
679 #endif
680
663 int vOffset = 0; 681 int vOffset = 0;
664 for (int i = 0; i < draws.count(); ++i) { 682 for (int i = 0; i < draws.count(); ++i) {
665 const Draw& draw = draws[i]; 683 const Draw& draw = draws[i];
666 target->drawIndexed(kTriangles_GrPrimitiveType, 684 target->drawIndexed(kTriangles_GrPrimitiveType,
667 vOffset, // start vertex 685 vOffset, // start vertex
668 0, // start index 686 0, // start index
669 draw.fVertexCnt, 687 draw.fVertexCnt,
670 draw.fIndexCnt); 688 draw.fIndexCnt,
689 &devBounds);
671 vOffset += draw.fVertexCnt; 690 vOffset += draw.fVertexCnt;
672 } 691 }
673 692
674 return true; 693 return true;
675 } 694 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrAAHairLinePathRenderer.h » ('j') | src/gpu/GrAAHairLinePathRenderer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698