Commit c8f758a0 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d2d1: Implement d2d_factory_CreateWicBitmapRenderTarget().

parent 81097744
...@@ -6,6 +6,7 @@ C_SRCS = \ ...@@ -6,6 +6,7 @@ C_SRCS = \
brush.c \ brush.c \
factory.c \ factory.c \
render_target.c \ render_target.c \
stroke.c stroke.c \
wic_render_target.c
RC_SRCS = version.rc RC_SRCS = version.rc
...@@ -58,6 +58,24 @@ struct d2d_d3d_render_target ...@@ -58,6 +58,24 @@ struct d2d_d3d_render_target
HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory, HRESULT d2d_d3d_render_target_init(struct d2d_d3d_render_target *render_target, ID2D1Factory *factory,
IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN; IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN;
struct d2d_wic_render_target
{
ID2D1RenderTarget ID2D1RenderTarget_iface;
LONG refcount;
IDXGISurface *dxgi_surface;
ID2D1RenderTarget *dxgi_target;
ID3D10Texture2D *readback_texture;
IWICBitmap *bitmap;
unsigned int width;
unsigned int height;
unsigned int bpp;
};
HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target, ID2D1Factory *factory,
IWICBitmap *bitmap, const D2D1_RENDER_TARGET_PROPERTIES *desc) DECLSPEC_HIDDEN;
struct d2d_gradient struct d2d_gradient
{ {
ID2D1GradientStopCollection ID2D1GradientStopCollection_iface; ID2D1GradientStopCollection ID2D1GradientStopCollection_iface;
......
...@@ -173,9 +173,25 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factor ...@@ -173,9 +173,25 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factor
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Factory *iface, static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Factory *iface,
IWICBitmap *target, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target) IWICBitmap *target, const D2D1_RENDER_TARGET_PROPERTIES *desc, ID2D1RenderTarget **render_target)
{ {
FIXME("iface %p, target %p, desc %p, render_target %p stub!\n", iface, target, desc, render_target); struct d2d_wic_render_target *object;
HRESULT hr;
return E_NOTIMPL; TRACE("iface %p, target %p, desc %p, render_target %p.\n", iface, target, desc, render_target);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_wic_render_target_init(object, iface, target, desc)))
{
WARN("Failed to initialize render target, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
return hr;
}
TRACE("Created render target %p.\n", object);
*render_target = &object->ID2D1RenderTarget_iface;
return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory *iface, static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory *iface,
......
...@@ -196,6 +196,7 @@ SRCDIR_INCLUDES = \ ...@@ -196,6 +196,7 @@ SRCDIR_INCLUDES = \
custcntl.h \ custcntl.h \
cvconst.h \ cvconst.h \
d2dbasetypes.h \ d2dbasetypes.h \
d2derr.h \
d3d.h \ d3d.h \
d3d10_1shader.h \ d3d10_1shader.h \
d3d10effect.h \ d3d10effect.h \
......
...@@ -20,6 +20,7 @@ import "unknwn.idl"; ...@@ -20,6 +20,7 @@ import "unknwn.idl";
import "dcommon.h"; import "dcommon.h";
import "d2dbasetypes.h"; import "d2dbasetypes.h";
import "d3d10_1.idl"; import "d3d10_1.idl";
import "d2derr.h";
cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") cpp_quote("#ifdef WINE_NO_UNICODE_MACROS")
cpp_quote("#undef DrawText") cpp_quote("#undef DrawText")
......
/*
* Copyright 2014 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_D2DERR_H
#define __WINE_D2DERR_H
#define D2DERR_FILE_NOT_FOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
#define D2DERR_INSUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
#define D2DERR_UNSUPPORTED_PIXEL_FORMAT WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT
#endif /* __WINE_D2DERR_H */
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