From 2f0d1a3244c8953a4468759ac466b80c4965d38f Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 16 Nov 2012 12:41:52 -0800 Subject: [PATCH] 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. --- cli/trace_analyzer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- 2.43.0