* Source/win32/w32_movesize.m (-decodeWM_EXITSIZEMOVEParams:::):

Remove code that caused missing windows content.
* Source/cairo/CairoContext.m (-flushGraphics): Add experimental
flush code for Windows.
* Source/cairo/Win32CairoSurface.m (-initWithDevice:, -dealloc):
Clean up HDC handling. Based on patch by Marcian Lytwyn
<marcian.lytwyn@advcsi.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36920 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2013-07-24 07:34:24 +00:00
parent 5a67ea5d8e
commit 16ac5f2219
4 changed files with 34 additions and 46 deletions

View file

@ -1,10 +1,19 @@
2013-07-24 Fred Kiefer <FredKiefer@gmx.de>
* Source/win32/w32_movesize.m (-decodeWM_EXITSIZEMOVEParams:::):
Remove code that caused missing windows content.
* Source/cairo/CairoContext.m (-flushGraphics): Add experimental
flush code for Windows.
* Source/cairo/Win32CairoSurface.m (-initWithDevice:, -dealloc):
Clean up HDC handling. Based on patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>
2013-07-24 Ivan Vucica <ivan@vucica.net>
* configure.ac:
* configure:
Opal backend depends on both Opal and CoreBase. Added
Opal backend depends on both Opal and CoreBase. Added
CoreBase to list of libraries we link with.
* Source/opal/OpalFontInfo.m:
* Source/opal/OpalFontEnumerator.m:
Switched to NSDebugLLog().
@ -16,7 +25,7 @@
-Implemented GSCurrentCTM
-Implemented flushGraphics
-Implemented DPSsavegstate and DPSrestoregstate
* Source/opal/OpalSurface.m:
-Switched to NSDebugLLog().
-Fixed section that is supposed to write out the debug image.
@ -29,11 +38,11 @@
and how the supported glyphs are determined.
* Source/opal/OpalGState.m:
Various method implementations and fixes.
Various method implementations and fixes.
* Source/opal/OpalSurface.m:
Enabled doublebuffered code path, now that Opal's endianess
problem is fixed. Creation of CGContext factored out of
problem is fixed. Creation of CGContext factored out of
initializer into a method that can be called whenever needed
to recreate the context.

View file

@ -109,6 +109,14 @@
// FIXME: Why is this here? When is it called?
#if BUILD_SERVER == SERVER_x11
XFlush([(XGServer *)server xDisplay]);
#elif BUILD_SERVER == SERVER_win32
CairoSurface *surface = nil;
[CGSTATE GSCurrentSurface: &surface : NULL : NULL];
if ((surface != nil) && ([surface surface] != NULL))
{
cairo_surface_flush([surface surface]);
}
#endif // BUILD_SERVER = SERVER_x11
}

View file

@ -82,12 +82,12 @@
// This is the raw DC surface...
cairo_surface_t *window = cairo_win32_surface_create(hDC);
cairo_status_t status = cairo_surface_status(window);
// Check for error...
if (cairo_surface_status(window) != CAIRO_STATUS_SUCCESS)
if (status != CAIRO_STATUS_SUCCESS)
{
// Output the surface create error...
cairo_status_t status = cairo_surface_status(window);
NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status));
// And deallocate ourselves...
@ -104,12 +104,12 @@
_surface = cairo_surface_create_similar(window, CAIRO_CONTENT_COLOR_ALPHA,
MAX(1, csize.width),
MAX(1, csize.height));
status = cairo_surface_status(_surface);
// Check for error...
if (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS)
if (status != CAIRO_STATUS_SUCCESS)
{
// Output the surface create error...
cairo_status_t status = cairo_surface_status(_surface);
NSWarnMLog(@"surface create FAILED - status: %s\n", cairo_status_to_string(status));
// Destroy the surface created...
@ -122,10 +122,10 @@
// Destroy the initial surface created...
cairo_surface_destroy(window);
// Release the device context...
ReleaseDC((HWND)device, hDC);
}
// Release the device context...
ReleaseDC((HWND)device, hDC);
if (win && self)
{
@ -139,37 +139,24 @@
- (void) dealloc
{
if ((_surface == NULL) || (cairo_surface_status(_surface) != CAIRO_STATUS_SUCCESS))
{
NSWarnMLog(@"null surface or bad status\n");
}
else
{
if (cairo_win32_surface_get_dc(_surface) == NULL)
{
NSWarnMLog(@"HDC is NULL for surface: %@\n", self);
}
else
{
ReleaseDC(GSWINDEVICE, cairo_win32_surface_get_dc(_surface));
}
}
// After further testing and monitoring USER/GDI object counts found
// that releasing the HDC is redundant and unnecessary...
[super dealloc];
}
- (NSString*) description
{
NSMutableString *description = AUTORELEASE([[super description] mutableCopy]);
HDC shdc = NULL;
if (_surface)
{
shdc = cairo_win32_surface_get_dc(_surface);
}
NSMutableString *description = AUTORELEASE([[super description] mutableCopy]);
[description appendFormat: @" size: %@",NSStringFromSize([self size])];
[description appendFormat: @" _surface: %p",_surface];
[description appendFormat: @" surfDC: %p",shdc];
return AUTORELEASE([description copy]);
return AUTORELEASE(description);
}
- (NSSize) size

View file

@ -266,7 +266,7 @@
- (void) decodeWM_WINDOWPOSCHANGINGParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
WINDOWPOS *inf = (WINDOWPOS*)lParam;
WINDOWPOS *inf = (WINDOWPOS*)lParam;
if ((inf->flags & SWP_NOZORDER) == 0)
{
@ -284,7 +284,6 @@
- (LRESULT) decodeWM_GETMINMAXINFOParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// reused from original author (added debug code)
WIN_INTERN *win = (WIN_INTERN *)GetWindowLong(hwnd, GWL_USERDATA);
MINMAXINFO *mm;
@ -306,16 +305,6 @@
- (LRESULT) decodeWM_EXITSIZEMOVEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd
{
// may have a small bug here note it for follow up
/*
decodeWM_MOVE and decodeWM_SIZE will send event if they have one.
no posting is needed.
*/
[self resizeBackingStoreFor: hwnd];
// [self decodeWM_MOVEParams:hwnd :wParam :lParam];
// [self decodeWM_SIZEParams:hwnd :wParam :lParam];
//Make sure DefWindowProc gets called
return DefWindowProc(hwnd, WM_EXITSIZEMOVE, wParam, lParam);
}
@ -327,13 +316,8 @@
- (LRESULT) decodeWM_MOVINGParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam
{
// [self decodeWM_MOVEParams:(HWND)hwnd : (WPARAM)wParam : (LPARAM)lParam];
[EVENT_WINDOW(hwnd) display];
return TRUE;
}
@end