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

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

Issue 2035843002: Adjust tolerance for when Ganesh stroked-line-as-rect optimization kicks in (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 const SkPaint& paint, const SkMatrix* prePathMatrix, 750 const SkPaint& paint, const SkMatrix* prePathMatrix,
751 bool pathIsMutable) { 751 bool pathIsMutable) {
752 ASSERT_SINGLE_OWNER 752 ASSERT_SINGLE_OWNER
753 if (!origSrcPath.isInverseFillType() && !paint.getPathEffect() && !prePathMa trix) { 753 if (!origSrcPath.isInverseFillType() && !paint.getPathEffect() && !prePathMa trix) {
754 SkPoint points[2]; 754 SkPoint points[2];
755 if (SkPaint::kStroke_Style == paint.getStyle() && paint.getStrokeWidth() > 0 && 755 if (SkPaint::kStroke_Style == paint.getStyle() && paint.getStrokeWidth() > 0 &&
756 !paint.getMaskFilter() && SkPaint::kRound_Cap != paint.getStrokeCap( ) && 756 !paint.getMaskFilter() && SkPaint::kRound_Cap != paint.getStrokeCap( ) &&
757 draw.fMatrix->preservesRightAngles() && origSrcPath.isLine(points)) { 757 draw.fMatrix->preservesRightAngles() && origSrcPath.isLine(points)) {
758 // Path-based stroking looks better for thin rects 758 // Path-based stroking looks better for thin rects
759 SkScalar strokeWidth = draw.fMatrix->getMaxScale() * paint.getStroke Width(); 759 SkScalar strokeWidth = draw.fMatrix->getMaxScale() * paint.getStroke Width();
760 if (strokeWidth > 0.9f) { 760 if (strokeWidth >= 1.0f) {
761 // Round capping support is currently disabled b.c. it would req uire 761 // Round capping support is currently disabled b.c. it would req uire
762 // a RRect batch that takes a localMatrix. 762 // a RRect batch that takes a localMatrix.
763 this->drawStrokedLine(points, draw, paint); 763 this->drawStrokedLine(points, draw, paint);
764 return; 764 return;
765 } 765 }
766 } 766 }
767 bool isClosed; 767 bool isClosed;
768 SkRect rect; 768 SkRect rect;
769 if (origSrcPath.isRect(&rect, &isClosed) && isClosed) { 769 if (origSrcPath.isRect(&rect, &isClosed) && isClosed) {
770 this->drawRect(draw, rect, paint); 770 this->drawRect(draw, rect, paint);
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 } 1923 }
1924 1924
1925 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { 1925 SkImageFilterCache* SkGpuDevice::getImageFilterCache() {
1926 ASSERT_SINGLE_OWNER 1926 ASSERT_SINGLE_OWNER
1927 // We always return a transient cache, so it is freed after each 1927 // We always return a transient cache, so it is freed after each
1928 // filter traversal. 1928 // filter traversal.
1929 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); 1929 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize);
1930 } 1930 }
1931 1931
1932 #endif 1932 #endif
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