Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes various model loading timing issues when loading multiple captures. #1331

Merged
merged 3 commits into from
Nov 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gapic/src/main/com/google/gapid/models/AtomStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void onCaptureLoadingStart(boolean maintainState) {
if (!maintainState) {
selection = null;
}
reset();
}

@Override
Expand Down
12 changes: 9 additions & 3 deletions gapic/src/main/com/google/gapid/models/Timeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
import java.util.List;
import java.util.logging.Logger;

public class Timeline extends ModelBase.ForPath<List<Service.Event>, Void, Timeline.Listener>
public class Timeline extends CaptureDependentModel<List<Service.Event>, Timeline.Listener>
implements ApiContext.Listener {
private static final Logger LOG = Logger.getLogger(Timeline.class.getName());

private final Capture capture;
private final ApiContext context;

public Timeline(Shell shell, Client client, Capture capture, ApiContext context) {
super(LOG, shell, client, Listener.class);
super(LOG, shell, client, Listener.class, capture);
this.capture = capture;
this.context = context;

Expand All @@ -53,7 +53,13 @@ public void onContextsLoaded() {

@Override
public void onContextSelected(FilteringContext ctx) {
load(events(capture.getData(), ctx), false);
load(getPath(capture.getData()), false);
}

@Override
protected Path.Any getPath(Path.Capture capturePath) {
FilteringContext ctx = context.isLoaded() ? context.getSelectedContext() : null;
return (ctx == null) ? null : events(capturePath, ctx);
}

@Override
Expand Down
5 changes: 5 additions & 0 deletions gapic/src/main/com/google/gapid/views/ShaderView.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ public void setSource(Source[] sources) {

@Override
public void onResourcesLoaded() {
lastUpdateContainedAllShaders = false;
updateShaders();
}

Expand Down Expand Up @@ -426,12 +427,16 @@ public String toString() {
}
newShaders.add(new Data(info));
} else {
// This shader has not been created yet at this point in the trace, so we don't
// show it. Remember that we've skipped a shader and the UI list is incomplete.
skippedAnyShaders = true;
}
}
}
}

// If we previously had created the dropdown with all the shaders and didn't skip any
// this time, the dropdown does not need to change.
if (!lastUpdateContainedAllShaders || skippedAnyShaders) {
shaders = newShaders;
lastUpdateContainedAllShaders = !skippedAnyShaders;
Expand Down