]> git.cworth.org Git - apitrace/blobdiff - glretrace_main.cpp
Re-organize the Trace::File code.
[apitrace] / glretrace_main.cpp
index dc022762fc35d439eb358cbff18eed2b77cdc2cc..9212ff61fb8cb42f3a5e20b435c61f5c1c822a38 100644 (file)
@@ -110,8 +110,9 @@ updateDrawable(int width, int height) {
         return;
     }
 
-    if (width  <= glretrace::drawable->width &&
-        height <= glretrace::drawable->height) {
+    if (drawable->visible &&
+        width  <= drawable->width &&
+        height <= drawable->height) {
         return;
     }
 
@@ -122,10 +123,9 @@ updateDrawable(int width, int height) {
         return;
     }
 
-    glretrace::drawable->resize(width, height);
-    if (!drawable->visible) {
-        drawable->show();
-    }
+    drawable->resize(width, height);
+    drawable->show();
+
     glScissor(0, 0, width, height);
 }
 
@@ -178,12 +178,20 @@ void snapshot(unsigned call_no) {
 }
 
 
-void frame_complete(unsigned call_no) {
+void frame_complete(Trace::Call &call) {
     ++frame;
 
+    if (!drawable) {
+        return;
+    }
+
+    if (!drawable->visible) {
+        retrace::warning(call) << "could not infer drawable size (glViewport never called)\n";
+    }
+
     if (snapshot_frequency == FREQUENCY_FRAME ||
         snapshot_frequency == FREQUENCY_FRAMEBUFFER) {
-        snapshot(call_no);
+        snapshot(call.no);
     }
 }
 
@@ -266,6 +274,7 @@ int main(int argc, char **argv)
         } else if (!strcmp(arg, "-b")) {
             benchmark = true;
             retrace::verbosity = -1;
+            glws::debug = false;
         } else if (!strcmp(arg, "-c")) {
             compare_prefix = argv[++i];
             if (snapshot_frequency == FREQUENCY_NEVER) {