зеркало из https://github.com/mozilla/moz-skia.git
Revert "Use hairline when line width <= 1.0, instead of < 1.0."
This reverts commit r538 for the moment. In order to roll Chrome to include some bug fixes, I want to land it in between this revert, and the revert revert. That way the baseline changes from the other revisions can be considered without conflating the huge number of changes due to r538. git-svn-id: http://skia.googlecode.com/svn/trunk@560 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
e932a42ddb
Коммит
6fd950ca5c
|
@ -89,20 +89,14 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
SkScalar gSizes[] = {
|
||||
static const SkScalar gSizes[] = {
|
||||
SkIntToScalar(7), 0
|
||||
};
|
||||
size_t sizes = SK_ARRAY_COUNT(gSizes);
|
||||
|
||||
if (this->hasStrokeWidth()) {
|
||||
gSizes[0] = this->getStrokeWidth();
|
||||
sizes = 1;
|
||||
}
|
||||
|
||||
SkPaint paint;
|
||||
paint.setStrokeCap(SkPaint::kRound_Cap);
|
||||
|
||||
for (size_t i = 0; i < sizes; i++) {
|
||||
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(gSizes); i++) {
|
||||
paint.setStrokeWidth(gSizes[i]);
|
||||
this->setupPaint(&paint);
|
||||
canvas->drawPoints(fMode, N * 2,
|
||||
|
@ -138,3 +132,4 @@ static BenchRegistry gRRectReg2(RRectFactory2);
|
|||
static BenchRegistry gPointsReg(PointsFactory);
|
||||
static BenchRegistry gLinesReg(LinesFactory);
|
||||
static BenchRegistry gPolygonReg(PolygonFactory);
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ SkBenchmark::SkBenchmark(void* defineDict) {
|
|||
fForceAlpha = 0xFF;
|
||||
fForceAA = true;
|
||||
fDither = SkTriState::kDefault;
|
||||
fHasStrokeWidth = false;
|
||||
}
|
||||
|
||||
const char* SkBenchmark::getName() {
|
||||
|
|
|
@ -42,19 +42,6 @@ public:
|
|||
fDither = state;
|
||||
}
|
||||
|
||||
void setStrokeWidth(SkScalar width) {
|
||||
strokeWidth = width;
|
||||
fHasStrokeWidth = true;
|
||||
}
|
||||
|
||||
SkScalar getStrokeWidth() {
|
||||
return strokeWidth;
|
||||
}
|
||||
|
||||
bool hasStrokeWidth() {
|
||||
return fHasStrokeWidth;
|
||||
}
|
||||
|
||||
const char* findDefine(const char* key) const;
|
||||
bool findDefine32(const char* key, int32_t* value) const;
|
||||
bool findDefineScalar(const char* key, SkScalar* value) const;
|
||||
|
@ -73,10 +60,9 @@ private:
|
|||
bool fForceAA;
|
||||
bool fForceFilter;
|
||||
SkTriState::State fDither;
|
||||
bool fHasStrokeWidth;
|
||||
SkScalar strokeWidth;
|
||||
};
|
||||
|
||||
typedef SkTRegistry<SkBenchmark*, void*> BenchRegistry;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -201,8 +201,6 @@ int main (int argc, char * const argv[]) {
|
|||
bool doClip = false;
|
||||
bool doPict = false;
|
||||
const char* matchStr = NULL;
|
||||
bool hasStrokeWidth = false;
|
||||
float strokeWidth;
|
||||
|
||||
SkString outDir;
|
||||
SkBitmap::Config outConfig = SkBitmap::kNo_Config;
|
||||
|
@ -262,19 +260,6 @@ int main (int argc, char * const argv[]) {
|
|||
return -1;
|
||||
}
|
||||
forceAlpha = wantAlpha ? 0x80 : 0xFF;
|
||||
} else if (strcmp(*argv, "-strokeWidth") == 0) {
|
||||
argv++;
|
||||
if (argv < stop) {
|
||||
const char *strokeWidthStr = *argv;
|
||||
if (sscanf(strokeWidthStr, "%f", &strokeWidth) != 1) {
|
||||
log_error("bad arg for -strokeWidth\n");
|
||||
return -1;
|
||||
}
|
||||
hasStrokeWidth = true;
|
||||
} else {
|
||||
log_error("missing arg for -strokeWidth\n");
|
||||
return -1;
|
||||
}
|
||||
} else if (strcmp(*argv, "-match") == 0) {
|
||||
argv++;
|
||||
if (argv < stop) {
|
||||
|
@ -329,9 +314,6 @@ int main (int argc, char * const argv[]) {
|
|||
bench->setForceAA(forceAA);
|
||||
bench->setForceFilter(forceFilter);
|
||||
bench->setDither(forceDither);
|
||||
if (hasStrokeWidth) {
|
||||
bench->setStrokeWidth(strokeWidth);
|
||||
}
|
||||
|
||||
// only run benchmarks if their name contains matchStr
|
||||
if (matchStr && strstr(bench->getName(), matchStr) == NULL) {
|
||||
|
|
|
@ -789,7 +789,7 @@ static bool map_radius(const SkMatrix& matrix, SkScalar* value) {
|
|||
matrix.mapVectors(dst, src, 2);
|
||||
SkScalar len0 = fast_len(dst[0]);
|
||||
SkScalar len1 = fast_len(dst[1]);
|
||||
if (len0 <= SK_Scalar1 && len1 <= SK_Scalar1) {
|
||||
if (len0 < SK_Scalar1 && len1 < SK_Scalar1) {
|
||||
*value = SkScalarAve(len0, len1);
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче