Commit c9b76c3a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d2d1: Update to ID2D1BitmapBrush1.

parent aec7befb
......@@ -280,7 +280,7 @@ struct d2d_brush
struct d2d_bitmap *bitmap;
D2D1_EXTEND_MODE extend_mode_x;
D2D1_EXTEND_MODE extend_mode_y;
D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode;
D2D1_INTERPOLATION_MODE interpolation_mode;
ID3D10SamplerState *sampler_state;
} bitmap;
} u;
......
......@@ -1656,6 +1656,7 @@ static void test_bitmap_brush(void)
D2D1_RECT_F src_rect, dst_rect;
D2D1_EXTEND_MODE extend_mode;
IDXGISwapChain *swapchain;
ID2D1BitmapBrush1 *brush1;
ID2D1BitmapBrush *brush;
ID2D1RenderTarget *rt;
ID3D10Device1 *device;
......@@ -1877,6 +1878,49 @@ static void test_bitmap_brush(void)
match = compare_surface(surface, "cf7b90ba7b139fdfbe9347e1907d635cfb4ed197");
ok(match, "Surface does not match.\n");
if (SUCCEEDED(ID2D1BitmapBrush_QueryInterface(brush, &IID_ID2D1BitmapBrush1, (void **)&brush1)))
{
D2D1_INTERPOLATION_MODE interpolation_mode1;
interpolation_mode = ID2D1BitmapBrush1_GetInterpolationMode(brush1);
ok(interpolation_mode == D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
"Unexpected interpolation mode %#x.\n", interpolation_mode);
interpolation_mode1 = ID2D1BitmapBrush1_GetInterpolationMode1(brush1);
ok(interpolation_mode1 == D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
"Unexpected interpolation mode %#x.\n", interpolation_mode1);
ID2D1BitmapBrush1_SetInterpolationMode1(brush1, D2D1_INTERPOLATION_MODE_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_CUBIC,
"Unexpected interpolation mode %#x.\n", interpolation_mode1);
ID2D1BitmapBrush1_SetInterpolationMode1(brush1, 100);
interpolation_mode1 = ID2D1BitmapBrush1_GetInterpolationMode1(brush1);
ok(interpolation_mode1 == D2D1_INTERPOLATION_MODE_CUBIC,
"Unexpected interpolation mode %#x.\n", interpolation_mode1);
ID2D1BitmapBrush1_SetInterpolationMode(brush1, 100);
interpolation_mode1 = ID2D1BitmapBrush1_GetInterpolationMode1(brush1);
ok(interpolation_mode1 == D2D1_INTERPOLATION_MODE_CUBIC,
"Unexpected interpolation mode %#x.\n", interpolation_mode1);
ID2D1BitmapBrush1_SetInterpolationMode(brush1, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR);
interpolation_mode = ID2D1BitmapBrush1_GetInterpolationMode(brush1);
ok(interpolation_mode == D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
"Unexpected interpolation mode %#x.\n", interpolation_mode);
interpolation_mode1 = ID2D1BitmapBrush1_GetInterpolationMode1(brush1);
ok(interpolation_mode1 == D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
"Unexpected interpolation mode %#x.\n", interpolation_mode1);
ID2D1BitmapBrush1_Release(brush1);
}
ID2D1BitmapBrush_Release(brush);
refcount = ID2D1Bitmap_Release(bitmap);
ok(!refcount, "Bitmap has %u references left.\n", refcount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment