Skip to content

Commit

Permalink
Be more robust in the ShaderView for null resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuetschard committed Apr 20, 2022
1 parent 4426199 commit e408dd8
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions gapic/src/main/com/google/gapid/views/ShaderView.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static class ShaderWidget extends Composite {
private final TabFolder tabFolder;
private final Composite sourceContainer;
private final Group statGroup;
private final TableViewer statTable;
protected final TableViewer statTable;
private final GridData crossCompileGridData;
private final SourceViewer spirvViewer;
private final SourceViewer sourceViewer;
Expand Down Expand Up @@ -281,19 +281,22 @@ protected void onUiThread(API.Shader result) {
}

public void setShader(Service.Resource resource, API.Shader shader) {
rpcController.start().listen(models.resources.loadResourceExtras(resource),
new UiCallback<API.ResourceExtras, API.ShaderExtras>(this, LOG) {
@Override
protected API.ShaderExtras onRpcThread(Rpc.Result<API.ResourceExtras> result)
throws RpcException, ExecutionException {
return result.get().getShaderExtras();
}
if (resource != null) {
rpcController.start().listen(models.resources.loadResourceExtras(resource),
new UiCallback<API.ResourceExtras, API.ShaderExtras>(this, LOG) {
@Override
protected API.ShaderExtras onRpcThread(Rpc.Result<API.ResourceExtras> result)
throws RpcException, ExecutionException {
return result.get().getShaderExtras();
}

@Override
protected void onUiThread(API.ShaderExtras result) {
statTable.setInput(result.getStaticAnalysis());
}
});
}

@Override
protected void onUiThread(API.ShaderExtras result) {
statTable.setInput(result.getStaticAnalysis());
}
});
loading.stopLoading();

shaderResource = resource;
Expand Down

0 comments on commit e408dd8

Please sign in to comment.