Akihiro Sagawa : strmbase: Shift source/ destination rectangle when updating top or left property.

Alexandre Julliard julliard at winehq.org
Mon Nov 28 15:52:47 CST 2016


Module: wine
Branch: master
Commit: 69761ae71c6b5cec58b05e02a961c3d09697cc39
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=69761ae71c6b5cec58b05e02a961c3d09697cc39

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Fri Nov 25 01:10:04 2016 +0900

strmbase: Shift source/destination rectangle when updating top or left property.

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/filtergraph.c | 8 ++++----
 dlls/strmbase/video.c           | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 307bba9..93fb2a0 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -134,14 +134,14 @@ static void test_basic_video(void)
     hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height);
     ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
     ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left);
-    todo_wine ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width);
+    ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width);
 
     hr = IBasicVideo_put_SourceTop(pbv, video_height/3);
     ok(hr==S_OK, "Cannot put source top returned: %x\n", hr);
     hr = IBasicVideo_GetSourcePosition(pbv, &left, &top, &width, &height);
     ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
     ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top);
-    todo_wine ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height);
+    ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height);
 
     hr = IBasicVideo_put_SourceWidth(pbv, video_width/4+1);
     ok(hr==S_OK, "Cannot put source width returned: %x\n", hr);
@@ -222,14 +222,14 @@ static void test_basic_video(void)
     hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height);
     ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
     ok(left == video_width/3, "expected %d, got %d\n", video_width/3, left);
-    todo_wine ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width);
+    ok(width == video_width/3+1, "expected %d, got %d\n", video_width/3+1, width);
 
     hr = IBasicVideo_put_DestinationTop(pbv, video_height/3);
     ok(hr==S_OK, "Cannot put destination top returned: %x\n", hr);
     hr = IBasicVideo_GetDestinationPosition(pbv, &left, &top, &width, &height);
     ok(hr == S_OK, "Cannot get source position returned: %x\n", hr);
     ok(top == video_height/3, "expected %d, got %d\n", video_height/3, top);
-    todo_wine ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height);
+    ok(height == video_height/3+1, "expected %d, got %d\n", video_height/3+1, height);
 
     hr = IBasicVideo_put_DestinationWidth(pbv, video_width/4+1);
     ok(hr==S_OK, "Cannot put destination width returned: %x\n", hr);
diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c
index 1b8e3f3..ce7d26e 100644
--- a/dlls/strmbase/video.c
+++ b/dlls/strmbase/video.c
@@ -178,6 +178,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG Sour
 
     TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft);
     This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
+    SourceRect.right = (SourceRect.right - SourceRect.left) + SourceLeft;
     SourceRect.left = SourceLeft;
     This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
 
@@ -232,6 +233,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG Sourc
 
     TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop);
     This->pFuncsTable->pfnGetSourceRect(This, &SourceRect);
+    SourceRect.bottom = (SourceRect.bottom - SourceRect.top) + SourceTop;
     SourceRect.top = SourceTop;
     This->pFuncsTable->pfnSetSourceRect(This, &SourceRect);
 
@@ -287,6 +289,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG
 
     TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft);
     This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
+    DestRect.right = (DestRect.right - DestRect.left) + DestinationLeft;
     DestRect.left = DestinationLeft;
     This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
 
@@ -341,6 +344,7 @@ HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG
 
     TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop);
     This->pFuncsTable->pfnGetTargetRect(This, &DestRect);
+    DestRect.bottom = (DestRect.bottom - DestRect.top) + DestinationTop;
     DestRect.top = DestinationTop;
     This->pFuncsTable->pfnSetTargetRect(This, &DestRect);
 




More information about the wine-cvs mailing list