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