[PATCH 3/4] d2d1: Implement SetTarget() for bitmap targets.

Henri Verbeet hverbeet at gmail.com
Wed Sep 26 12:48:42 CDT 2018


On 26 September 2018 at 04:04, Nikolay Sivov <nsivov at codeweavers.com> wrote:
> @@ -136,7 +136,6 @@ struct d2d_device_context
>      ID2D1Factory *factory;
>      ID2D1Device *device;
>      ID3D10Device *d3d_device;
> -    ID3D10RenderTargetView *view;
>      ID3D10StateBlock *stateblock;
>      struct d2d_shape_resources shape_resources[D2D_SHAPE_TYPE_COUNT];
>      ID3D10PixelShader *ps;
> @@ -146,6 +145,19 @@ struct d2d_device_context
>      ID3D10RasterizerState *rs;
>      ID3D10BlendState *bs;
>
> +    struct
> +    {
> +        union
> +        {
> +            ID2D1Image *image;
> +            struct
> +            {
> +                ID2D1Bitmap *bitmap;
> +                ID3D10RenderTargetView *view;
> +            } bitmap;
> +        } u;
> +    } target;
I don't think you need a separate view field if you have a bitmap. I
think the rendertarget view should be stored in the d2d_bitmap
structure. I.e., the same way the shader resource view is part of that
structure.

I also don't think you need that union in this patch. Depending on
where we go with this in the future we may want it at some later
point, but I think that's a separate change from implementing
SetTarget() for bitmap targets.

I.e., for this patch, I think just replacing "ID3D10RenderTargetView
*view;" with "struct d2d_bitmap *target;" should be enough.



More information about the wine-devel mailing list