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

Removes fps meter #3916

Merged
merged 5 commits into from
Mar 20, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
- Fixed interpolation along z-axis. [#3888](https://github.com/scalableminds/webknossos/pull/3888)

### Removed
-
- Removed FPS meter in Annotation View. [#3916](https://github.com/scalableminds/webknossos/pull/3916)


## [19.03.0](https://github.com/scalableminds/webknossos/releases/tag/19.03.0) - 2019-03-04
Expand Down
12 changes: 2 additions & 10 deletions frontend/javascripts/oxalis/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { type RouterHistory, withRouter } from "react-router-dom";
import { connect } from "react-redux";
import BackboneEvents from "backbone-events-standalone";
import * as React from "react";
import Stats from "stats.js";
import _ from "lodash";

import { HANDLED_ERROR } from "oxalis/model_initialization";
Expand Down Expand Up @@ -54,7 +53,6 @@ type State = {
class Controller extends React.PureComponent<PropsWithRouter, State> {
keyboard: InputKeyboard;
keyboardNoLoop: InputKeyboardNoLoop;
stats: Stats;
isMounted: boolean;

state = {
Expand Down Expand Up @@ -132,10 +130,6 @@ class Controller extends React.PureComponent<PropsWithRouter, State> {
UrlManager.startUrlUpdater();
initializeSceneController();

// FPS stats
this.stats = new Stats();
document.body.append(this.stats.domElement);

this.initKeyboard();
this.initTaskScript();

Expand Down Expand Up @@ -267,8 +261,6 @@ class Controller extends React.PureComponent<PropsWithRouter, State> {
});
}

updateStats = () => this.stats.update();

render() {
if (!this.state.ready) {
return <BrainSpinner />;
Expand All @@ -287,9 +279,9 @@ class Controller extends React.PureComponent<PropsWithRouter, State> {
const isPlane = constants.MODES_PLANE.includes(mode);

if (isArbitrary) {
return <ArbitraryController onRender={this.updateStats} viewMode={mode} />;
return <ArbitraryController viewMode={mode} />;
} else if (isPlane) {
return <PlaneController onRender={this.updateStats} />;
return <PlaneController />;
} else {
// At the moment, all possible view modes consist of the union of MODES_ARBITRARY and MODES_PLANE
// In case we add new viewmodes, the following error will be thrown.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class ArbitraryController extends React.PureComponent<Props> {
listenTo: Function;
stopListening: Function;

static defaultProps = {
onRender: () => {},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, onRender was only used by the fps meter. So, the prop can be removed completely from my point of view (same for plane_controller).

};

componentDidMount() {
_.extend(this, BackboneEvents);
this.input = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ class PlaneController extends React.PureComponent<Props> {
listenTo: Function;
stopListening: Function;

static defaultProps = {
onRender: () => {},
};

constructor(...args: any) {
super(...args);
_.extend(this, BackboneEvents);
Expand Down
17 changes: 0 additions & 17 deletions frontend/javascripts/test/puppeteer/dataset_rendering_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,6 @@ export async function screenshotDataset(
return openTracingViewAndScreenshot(page, baseUrl, createdExplorational.id, optionalViewOverride);
}

function removeFpsMeter(page: Page) {
// The parameter to page.evaluate will be evaluated in the puppeteer browser context
// When supplying a js function instead of the template string, babel will mess with the code
// which may lead to errors (e.g.: _window is not defined)
// See https://github.com/GoogleChrome/puppeteer/issues/1665
return page.evaluate(`() => {
const fpsMeter = document.querySelector("#stats");
if (fpsMeter != null) {
const { parentNode } = fpsMeter;
if (parentNode != null) parentNode.removeChild(fpsMeter);
}
}`);
}

async function waitForTracingViewLoad(page: Page) {
let inputCatchers;
while (inputCatchers == null || inputCatchers.length < 4) {
Expand All @@ -66,9 +52,6 @@ async function waitForTracingViewLoad(page: Page) {
}

async function waitForRenderingFinish(page: Page) {
// Remove the FPS meter as it will update even after the rendering is finished
await removeFpsMeter(page);

let currentShot;
let lastShot = await page.screenshot({ fullPage: true });
let changedPixels = Infinity;
Expand Down
6 changes: 0 additions & 6 deletions frontend/stylesheets/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ td.nowrap * {
display: inline-block;
}

#stats {
position: fixed;
bottom: 0;
right: 0;
}

#credits {
max-width: 600px;
img {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@
"react-virtualized": "^9.20.1",
"redux": "^3.6.0",
"redux-saga": "^0.16.0",
"stats.js": "^1.0.0",
"three": "^0.87.0",
"tween.js": "^16.3.1",
"url-join": "^4.0.0",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10953,11 +10953,6 @@ static-extend@^0.1.1:
define-property "^0.2.5"
object-copy "^0.1.0"

stats.js@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/stats.js/-/stats.js-1.0.0.tgz#ca304e56b116a3f46413acc349eb6eee19df688e"
integrity sha1-yjBOVrEWo/RkE6zDSetu7hnfaI4=

"statuses@>= 1.4.0 < 2":
version "1.5.0"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
Expand Down