Skip to content

Commit

Permalink
Don't count frames in MakeCurrent if the context/drawable don't change.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed May 17, 2011
1 parent 53d224e commit 354beb2
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions glretrace_glx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,20 @@ static void retrace_glXDestroyContext(Trace::Call &call) {
}

static void retrace_glXMakeCurrent(Trace::Call &call) {
glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
glws::Context *new_context = context_map[call.arg(2).toPointer()];

if (new_drawable == drawable && new_context == context) {
return;
}

if (drawable && context) {
glFlush();
if (!double_buffer) {
frame_complete(call.no);
}
}

glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
glws::Context *new_context = context_map[call.arg(2).toPointer()];

bool result = ws->makeCurrent(new_drawable, new_context);

if (new_drawable && new_context && result) {
Expand Down Expand Up @@ -187,16 +191,20 @@ static void retrace_glXCreateNewContext(Trace::Call &call) {
}

static void retrace_glXMakeContextCurrent(Trace::Call &call) {
glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
glws::Context *new_context = context_map[call.arg(3).toPointer()];

if (new_drawable == drawable && new_context == context) {
return;
}

if (drawable && context) {
glFlush();
if (!double_buffer) {
frame_complete(call.no);
}
}

glws::Drawable *new_drawable = getDrawable(call.arg(1).toUInt());
glws::Context *new_context = context_map[call.arg(3).toPointer()];

bool result = ws->makeCurrent(new_drawable, new_context);

if (new_drawable && new_context && result) {
Expand Down

0 comments on commit 354beb2

Please sign in to comment.