зеркало из https://github.com/mozilla/moz-skia.git
Remove warnings (trailing \, signed vs unsigned, parenthesization).
Convert some tabs into spaces. git-svn-id: http://skia.googlecode.com/svn/trunk@2541 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
71dd3e0359
Коммит
83a444602e
|
@ -131,9 +131,11 @@ static void do_fuzz(SkCanvas* canvas) {
|
|||
case 2: {
|
||||
SkXfermode::Mode mode;
|
||||
switch (R(3)) {
|
||||
case 0: mode = SkXfermode::kSrc_Mode; break;
|
||||
case 0: mode = SkXfermode::kSrc_Mode; break;
|
||||
case 1: mode = SkXfermode::kXor_Mode; break;
|
||||
case 2: mode = SkXfermode::kSrcOver_Mode; break;
|
||||
case 2:
|
||||
default: // silence warning
|
||||
mode = SkXfermode::kSrcOver_Mode; break;
|
||||
}
|
||||
paint.setXfermodeMode(mode);
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ static void blit_lcd16_row(SkPMColor dst[], const uint16_t src[],
|
|||
int dstG = SkGetPackedG32(d);
|
||||
int dstB = SkGetPackedB32(d);
|
||||
|
||||
// LCD blitting is only supported if the dst is known/required\
|
||||
// LCD blitting is only supported if the dst is known/required
|
||||
// to be opaque
|
||||
dst[i] = SkPackARGB32(0xFF,
|
||||
blend32(srcR, dstR, maskR),
|
||||
|
|
|
@ -1337,9 +1337,9 @@ static void D1G_NoBounder_RectClip(const SkDraw1Glyph& state,
|
|||
int left = SkFixedFloor(fx);
|
||||
int top = SkFixedFloor(fy);
|
||||
SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0);
|
||||
SkASSERT(NULL == state.fBounder);
|
||||
SkASSERT(NULL == state.fClip && state.fAAClip ||
|
||||
state.fClip && NULL == state.fAAClip && state.fClip->isRect());
|
||||
SkASSERT(NULL == state.fBounder);
|
||||
SkASSERT((NULL == state.fClip && state.fAAClip) ||
|
||||
(state.fClip && NULL == state.fAAClip && state.fClip->isRect()));
|
||||
|
||||
left += glyph.fLeft;
|
||||
top += glyph.fTop;
|
||||
|
@ -1347,42 +1347,42 @@ static void D1G_NoBounder_RectClip(const SkDraw1Glyph& state,
|
|||
int right = left + glyph.fWidth;
|
||||
int bottom = top + glyph.fHeight;
|
||||
|
||||
SkMask mask;
|
||||
SkIRect storage;
|
||||
SkIRect* bounds = &mask.fBounds;
|
||||
SkMask mask;
|
||||
SkIRect storage;
|
||||
SkIRect* bounds = &mask.fBounds;
|
||||
|
||||
mask.fBounds.set(left, top, right, bottom);
|
||||
mask.fBounds.set(left, top, right, bottom);
|
||||
|
||||
// this extra test is worth it, assuming that most of the time it succeeds
|
||||
// since we can avoid writing to storage
|
||||
if (!state.fClipBounds.containsNoEmptyCheck(left, top, right, bottom)) {
|
||||
if (!storage.intersectNoEmptyCheck(mask.fBounds, state.fClipBounds))
|
||||
return;
|
||||
bounds = &storage;
|
||||
}
|
||||
// this extra test is worth it, assuming that most of the time it succeeds
|
||||
// since we can avoid writing to storage
|
||||
if (!state.fClipBounds.containsNoEmptyCheck(left, top, right, bottom)) {
|
||||
if (!storage.intersectNoEmptyCheck(mask.fBounds, state.fClipBounds))
|
||||
return;
|
||||
bounds = &storage;
|
||||
}
|
||||
|
||||
uint8_t* aa = (uint8_t*)glyph.fImage;
|
||||
if (NULL == aa) {
|
||||
aa = (uint8_t*)state.fCache->findImage(glyph);
|
||||
if (NULL == aa) {
|
||||
return; // can't rasterize glyph
|
||||
uint8_t* aa = (uint8_t*)glyph.fImage;
|
||||
if (NULL == aa) {
|
||||
aa = (uint8_t*)state.fCache->findImage(glyph);
|
||||
if (NULL == aa) {
|
||||
return; // can't rasterize glyph
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mask.fRowBytes = glyph.rowBytes();
|
||||
mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
|
||||
mask.fImage = aa;
|
||||
state.fBlitter->blitMask(mask, *bounds);
|
||||
mask.fRowBytes = glyph.rowBytes();
|
||||
mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
|
||||
mask.fImage = aa;
|
||||
state.fBlitter->blitMask(mask, *bounds);
|
||||
}
|
||||
|
||||
static void D1G_NoBounder_RgnClip(const SkDraw1Glyph& state,
|
||||
SkFixed fx, SkFixed fy,
|
||||
const SkGlyph& glyph) {
|
||||
const SkGlyph& glyph) {
|
||||
int left = SkFixedFloor(fx);
|
||||
int top = SkFixedFloor(fy);
|
||||
SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0);
|
||||
SkASSERT(!state.fClip->isRect());
|
||||
SkASSERT(NULL == state.fBounder);
|
||||
SkASSERT(!state.fClip->isRect());
|
||||
SkASSERT(NULL == state.fBounder);
|
||||
|
||||
SkMask mask;
|
||||
|
||||
|
@ -1390,31 +1390,31 @@ static void D1G_NoBounder_RgnClip(const SkDraw1Glyph& state,
|
|||
top += glyph.fTop;
|
||||
|
||||
mask.fBounds.set(left, top, left + glyph.fWidth, top + glyph.fHeight);
|
||||
SkRegion::Cliperator clipper(*state.fClip, mask.fBounds);
|
||||
SkRegion::Cliperator clipper(*state.fClip, mask.fBounds);
|
||||
|
||||
if (!clipper.done()) {
|
||||
const SkIRect& cr = clipper.rect();
|
||||
const uint8_t* aa = (const uint8_t*)glyph.fImage;
|
||||
if (NULL == aa) {
|
||||
aa = (uint8_t*)state.fCache->findImage(glyph);
|
||||
if (NULL == aa) {
|
||||
return;
|
||||
if (!clipper.done()) {
|
||||
const SkIRect& cr = clipper.rect();
|
||||
const uint8_t* aa = (const uint8_t*)glyph.fImage;
|
||||
if (NULL == aa) {
|
||||
aa = (uint8_t*)state.fCache->findImage(glyph);
|
||||
if (NULL == aa) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mask.fRowBytes = glyph.rowBytes();
|
||||
mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
|
||||
mask.fImage = (uint8_t*)aa;
|
||||
do {
|
||||
state.fBlitter->blitMask(mask, cr);
|
||||
clipper.next();
|
||||
} while (!clipper.done());
|
||||
}
|
||||
mask.fRowBytes = glyph.rowBytes();
|
||||
mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
|
||||
mask.fImage = (uint8_t*)aa;
|
||||
do {
|
||||
state.fBlitter->blitMask(mask, cr);
|
||||
clipper.next();
|
||||
} while (!clipper.done());
|
||||
}
|
||||
}
|
||||
|
||||
static void D1G_Bounder(const SkDraw1Glyph& state,
|
||||
SkFixed fx, SkFixed fy,
|
||||
const SkGlyph& glyph) {
|
||||
const SkGlyph& glyph) {
|
||||
int left = SkFixedFloor(fx);
|
||||
int top = SkFixedFloor(fy);
|
||||
SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0);
|
||||
|
@ -1427,30 +1427,30 @@ static void D1G_Bounder(const SkDraw1Glyph& state,
|
|||
mask.fBounds.set(left, top, left + glyph.fWidth, top + glyph.fHeight);
|
||||
SkRegion::Cliperator clipper(*state.fClip, mask.fBounds);
|
||||
|
||||
if (!clipper.done()) {
|
||||
const SkIRect& cr = clipper.rect();
|
||||
const uint8_t* aa = (const uint8_t*)glyph.fImage;
|
||||
if (NULL == aa) {
|
||||
aa = (uint8_t*)state.fCache->findImage(glyph);
|
||||
if (NULL == aa) {
|
||||
return;
|
||||
if (!clipper.done()) {
|
||||
const SkIRect& cr = clipper.rect();
|
||||
const uint8_t* aa = (const uint8_t*)glyph.fImage;
|
||||
if (NULL == aa) {
|
||||
aa = (uint8_t*)state.fCache->findImage(glyph);
|
||||
if (NULL == aa) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// we need to pass the origin, which we approximate with our
|
||||
// (unadjusted) left,top coordinates (the caller called fixedfloor)
|
||||
if (state.fBounder->doIRectGlyph(cr,
|
||||
if (state.fBounder->doIRectGlyph(cr,
|
||||
left - glyph.fLeft,
|
||||
top - glyph.fTop, glyph)) {
|
||||
mask.fRowBytes = glyph.rowBytes();
|
||||
mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
|
||||
mask.fImage = (uint8_t*)aa;
|
||||
do {
|
||||
state.fBlitter->blitMask(mask, cr);
|
||||
clipper.next();
|
||||
} while (!clipper.done());
|
||||
}
|
||||
}
|
||||
mask.fRowBytes = glyph.rowBytes();
|
||||
mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
|
||||
mask.fImage = (uint8_t*)aa;
|
||||
do {
|
||||
state.fBlitter->blitMask(mask, cr);
|
||||
clipper.next();
|
||||
} while (!clipper.done());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void D1G_Bounder_AAClip(const SkDraw1Glyph& state,
|
||||
|
|
|
@ -121,7 +121,7 @@ static void test_blur(skiatest::Reporter* reporter) {
|
|||
paint.setMaskFilter(filter);
|
||||
filter->unref();
|
||||
|
||||
for (int test = 0; test < SK_ARRAY_COUNT(tests); ++test) {
|
||||
for (size_t test = 0; test < SK_ARRAY_COUNT(tests); ++test) {
|
||||
SkPath path;
|
||||
tests[test].addPath(&path);
|
||||
SkPath strokedPath;
|
||||
|
|
|
@ -92,7 +92,7 @@ void test_matrix_max_stretch(skiatest::Reporter* reporter) {
|
|||
SkMatrix baseMats[] = {scale, rot90Scale, rotate,
|
||||
translate, perspX, perspY};
|
||||
SkMatrix mats[2*SK_ARRAY_COUNT(baseMats)];
|
||||
for (int i = 0; i < SK_ARRAY_COUNT(baseMats); ++i) {
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(baseMats); ++i) {
|
||||
mats[i] = baseMats[i];
|
||||
bool invertable = mats[i].invert(&mats[i + SK_ARRAY_COUNT(baseMats)]);
|
||||
REPORTER_ASSERT(reporter, invertable);
|
||||
|
@ -125,7 +125,7 @@ void test_matrix_max_stretch(skiatest::Reporter* reporter) {
|
|||
static const SkScalar gMaxStretchTol = (97 * SK_Scalar1) / 100;
|
||||
SkScalar max = 0;
|
||||
SkVector vectors[1000];
|
||||
for (int i = 0; i < SK_ARRAY_COUNT(vectors); ++i) {
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(vectors); ++i) {
|
||||
vectors[i].fX = rand.nextSScalar1();
|
||||
vectors[i].fY = rand.nextSScalar1();
|
||||
if (!vectors[i].normalize()) {
|
||||
|
@ -134,7 +134,7 @@ void test_matrix_max_stretch(skiatest::Reporter* reporter) {
|
|||
}
|
||||
}
|
||||
mat.mapVectors(vectors, SK_ARRAY_COUNT(vectors));
|
||||
for (int i = 0; i < SK_ARRAY_COUNT(vectors); ++i) {
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(vectors); ++i) {
|
||||
SkScalar d = vectors[i].length();
|
||||
REPORTER_ASSERT(reporter, SkScalarDiv(d, stretch) < gStretchTol);
|
||||
if (max < d) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче