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/core/SkDraw.cpp

Issue 1491843006: add support for capped hairlines (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warning Created 5 years 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
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #define __STDC_LIMIT_MACROS 7 #define __STDC_LIMIT_MACROS
8 8
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 1125
1126 void (*proc)(const SkPath&, const SkRasterClip&, SkBlitter*); 1126 void (*proc)(const SkPath&, const SkRasterClip&, SkBlitter*);
1127 if (doFill) { 1127 if (doFill) {
1128 if (paint->isAntiAlias()) { 1128 if (paint->isAntiAlias()) {
1129 proc = SkScan::AntiFillPath; 1129 proc = SkScan::AntiFillPath;
1130 } else { 1130 } else {
1131 proc = SkScan::FillPath; 1131 proc = SkScan::FillPath;
1132 } 1132 }
1133 } else { // hairline 1133 } else { // hairline
1134 if (paint->isAntiAlias()) { 1134 if (paint->isAntiAlias()) {
1135 if (SkPaint::kButt_Cap == paint->getStrokeCap()) {
1136 proc = SkScan::AntiHairPath;
1137 } else {
1138 proc = SkScan::AntiHairCapPath;
1139 }
1140 #ifdef SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS
1135 proc = SkScan::AntiHairPath; 1141 proc = SkScan::AntiHairPath;
1142 #endif
1136 } else { 1143 } else {
1137 proc = SkScan::HairPath; 1144 if (SkPaint::kButt_Cap == paint->getStrokeCap()) {
1145 proc = SkScan::HairPath;
1146 } else {
1147 proc = SkScan::HairCapPath;
1148 }
1149 #ifdef SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS
1150 proc = SkScan::AntiHairPath;
1151 #endif
1138 } 1152 }
1139 } 1153 }
1140 proc(*devPathPtr, *fRC, blitter); 1154 proc(*devPathPtr, *fRC, blitter);
1141 } 1155 }
1142 1156
1143 /** For the purposes of drawing bitmaps, if a matrix is "almost" translate 1157 /** For the purposes of drawing bitmaps, if a matrix is "almost" translate
1144 go ahead and treat it as if it were, so that subsequent code can go fast. 1158 go ahead and treat it as if it were, so that subsequent code can go fast.
1145 */ 1159 */
1146 static bool just_translate(const SkMatrix& matrix, const SkBitmap& bitmap) { 1160 static bool just_translate(const SkMatrix& matrix, const SkBitmap& bitmap) {
1147 unsigned bits = 0; // TODO: find a way to allow the caller to tell us to 1161 unsigned bits = 0; // TODO: find a way to allow the caller to tell us to
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 mask->fImage = SkMask::AllocImage(size); 2123 mask->fImage = SkMask::AllocImage(size);
2110 memset(mask->fImage, 0, mask->computeImageSize()); 2124 memset(mask->fImage, 0, mask->computeImageSize());
2111 } 2125 }
2112 2126
2113 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2127 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2114 draw_into_mask(*mask, devPath, style); 2128 draw_into_mask(*mask, devPath, style);
2115 } 2129 }
2116 2130
2117 return true; 2131 return true;
2118 } 2132 }
OLDNEW
« gm/hairlines.cpp ('K') | « gm/hairlines.cpp ('k') | src/core/SkScan.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698