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

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: Created 6 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 | « 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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 SkScalar spare; 755 SkScalar spare;
756 { 756 {
757 SkScalar w = devRect.width() - dx; 757 SkScalar w = devRect.width() - dx;
758 SkScalar h = devRect.height() - dy; 758 SkScalar h = devRect.height() - dy;
759 spare = SkTMin(w, h); 759 spare = SkTMin(w, h);
760 } 760 }
761 761
762 SkRect devOutside(devRect); 762 SkRect devOutside(devRect);
763 devOutside.outset(rx, ry); 763 devOutside.outset(rx, ry);
764 764
765 bool miterStroke = true; 765 bool miterStroke = true;
robertphillips 2014/07/28 19:31:30 I think you comment might be better stated as: //
766 // bevel or round hairline rects show the same as miter haireline rects.
766 // small miter limit means right angles show bevel... 767 // small miter limit means right angles show bevel...
767 if (stroke.getJoin() != SkPaint::kMiter_Join || stroke.getMiter() < SK_Scala rSqrt2) { 768 if ((width > 0) && (stroke.getJoin() != SkPaint::kMiter_Join ||
769 stroke.getMiter() < SK_ScalarSqrt2)) {
768 miterStroke = false; 770 miterStroke = false;
769 } 771 }
770 772
771 if (spare <= 0 && miterStroke) { 773 if (spare <= 0 && miterStroke) {
772 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), 774 this->fillAARect(gpu, target, devOutside, SkMatrix::I(),
773 devOutside, useVertexCoverage); 775 devOutside, useVertexCoverage);
774 return; 776 return;
775 } 777 }
776 778
777 SkRect devInside(devRect); 779 SkRect devInside(devRect);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ; 926 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ;
925 927
926 if (devInside.isEmpty()) { 928 if (devInside.isEmpty()) {
927 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use VertexCoverage); 929 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use VertexCoverage);
928 return; 930 return;
929 } 931 }
930 932
931 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, 933 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist,
932 devInside, useVertexCoverage, true); 934 devInside, useVertexCoverage, true);
933 } 935 }
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