update tests for blitrow
git-svn-id: http://skia.googlecode.com/svn/trunk@524 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
78cd10529b
commit
1db89dc9a5
@ -117,6 +117,9 @@ static void TestBlitRow(skiatest::Reporter* reporter) {
|
||||
{ 0xFFFFFFFF, 0xFFFFFFFF, SkPackARGB32(0xFF, 0xFF, 0xFF, 0xFF), 0xFFFF, 0xFF },
|
||||
};
|
||||
|
||||
SkPaint paint;
|
||||
paint.setDither(true);
|
||||
|
||||
SkBitmap srcBM;
|
||||
srcBM.setConfig(SkBitmap::kARGB_8888_Config, W, 1);
|
||||
srcBM.allocPixels();
|
||||
@ -131,10 +134,21 @@ static void TestBlitRow(skiatest::Reporter* reporter) {
|
||||
srcBM.eraseColor(gSrcRec[j].fSrc);
|
||||
dstBM.eraseColor(gSrcRec[j].fDst);
|
||||
|
||||
canvas.drawBitmap(srcBM, 0, 0, NULL);
|
||||
if (!check_color(dstBM, gSrcRec[j].fResult32, gSrcRec[j].fResult16,
|
||||
gSrcRec[j].fResult8, reporter)) {
|
||||
SkDebugf("--- src index %d\n", j);
|
||||
for (int k = 0; k < 4; k++) {
|
||||
bool dither = (k & 1) != 0;
|
||||
bool blend = (k & 2) != 0;
|
||||
if (gSrcRec[j].fSrc != 0 && blend) {
|
||||
// can't make a numerical promise about blending anything
|
||||
// but 0
|
||||
continue;
|
||||
}
|
||||
paint.setDither(dither);
|
||||
paint.setAlpha(blend ? 0x80 : 0xFF);
|
||||
canvas.drawBitmap(srcBM, 0, 0, &paint);
|
||||
if (!check_color(dstBM, gSrcRec[j].fResult32, gSrcRec[j].fResult16,
|
||||
gSrcRec[j].fResult8, reporter)) {
|
||||
SkDebugf("--- src index %d dither %d blend %d\n", j, dither, blend);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,4 @@ SOURCE := \
|
||||
PathMeasureTest.cpp \
|
||||
TriangulationTest.cpp \
|
||||
TestSize.cpp \
|
||||
testmain.cpp
|
||||
skia_test.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user