On 16 September 2018 at 20:21, Nikolay Sivov nsivov@codeweavers.com wrote:
- switch (mode)
- {
- case D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR:
- case D2D1_BITMAP_INTERPOLATION_MODE_LINEAR:
break;
- default:
WARN("Unknown interpolation mode %#x.\n", mode);
return;
- }
We indent case labels in d2d1.
@@ -1242,7 +1300,7 @@ static void d2d_brush_bind_bitmap(struct d2d_brush *brush, ID3D10Device *device, { D3D10_SAMPLER_DESC sampler_desc;
if (brush->u.bitmap.interpolation_mode == D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR)
if (brush->u.bitmap.interpolation_mode == D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR) sampler_desc.Filter = D3D10_FILTER_MIN_MAG_MIP_POINT; else sampler_desc.Filter = D3D10_FILTER_MIN_MAG_MIP_LINEAR;
I think it would be helpful to print a FIXME for unimplemented interpolation modes. Either here, or in SetInterpolationMode1().
ID2D1BitmapBrush1_SetInterpolationMode1(brush1, D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC);
interpolation_mode = ID2D1BitmapBrush1_GetInterpolationMode(brush1);
ok(interpolation_mode == D2D1_BITMAP_INTERPOLATION_MODE_LINEAR,
"Unexpected interpolation mode %#x.\n", interpolation_mode);
interpolation_mode1 = ID2D1BitmapBrush1_GetInterpolationMode1(brush1);
ok(interpolation_mode1 == D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC,
"Unexpected interpolation mode %#x.\n", interpolation_mode1);
ID2D1BitmapBrush1_SetInterpolationMode1(brush1, 100);
interpolation_mode1 = ID2D1BitmapBrush1_GetInterpolationMode1(brush1);
ok(interpolation_mode1 == D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC,
"Unexpected interpolation mode %#x.\n", interpolation_mode1);
I think the choice of interpolation modes and ordering of these is a little unfortunate. It's not clear from the test whether "SetInterpolationMode1(..., 100);" is ignored as you'd expect, or clamped to D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC.