Commit 13163832 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ddraw: Add FPS tracing in ddraw_surface_update_frontbuffer().

This usually doesn't go through the normal presentation paths.
parent 5f1cbb1b
......@@ -136,6 +136,9 @@ struct ddraw
struct wined3d_stateblock *state;
const struct wined3d_stateblock_state *stateblock_state;
unsigned int frames;
DWORD prev_frame_time;
};
#define DDRAW_WINDOW_CLASS_NAME "DirectDrawDeviceWnd"
......
......@@ -24,6 +24,7 @@
#include "ddraw_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
WINE_DECLARE_DEBUG_CHANNEL(fps);
static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface2(IDirectDrawSurface2 *iface);
static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface);
......@@ -87,6 +88,21 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface,
if (w <= 0 || h <= 0)
return DD_OK;
if (!read && TRACE_ON(fps))
{
DWORD time = GetTickCount();
++ddraw->frames;
/* every 1.5 seconds */
if (time - ddraw->prev_frame_time > 1500)
{
TRACE_(fps)("%p @ approx %.2ffps\n",
ddraw, 1000.0 * ddraw->frames / (time - ddraw->prev_frame_time));
ddraw->prev_frame_time = time;
ddraw->frames = 0;
}
}
/* The interaction between ddraw and GDI drawing is not all that well
* documented, and somewhat arcane. In ddraw exclusive mode, GDI draws
* seemingly go to the *original* frontbuffer/primary surface, while ddraw
......
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