Module: wine
Branch: master
Commit: 9331c791e87d057728c45f3ff2956c807d83f250
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9331c791e87d057728c45f3ff…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Oct 8 00:27:09 2013 +0200
wined3d: Remove the D3DSWAPEFFECT_DISCARD debug clear code.
---
dlls/wined3d/swapchain.c | 25 -------------------------
1 files changed, 0 insertions(+), 25 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 2bab9ed..73243a9 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -566,31 +566,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT
}
}
- /* This is disabled, but the code left in for debug purposes.
- *
- * Since we're allowed to modify the new back buffer on a D3DSWAPEFFECT_DISCARD flip,
- * we can clear it with some ugly color to make bad drawing visible and ease debugging.
- * The Debug runtime does the same on Windows. However, a few games do not redraw the
- * screen properly, like Max Payne 2, which leaves a few pixels undefined.
- *
- * Tests show that the content of the back buffer after a discard flip is indeed not
- * reliable, so no game can depend on the exact content. However, it resembles the
- * old contents in some way, for example by showing fragments at other locations. In
- * general, the color theme is still intact. So Max payne, which draws rather dark scenes
- * gets a dark background image. If we clear it with a bright ugly color, the game's
- * bug shows up much more than it does on Windows, and the players see single pixels
- * with wrong colors.
- * (The Max Payne bug has been confirmed on Windows with the debug runtime) */
- if (FALSE && swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_DISCARD)
- {
- static const struct wined3d_color cyan = {0.0f, 1.0f, 1.0f, 1.0f};
-
- TRACE("Clearing the color buffer with cyan color\n");
-
- wined3d_device_clear(swapchain->device, 0, NULL,
- WINED3DCLEAR_TARGET, &cyan, 1.0f, 0);
- }
-
if (!swapchain->render_to_fbo && ((swapchain->front_buffer->flags & SFLAG_INSYSMEM)
|| (back_buffer->flags & SFLAG_INSYSMEM)))
{
Module: wine
Branch: master
Commit: e4a0767e2dfd69e7b6473ec9247a39fa6e5b44c9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e4a0767e2dfd69e7b6473ec92…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Oct 8 00:27:07 2013 +0200
wined3d: Get rid of SFLAG_LOCKABLE.
---
dlls/wined3d/surface.c | 5 +++--
dlls/wined3d/wined3d_private.h | 39 +++++++++++++++++++--------------------
2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cc5a7a5..52eac16 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3476,7 +3476,7 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
++surface->resource.map_count;
- if (!(surface->flags & SFLAG_LOCKABLE))
+ if (!(surface->resource.access_flags & WINED3D_RESOURCE_ACCESS_CPU))
WARN("Trying to lock unlockable surface.\n");
/* Performance optimization: Count how often a surface is mapped, if it is
@@ -6876,7 +6876,8 @@ static HRESULT surface_init(struct wined3d_surface *surface, UINT alignment, UIN
if (flags & WINED3D_SURFACE_PIN_SYSMEM)
surface->flags |= SFLAG_PIN_SYSMEM;
if (lockable || format_id == WINED3DFMT_D16_LOCKABLE)
- surface->flags |= SFLAG_LOCKABLE;
+ surface->resource.access_flags |= WINED3D_RESOURCE_ACCESS_CPU;
+
/* I'm not sure if this qualifies as a hack or as an optimization. It
* seems reasonable to assume that lockable render targets will get
* locked, so we might as well set SFLAG_DYNLOCK right at surface
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c28643a..69738d5 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2298,26 +2298,25 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#define SFLAG_DISCARD 0x00000002 /* ??? */
#define SFLAG_NONPOW2 0x00000004 /* Surface sizes are not a power of 2 */
#define SFLAG_NORMCOORD 0x00000008 /* Set if GL texture coordinates are normalized (non-texture rectangle). */
-#define SFLAG_LOCKABLE 0x00000010 /* Surface can be locked. */
-#define SFLAG_DYNLOCK 0x00000020 /* Surface is often locked by the application. */
-#define SFLAG_PIN_SYSMEM 0x00000040 /* Keep the surface in sysmem, at the same address. */
-#define SFLAG_DCINUSE 0x00000080 /* Set between GetDC and ReleaseDC calls. */
-#define SFLAG_LOST 0x00000100 /* Surface lost flag for ddraw. */
-#define SFLAG_GLCKEY 0x00000200 /* The GL texture was created with a color key. */
-#define SFLAG_CLIENT 0x00000400 /* GL_APPLE_client_storage is used with this surface. */
-#define SFLAG_INOVERLAYDRAW 0x00000800 /* Overlay drawing is in progress. Recursion prevention. */
-#define SFLAG_DIBSECTION 0x00001000 /* Has a DIB section attached for GetDC. */
-#define SFLAG_USERPTR 0x00002000 /* The application allocated the memory for this surface. */
-#define SFLAG_ALLOCATED 0x00004000 /* A GL texture is allocated for this surface. */
-#define SFLAG_SRGBALLOCATED 0x00008000 /* A sRGB GL texture is allocated for this surface. */
-#define SFLAG_PBO 0x00010000 /* The surface has a PBO. */
-#define SFLAG_INSYSMEM 0x00020000 /* The system memory copy is current. */
-#define SFLAG_INTEXTURE 0x00040000 /* The GL texture is current. */
-#define SFLAG_INSRGBTEX 0x00080000 /* The GL sRGB texture is current. */
-#define SFLAG_INDRAWABLE 0x00100000 /* The GL drawable is current. */
-#define SFLAG_INRB_MULTISAMPLE 0x00200000 /* The multisample renderbuffer is current. */
-#define SFLAG_INRB_RESOLVED 0x00400000 /* The resolved renderbuffer is current. */
-#define SFLAG_DISCARDED 0x00800000 /* Surface was discarded, allocating new location is enough. */
+#define SFLAG_DYNLOCK 0x00000010 /* Surface is often locked by the application. */
+#define SFLAG_PIN_SYSMEM 0x00000020 /* Keep the surface in sysmem, at the same address. */
+#define SFLAG_DCINUSE 0x00000040 /* Set between GetDC and ReleaseDC calls. */
+#define SFLAG_LOST 0x00000080 /* Surface lost flag for ddraw. */
+#define SFLAG_GLCKEY 0x00000100 /* The GL texture was created with a color key. */
+#define SFLAG_CLIENT 0x00000200 /* GL_APPLE_client_storage is used with this surface. */
+#define SFLAG_INOVERLAYDRAW 0x00000400 /* Overlay drawing is in progress. Recursion prevention. */
+#define SFLAG_DIBSECTION 0x00000800 /* Has a DIB section attached for GetDC. */
+#define SFLAG_USERPTR 0x00001000 /* The application allocated the memory for this surface. */
+#define SFLAG_ALLOCATED 0x00002000 /* A GL texture is allocated for this surface. */
+#define SFLAG_SRGBALLOCATED 0x00004000 /* A sRGB GL texture is allocated for this surface. */
+#define SFLAG_PBO 0x00008000 /* The surface has a PBO. */
+#define SFLAG_INSYSMEM 0x00010000 /* The system memory copy is current. */
+#define SFLAG_INTEXTURE 0x00020000 /* The GL texture is current. */
+#define SFLAG_INSRGBTEX 0x00040000 /* The GL sRGB texture is current. */
+#define SFLAG_INDRAWABLE 0x00080000 /* The GL drawable is current. */
+#define SFLAG_INRB_MULTISAMPLE 0x00100000 /* The multisample renderbuffer is current. */
+#define SFLAG_INRB_RESOLVED 0x00200000 /* The resolved renderbuffer is current. */
+#define SFLAG_DISCARDED 0x00400000 /* Surface was discarded, allocating new location is enough. */
/* In some conditions the surface memory must not be freed:
* SFLAG_CONVERTED: Converting the data back would take too long
Module: wine
Branch: master
Commit: dd59ab26fe83176f71979f624490a682bb22cb16
URL: http://source.winehq.org/git/wine.git/?a=commit;h=dd59ab26fe83176f71979f624…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Tue Oct 8 02:21:24 2013 -0500
winemac: Only update window minimized state when it has changed from what processed events told us it was.
This fixes a problem where windows could spontaneously re-minimize after
being unminimized. Cocoa would see the window unminimize. It would queue
a WINDOW_DID_UNMINIMIZE event. While that event was pending, Wine might do
something which caused set_cocoa_window_properties() to be called and tell
Cocoa to conform itself to the current Win32 state. The current Win32 state
still had the window minimized, so Cocoa would re-minimize the window. It
would even discard the WINDOW_DID_UNMINIMIZE event.
---
dlls/winemac.drv/cocoa_window.m | 33 ++++++++++++++++++---------------
dlls/winemac.drv/macdrv_cocoa.h | 1 +
dlls/winemac.drv/window.c | 4 +++-
3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 0726964..ede86d5 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -685,23 +685,26 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
}
[self setCollectionBehavior:behavior];
- pendingMinimize = FALSE;
- if (state->minimized && ![self isMiniaturized])
+ if (state->minimized_valid)
{
- if ([self isVisible])
- [super miniaturize:nil];
- else
- pendingMinimize = TRUE;
- }
- else if (!state->minimized && [self isMiniaturized])
- {
- ignore_windowDeminiaturize = TRUE;
- [self deminiaturize:nil];
- }
+ pendingMinimize = FALSE;
+ if (state->minimized && ![self isMiniaturized])
+ {
+ if ([self isVisible])
+ [super miniaturize:nil];
+ else
+ pendingMinimize = TRUE;
+ }
+ else if (!state->minimized && [self isMiniaturized])
+ {
+ ignore_windowDeminiaturize = TRUE;
+ [self deminiaturize:nil];
+ }
- /* Whatever events regarding minimization might have been in the queue are now stale. */
- [queue discardEventsMatchingMask:event_mask_for_type(WINDOW_DID_UNMINIMIZE)
- forWindow:self];
+ /* Whatever events regarding minimization might have been in the queue are now stale. */
+ [queue discardEventsMatchingMask:event_mask_for_type(WINDOW_DID_UNMINIMIZE)
+ forWindow:self];
+ }
}
- (BOOL) addChildWineWindow:(WineWindow*)child assumeVisible:(BOOL)assumeVisible
diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h
index 789e46d..63f537e 100644
--- a/dlls/winemac.drv/macdrv_cocoa.h
+++ b/dlls/winemac.drv/macdrv_cocoa.h
@@ -362,6 +362,7 @@ struct macdrv_window_state {
unsigned int excluded_by_expose:1;
unsigned int excluded_by_cycle:1;
unsigned int minimized:1;
+ unsigned int minimized_valid:1;
};
extern macdrv_window macdrv_create_cocoa_window(const struct macdrv_window_features* wf,
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
index 2c71a1e..efd63d1 100644
--- a/dlls/winemac.drv/window.c
+++ b/dlls/winemac.drv/window.c
@@ -115,6 +115,7 @@ static void get_cocoa_window_state(struct macdrv_win_data *data,
if (IsRectEmpty(&data->window_rect))
state->excluded_by_expose = TRUE;
state->minimized = (style & WS_MINIMIZE) != 0;
+ state->minimized_valid = state->minimized != data->minimized;
}
@@ -312,7 +313,8 @@ static void set_cocoa_window_properties(struct macdrv_win_data *data)
get_cocoa_window_state(data, style, ex_style, &state);
macdrv_set_cocoa_window_state(data->cocoa_window, &state);
- data->minimized = state.minimized;
+ if (state.minimized_valid)
+ data->minimized = state.minimized;
}