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

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

Issue 417113002: round and bevel hairline rects show the same as miter hairline rects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment Created 6 years, 4 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 | « no previous file | 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 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 "GrAARectRenderer.h" 8 #include "GrAARectRenderer.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "gl/GrGLEffect.h" 10 #include "gl/GrGLEffect.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 { 752 {
753 SkScalar w = devRect.width() - dx; 753 SkScalar w = devRect.width() - dx;
754 SkScalar h = devRect.height() - dy; 754 SkScalar h = devRect.height() - dy;
755 spare = SkTMin(w, h); 755 spare = SkTMin(w, h);
756 } 756 }
757 757
758 SkRect devOutside(devRect); 758 SkRect devOutside(devRect);
759 devOutside.outset(rx, ry); 759 devOutside.outset(rx, ry);
760 760
761 bool miterStroke = true; 761 bool miterStroke = true;
762 // For hairlines, make bevel and round joins appear the same as mitered ones .
762 // small miter limit means right angles show bevel... 763 // small miter limit means right angles show bevel...
763 if (stroke.getJoin() != SkPaint::kMiter_Join || stroke.getMiter() < SK_Scala rSqrt2) { 764 if ((width > 0) && (stroke.getJoin() != SkPaint::kMiter_Join ||
765 stroke.getMiter() < SK_ScalarSqrt2)) {
764 miterStroke = false; 766 miterStroke = false;
765 } 767 }
766 768
767 if (spare <= 0 && miterStroke) { 769 if (spare <= 0 && miterStroke) {
768 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), 770 this->fillAARect(gpu, target, devOutside, SkMatrix::I(),
769 devOutside, useVertexCoverage); 771 devOutside, useVertexCoverage);
770 return; 772 return;
771 } 773 }
772 774
773 SkRect devInside(devRect); 775 SkRect devInside(devRect);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ; 922 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ;
921 923
922 if (devInside.isEmpty()) { 924 if (devInside.isEmpty()) {
923 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use VertexCoverage); 925 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use VertexCoverage);
924 return; 926 return;
925 } 927 }
926 928
927 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, 929 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist,
928 devInside, useVertexCoverage, true); 930 devInside, useVertexCoverage, true);
929 } 931 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698