build in the backend dir after auto-generating files
2001-07-29 Hans Breuer <hans@breuer.org> * gdk/makefile.msc : build in the backend dir after auto-generating files * gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement with code from win32-production-branch. * gdk/win32/gdkwindow-win32.c : set the private->destroyed flag before calling DestroyWindow, which indirectly calls gdk_window_destroy_notify () (performance patch merged from win32-production-branch) * gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments): Use PatBlt() instead of LineTo() when possible (solid single-pixel pen, R2_COPYPEN rop). It is claimed to be much faster.
This commit is contained in:
parent
2d6add1880
commit
da155bb731
11 changed files with 204 additions and 9 deletions
17
ChangeLog
17
ChangeLog
|
|
@ -1,3 +1,20 @@
|
|||
2001-07-29 Hans Breuer <hans@breuer.org>
|
||||
|
||||
* gdk/makefile.msc : build in the backend dir after
|
||||
auto-generating files
|
||||
|
||||
* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
|
||||
with code from win32-production-branch.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
|
||||
before calling DestroyWindow, which indirectly calls
|
||||
gdk_window_destroy_notify ()
|
||||
|
||||
(performance patch merged from win32-production-branch)
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
|
||||
Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
|
||||
R2_COPYPEN rop). It is claimed to be much faster.
|
||||
|
||||
Fri Jul 27 11:31:15 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
2001-07-29 Hans Breuer <hans@breuer.org>
|
||||
|
||||
* gdk/makefile.msc : build in the backend dir after
|
||||
auto-generating files
|
||||
|
||||
* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
|
||||
with code from win32-production-branch.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
|
||||
before calling DestroyWindow, which indirectly calls
|
||||
gdk_window_destroy_notify ()
|
||||
|
||||
(performance patch merged from win32-production-branch)
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
|
||||
Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
|
||||
R2_COPYPEN rop). It is claimed to be much faster.
|
||||
|
||||
Fri Jul 27 11:31:15 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
2001-07-29 Hans Breuer <hans@breuer.org>
|
||||
|
||||
* gdk/makefile.msc : build in the backend dir after
|
||||
auto-generating files
|
||||
|
||||
* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
|
||||
with code from win32-production-branch.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
|
||||
before calling DestroyWindow, which indirectly calls
|
||||
gdk_window_destroy_notify ()
|
||||
|
||||
(performance patch merged from win32-production-branch)
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
|
||||
Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
|
||||
R2_COPYPEN rop). It is claimed to be much faster.
|
||||
|
||||
Fri Jul 27 11:31:15 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
2001-07-29 Hans Breuer <hans@breuer.org>
|
||||
|
||||
* gdk/makefile.msc : build in the backend dir after
|
||||
auto-generating files
|
||||
|
||||
* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
|
||||
with code from win32-production-branch.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
|
||||
before calling DestroyWindow, which indirectly calls
|
||||
gdk_window_destroy_notify ()
|
||||
|
||||
(performance patch merged from win32-production-branch)
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
|
||||
Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
|
||||
R2_COPYPEN rop). It is claimed to be much faster.
|
||||
|
||||
Fri Jul 27 11:31:15 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
2001-07-29 Hans Breuer <hans@breuer.org>
|
||||
|
||||
* gdk/makefile.msc : build in the backend dir after
|
||||
auto-generating files
|
||||
|
||||
* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
|
||||
with code from win32-production-branch.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
|
||||
before calling DestroyWindow, which indirectly calls
|
||||
gdk_window_destroy_notify ()
|
||||
|
||||
(performance patch merged from win32-production-branch)
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
|
||||
Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
|
||||
R2_COPYPEN rop). It is claimed to be much faster.
|
||||
|
||||
Fri Jul 27 11:31:15 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
2001-07-29 Hans Breuer <hans@breuer.org>
|
||||
|
||||
* gdk/makefile.msc : build in the backend dir after
|
||||
auto-generating files
|
||||
|
||||
* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
|
||||
with code from win32-production-branch.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
|
||||
before calling DestroyWindow, which indirectly calls
|
||||
gdk_window_destroy_notify ()
|
||||
|
||||
(performance patch merged from win32-production-branch)
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
|
||||
Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
|
||||
R2_COPYPEN rop). It is claimed to be much faster.
|
||||
|
||||
Fri Jul 27 11:31:15 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property):
|
||||
|
|
|
|||
|
|
@ -1,3 +1,20 @@
|
|||
2001-07-29 Hans Breuer <hans@breuer.org>
|
||||
|
||||
* gdk/makefile.msc : build in the backend dir after
|
||||
auto-generating files
|
||||
|
||||
* gdk/win32/gdkfont-win32.c (gdk_font_load) : reimplement
|
||||
with code from win32-production-branch.
|
||||
|
||||
* gdk/win32/gdkwindow-win32.c : set the private->destroyed flag
|
||||
before calling DestroyWindow, which indirectly calls
|
||||
gdk_window_destroy_notify ()
|
||||
|
||||
(performance patch merged from win32-production-branch)
|
||||
* gdk/win32/gdkdrawable-win32.c (gdk_win32_draw_segments):
|
||||
Use PatBlt() instead of LineTo() when possible (solid single-pixel pen,
|
||||
R2_COPYPEN rop). It is claimed to be much faster.
|
||||
|
||||
Fri Jul 27 11:31:15 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_property):
|
||||
|
|
|
|||
|
|
@ -45,11 +45,17 @@ CFLAGS = -I . -I .. $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I ../gdk-pixbuf \
|
|||
EXTRALIBS = $(WTKIT)\lib\i386\wntab32x.lib $(GLIB_LIBS) \
|
||||
..\gdk-pixbuf\gdk_pixbuf-$(GDK_PIXBUF_VER).lib $(PANGOWIN32_LIBS)
|
||||
|
||||
gdk-win32-backend :
|
||||
cd win32
|
||||
nmake -nologo -f makefile.msc
|
||||
cd ..
|
||||
|
||||
all: \
|
||||
..\config.h \
|
||||
gdkconfig.h \
|
||||
gdkenumtypes.h \
|
||||
gdkenumtypes.c \
|
||||
gdk-win32-backend \
|
||||
gdk-win32-$(GTK_VER).dll \
|
||||
testgdk.exe
|
||||
|
||||
|
|
|
|||
|
|
@ -867,17 +867,56 @@ gdk_win32_draw_segments (GdkDrawable *drawable,
|
|||
}
|
||||
else
|
||||
{
|
||||
const gboolean maybe_patblt =
|
||||
gc_private->rop2 == R2_COPYPEN &&
|
||||
gc_private->pen_width <= 1 &&
|
||||
(gc_private->pen_style & PS_STYLE_MASK) == PS_SOLID;
|
||||
|
||||
for (i = 0; ok && i < nsegs; i++)
|
||||
{
|
||||
if (!MoveToEx (hdc, segs[i].x1, segs[i].y1, NULL))
|
||||
WIN32_GDI_FAILED ("MoveToEx"), ok = FALSE;
|
||||
if (ok && !LineTo (hdc, segs[i].x2, segs[i].y2))
|
||||
WIN32_GDI_FAILED ("LineTo"), ok = FALSE;
|
||||
/* PatBlt() is much faster than LineTo(), says
|
||||
* jpe@archaeopteryx.com. Hmm. Use it if we have a solid
|
||||
* colour pen, then we know that the brush is also solid and
|
||||
* of the same colour.
|
||||
*/
|
||||
if (maybe_patblt && segs[i].x1 == segs[i].x2)
|
||||
{
|
||||
int y1, y2;
|
||||
|
||||
if (segs[i].y1 <= segs[i].y2)
|
||||
y1 = segs[i].y1, y2 = segs[i].y2;
|
||||
else
|
||||
y1 = segs[i].y2, y2 = segs[i].y1;
|
||||
|
||||
if (!PatBlt (hdc, segs[i].x1, y1,
|
||||
1, y2 - y1 + 1, PATCOPY))
|
||||
WIN32_GDI_FAILED ("PatBlt"), ok = FALSE;
|
||||
}
|
||||
else if (maybe_patblt && segs[i].y1 == segs[i].y2)
|
||||
{
|
||||
int x1, x2;
|
||||
|
||||
if (segs[i].x1 <= segs[i].x2)
|
||||
x1 = segs[i].x1, x2 = segs[i].x2;
|
||||
else
|
||||
x1 = segs[i].x2, x2 = segs[i].x1;
|
||||
|
||||
if (!PatBlt (hdc, x1, segs[i].y1,
|
||||
x2 - x1 + 1, 1, PATCOPY))
|
||||
WIN32_GDI_FAILED ("PatBlt"), ok = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!MoveToEx (hdc, segs[i].x1, segs[i].y1, NULL))
|
||||
WIN32_GDI_FAILED ("MoveToEx"), ok = FALSE;
|
||||
if (ok && !LineTo (hdc, segs[i].x2, segs[i].y2))
|
||||
WIN32_GDI_FAILED ("LineTo"), ok = FALSE;
|
||||
|
||||
/* Draw end pixel */
|
||||
if (ok && gc_private->pen_width <= 1)
|
||||
if (!LineTo (hdc, segs[i].x2 + 1, segs[i].y2))
|
||||
WIN32_GDI_FAILED ("LineTo"), ok = FALSE;
|
||||
/* Draw end pixel */
|
||||
if (ok && gc_private->pen_width <= 1)
|
||||
if (!LineTo (hdc, segs[i].x2 + 1, segs[i].y2))
|
||||
WIN32_GDI_FAILED ("LineTo"), ok = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
gdk_win32_hdc_release (drawable, gc, mask);
|
||||
|
|
|
|||
|
|
@ -1517,6 +1517,11 @@ GdkFont*
|
|||
gdk_font_load (const gchar *font_name)
|
||||
{
|
||||
GdkFont *font;
|
||||
GdkFontPrivateWin32 *private;
|
||||
GdkWin32SingleFont *singlefont;
|
||||
HGDIOBJ oldfont;
|
||||
HANDLE *f;
|
||||
TEXTMETRIC textmetric;
|
||||
|
||||
g_return_val_if_fail (font_name != NULL, NULL);
|
||||
|
||||
|
|
@ -1524,6 +1529,29 @@ gdk_font_load (const gchar *font_name)
|
|||
if (font)
|
||||
return font;
|
||||
|
||||
private = g_new (GdkFontPrivateWin32, 1);
|
||||
font = (GdkFont*) private;
|
||||
|
||||
singlefont = gdk_font_load_internal (font_name);
|
||||
|
||||
private->base.ref_count = 1;
|
||||
private->names = NULL;
|
||||
private->fonts = g_slist_append (NULL, singlefont);
|
||||
|
||||
/* Pretend all fonts are fontsets... Gtktext and gtkentry work better
|
||||
* that way, they use wide chars, which is necessary for non-ASCII
|
||||
* chars to work. (Yes, even Latin-1, as we use Unicode internally.)
|
||||
*/
|
||||
font->type = GDK_FONT_FONTSET;
|
||||
oldfont = SelectObject (gdk_display_hdc, singlefont->hfont);
|
||||
GetTextMetrics (gdk_display_hdc, &textmetric);
|
||||
SelectObject (gdk_display_hdc, oldfont);
|
||||
font->ascent = textmetric.tmAscent;
|
||||
font->descent = textmetric.tmDescent;
|
||||
|
||||
GDK_NOTE (MISC, g_print ("... asc %d desc %d\n",
|
||||
font->ascent, font->descent));
|
||||
|
||||
gdk_font_hash_insert (GDK_FONT_FONTSET, font, font_name);
|
||||
|
||||
return gdk_font_from_one_singlefont (gdk_font_load_internal (font_name));
|
||||
|
|
|
|||
|
|
@ -770,7 +770,10 @@ _gdk_windowing_window_destroy (GdkWindow *window,
|
|||
}
|
||||
}
|
||||
else if (!recursing && !foreign_destroy)
|
||||
DestroyWindow (GDK_WINDOW_HWND (window));
|
||||
{
|
||||
private->destroyed = TRUE;
|
||||
DestroyWindow (GDK_WINDOW_HWND (window));
|
||||
}
|
||||
}
|
||||
|
||||
/* This function is called when the window really gone.
|
||||
|
|
|
|||
Loading…
Reference in a new issue