Circle/ellipse should be appended as a closed sub-path and the current point after the operation should be moved to "the rightmost point" of the figure ((x+r,y) and (x+w,y+h/2) respectively).
See #17520
When current endpoint is moved to a new position with MoveToPoint() then current sub-path should be ended without closing the figure (no line from the current point to the beginning of the sub-path should be added).
Closes#17516
This is for the sake of consistency because everywhere else there are used trigonometric functions from standard C library (only <math.h> is included).
When render target to draw to a DC (created with ID2D1Factory::CreateDCRenderTarget method) is bound to the device context with ID2D1DCRenderTarget::BindDC method then the size of the area of drawing has to be a logical size of a DC (with its scaling factor taken int account). This can be determined directly using GetClipBox API and there is no need to pass it as a parameter of wxD2DDCRenderTargetResourceHolder ctor.
Closes#17504.
Determine actual size of wxD2DContext instance and initialize respective data members to report proper size of wxGraphicsContext created by wxGraphicsRenderer::CreateContextFromNativeContext / CreateContextFromNativeWindow.
Closes#17502.
32bpp wxBitmaps selected into wxMemoryDC can represent either 0RGB or ARGB bitmaps and hence there is necessary to instruct renderer how to interpret 32bpp contents while creating a wxGraphicsContext. wxBitmap::HasAlpha() flag is used for these purposes and its value is passed to wxD2DContext ctor (wxD2DContext is used internally as a backend D2D component) and next used to configure physical renderer created with ID2D1Factory::CreateDCRenderTarget.
Closes#17465.
Don't call GetSize() method as gcc can't handle aggregates returned by value
from D2D libraries currently and the code just crashes if this method is
called.
See #17171.
Get access to bitmap bits with IWICBitmap::Lock instead of IWICBitmapSource::CopyPixels because in-place processing is more effective in terms of speed and memory consumption (see IWICBitmap interface description in MSDN).
See #17311.
Save alpha channel retrieved from internal bitmap if target wxImage is capable to store it. Also undo premultiplication of RGB values if bitmap contains alpha channel values.
Closes#17311.
We don't and it's unclear how to do it, so just return
WINCODEC_ERR_PALETTEUNAVAILABLE instead of pretending that we copied the
palette when we didn't.
See #16625.
Include the required headers in all cases currently, ideal would be to include
them only inside "#ifndef WX_PRECOMP" but it's probably not a big problem to
just do it always.
See #16625.
This is unnecessary, COM is already initialized on the application startup and
Direct2D can't be used before that anyhow.
This also fixes lack of matching CoUninitialize() call.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ID2D1DCRenderTarget was leaked every time a wxD2DContext was created because a
raw pointer was given to wxCOMPtr<> which didn't take its ownership.
Use wxCOMPtr instead of the raw pointer to fix this and also fix more rare but
still possible leak in case of error.
This fixes out of memory errors and crashes in the drawing sample after a few
seconds of constant window resizing/repainting.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Bail out earlier: if d2d1.dll is not there, it doesn't make sense to try to
load dwrite.dll.
Also use Load() return value directly instead of ignoring it and then checking
for IsLoaded().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxDL_QUIET flag when loading Direct2D DLLs as we're prepared to handle
their absence and don't need to show error messages if they're not available.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
DirectWrite GDI interop only works with Unicode LOGFONTW, so use it explicitly
instead of LOGFONT which is LOGFONTA in non-Unicode build.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
ID2D1Image is not defined in v7.0A platform SDK used by VC10 and doesn't seem
to be needed here as we are only working with ID2D1Bitmaps (deriving from
ID2D1Image) anyhow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The line defining PI didn't compile with VC10 because atan(1) is ambiguous
(argument could be float, double or long double). And it was not needed anyhow
as PI was not used anywhere (and if it were, we should be just using M_PI from
wx/math.h anyhow), so simply remove it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775