Howard's CR comments

This commit is contained in:
Zach Fox 2017-06-15 13:13:58 -07:00
parent 834a2a5c3b
commit 1088d248e3
5 changed files with 4 additions and 17 deletions

View file

@ -706,6 +706,7 @@ bool OpenGLDisplayPlugin::setDisplayTexture(const QString& name) {
// Note: it is the caller's responsibility to keep the network texture in cache.
if (name.isEmpty()) {
_displayTexture.reset();
clearPreviewFlag();
return true;
}
auto textureCache = DependencyManager::get<TextureCache>();

View file

@ -58,6 +58,7 @@ public:
}
virtual bool setDisplayTexture(const QString& name) override;
virtual bool clearPreviewFlag() override { return false; };
QImage getScreenshot(float aspectRatio = 0.0f) const override;
float presentRate() const override;

View file

@ -743,19 +743,3 @@ HmdDisplayPlugin::~HmdDisplayPlugin() {
float HmdDisplayPlugin::stutterRate() const {
return _stutterRate.rate();
}
bool HmdDisplayPlugin::setDisplayTexture(const QString& name) {
// Note: it is the caller's responsibility to keep the network texture in cache.
if (name.isEmpty()) {
_displayTexture.reset();
_clearPreviewFlag = true;
return true;
}
auto textureCache = DependencyManager::get<TextureCache>();
auto displayNetworkTexture = textureCache->getTexture(name);
if (!displayNetworkTexture) {
return false;
}
_displayTexture = displayNetworkTexture->getGPUTexture();
return !!_displayTexture;
}

View file

@ -46,7 +46,7 @@ public:
float stutterRate() const override;
virtual bool setDisplayTexture(const QString& name) override;
virtual bool clearPreviewFlag() override { _clearPreviewFlag = true; return true; };
protected:
virtual void hmdPresent() = 0;

View file

@ -186,6 +186,7 @@ public:
// Set the texture to display on the monitor and return true, if allowed. Empty string resets.
virtual bool setDisplayTexture(const QString& name) { return false; }
virtual bool clearPreviewFlag() { return false; };
virtual float devicePixelRatio() { return 1.0f; }
// Rate at which we render frames