From: Carl Worth Date: Fri, 16 Nov 2012 20:41:52 +0000 (-0800) Subject: trim: Trim swapbuffers calls when --trim-spec=drawing X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=2f0d1a3244c8953a4468759ac466b80c4965d38f trim: Trim swapbuffers calls when --trim-spec=drawing Previously, the SwapBuffers calls were only getting trimmed if --trim-spec included "no-side-effects". It was counter-intuitive that a trim-spec of "drawing" alone would leave all the SwapBuffers calls in place. So catch them under this trim-spec as well. --- diff --git a/cli/trace_analyzer.cpp b/cli/trace_analyzer.cpp index 48153f0..730dab9 100644 --- a/cli/trace_analyzer.cpp +++ b/cli/trace_analyzer.cpp @@ -635,6 +635,13 @@ TraceAnalyzer::recordDrawingSideEffects(trace::Call *call, const char *name) return true; } + /* Though it's not flagged as a "RENDER" operation, we also want + * to trim swapbuffers calls when trimming drawing operations. */ + if (call->flags & trace::CALL_FLAG_SWAP_RENDERTARGET && + call->flags & trace::CALL_FLAG_END_FRAME) { + return true; + } + /* No known drawing-related side effects. Return false for more analysis. */ return false; }