Commit f96aab3f authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

quartz: Use SetRect instead of open coding it.

parent 0a41694b
......@@ -430,9 +430,7 @@ static RECT WINAPI VideoRenderer_GetDefaultRect(BaseWindow *iface)
VideoRendererImpl *This = impl_from_BaseWindow(iface);
static RECT defRect;
defRect.left = defRect.top = 0;
defRect.right = This->VideoWidth;
defRect.bottom = This->VideoHeight;
SetRect(&defRect, 0, 0, This->VideoWidth, This->VideoHeight);
return defRect;
}
......@@ -596,10 +594,7 @@ static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect(BaseControlVideo* iface
{
VideoRendererImpl *This = impl_from_BaseControlVideo(iface);
This->SourceRect.left = 0;
This->SourceRect.top = 0;
This->SourceRect.right = This->VideoWidth;
This->SourceRect.bottom = This->VideoHeight;
SetRect(&This->SourceRect, 0, 0, This->VideoWidth, This->VideoHeight);
return S_OK;
}
......@@ -612,10 +607,7 @@ static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect(BaseControlVideo* iface
if (!GetClientRect(This->baseControlWindow.baseWindow.hWnd, &rect))
return E_FAIL;
This->DestRect.left = 0;
This->DestRect.top = 0;
This->DestRect.right = rect.right;
This->DestRect.bottom = rect.bottom;
SetRect(&This->DestRect, 0, 0, rect.right, rect.bottom);
return S_OK;
}
......
......@@ -353,9 +353,9 @@ static HRESULT WINAPI VMR9_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TY
This->bmiheader = format->bmiHeader;
TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight);
This->source_rect.right = This->VideoWidth = format->bmiHeader.biWidth;
This->source_rect.bottom = This->VideoHeight = format->bmiHeader.biHeight;
This->source_rect.top = This->source_rect.left = 0;
This->VideoWidth = format->bmiHeader.biWidth;
This->VideoHeight = format->bmiHeader.biHeight;
SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight);
}
else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
{
......@@ -364,9 +364,9 @@ static HRESULT WINAPI VMR9_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TY
This->bmiheader = format->bmiHeader;
TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight);
This->source_rect.right = This->VideoWidth = format->bmiHeader.biWidth;
This->source_rect.bottom = This->VideoHeight = format->bmiHeader.biHeight;
This->source_rect.top = This->source_rect.left = 0;
This->VideoWidth = format->bmiHeader.biWidth;
This->VideoHeight = format->bmiHeader.biHeight;
SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight);
}
else
{
......@@ -426,9 +426,7 @@ static HRESULT VMR9_maybe_init(struct quartz_vmr *This, BOOL force)
hr = IVMRSurfaceAllocatorEx9_InitializeDevice(This->allocator, This->cookie, &info, &buffers);
if (SUCCEEDED(hr))
{
This->source_rect.left = This->source_rect.top = 0;
This->source_rect.right = This->bmiheader.biWidth;
This->source_rect.bottom = This->bmiheader.biHeight;
SetRect(&This->source_rect, 0, 0, This->bmiheader.biWidth, This->bmiheader.biHeight);
This->num_surfaces = buffers;
}
......@@ -544,9 +542,7 @@ static RECT WINAPI VMR9_GetDefaultRect(BaseWindow *This)
struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This);
static RECT defRect;
defRect.left = defRect.top = 0;
defRect.right = pVMR9->VideoWidth;
defRect.bottom = pVMR9->VideoHeight;
SetRect(&defRect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight);
return defRect;
}
......@@ -688,10 +684,7 @@ static HRESULT WINAPI VMR9_SetDefaultSourceRect(BaseControlVideo* This)
{
struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This);
pVMR9->source_rect.left = 0;
pVMR9->source_rect.top = 0;
pVMR9->source_rect.right = pVMR9->VideoWidth;
pVMR9->source_rect.bottom = pVMR9->VideoHeight;
SetRect(&pVMR9->source_rect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight);
return S_OK;
}
......@@ -704,10 +697,7 @@ static HRESULT WINAPI VMR9_SetDefaultTargetRect(BaseControlVideo* This)
if (!GetClientRect(pVMR9->baseControlWindow.baseWindow.hWnd, &rect))
return E_FAIL;
pVMR9->target_rect.left = 0;
pVMR9->target_rect.top = 0;
pVMR9->target_rect.right = rect.right;
pVMR9->target_rect.bottom = rect.bottom;
SetRect(&pVMR9->target_rect, 0, 0, rect.right, rect.bottom);
return S_OK;
}
......
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