Merge branch 'master' of github.com:highfidelity/hifi into yellow

This commit is contained in:
Sam Gateau 2019-06-13 17:42:52 -07:00
commit 4ba34f9a85
16 changed files with 166 additions and 117 deletions

View file

@ -106,3 +106,4 @@ The following build options can be used when running CMake
#### Devices
You can support external input/output devices such as Leap Motion, MIDI, and more by adding each individual SDK in the visible building path. Refer to the readme file available in each device folder in [interface/external/](interface/external) for the detailed explanation of the requirements to use the device.

View file

@ -13,15 +13,14 @@ import QtQuick 2.4
import controlsUit 1.0 as HifiControlsUit
import stylesUit 1.0 as HifiStylesUit
import "LoginDialog"
FocusScope {
id: root
HifiStylesUit.HifiConstants { id: hifi }
objectName: "LoginDialog"
property bool shown: true
visible: shown
HifiStylesUit.HifiConstants { id: hifi }
anchors.fill: parent
readonly property bool isTablet: false
@ -33,12 +32,17 @@ FocusScope {
property bool keyboardRaised: false
property bool punctuationMode: false
property bool isPassword: false
property string title: ""
property string text: ""
property int titleWidth: 0
property alias bannerWidth: banner.width
property alias bannerHeight: banner.height
property string title: ""
property string text: ""
property int titleWidth: 0
property bool isHMD: HMD.active
function tryDestroy() {
root.destroy()
}

View file

@ -23,43 +23,36 @@ FocusScope {
objectName: "LoginDialog"
visible: true
HifiStylesUit.HifiConstants { id: hifi }
anchors.fill: parent
width: parent.width
height: parent.height
property var tabletProxy: Tablet.getTablet("com.highfidelity.interface.tablet.system");
property bool isHMD: HMD.active
property bool gotoPreviousApp: false;
readonly property bool isTablet: true
readonly property bool isOverlay: false
property string iconText: hifi.glyphs.avatar
property int iconSize: 35
property bool keyboardEnabled: false
property bool keyboardRaised: false
property bool punctuationMode: false
property bool isPassword: false
readonly property bool isTablet: true
readonly property bool isOverlay: false
property alias text: loginKeyboard.mirroredText
property int titleWidth: 0
property alias bannerWidth: banner.width
property alias bannerHeight: banner.height
property string iconText: hifi.glyphs.avatar
property int iconSize: 35
property var pane: QtObject {
property real width: root.width
property real height: root.height
}
property int titleWidth: 0
function tryDestroy() {
tabletProxy.gotoHomeScreen();
}
property bool isHMD: HMD.active
MouseArea {
width: root.width
height: root.height
}
// TABLET SPECIFIC PROPERTIES START //
property alias text: loginKeyboard.mirroredText
width: parent.width
height: parent.height
property var tabletProxy: Tablet.getTablet("com.highfidelity.interface.tablet.system")
property bool gotoPreviousApp: false
property bool keyboardOverride: true
@ -70,7 +63,20 @@ FocusScope {
property alias loginDialog: loginDialog
property alias hifi: hifi
HifiStylesUit.HifiConstants { id: hifi }
property var pane: QtObject {
property real width: root.width
property real height: root.height
}
MouseArea {
width: root.width
height: root.height
}
// TABLET SPECIFIC PROPERTIES END //
function tryDestroy() {
tabletProxy.gotoHomeScreen();
}
Timer {
id: keyboardTimer
@ -102,6 +108,15 @@ FocusScope {
anchors.fill: parent
}
Rectangle {
z: -6
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.65
color: "black"
}
Item {
z: -5
id: bannerContainer
@ -119,15 +134,6 @@ FocusScope {
}
}
Rectangle {
z: -6
id: opaqueRect
height: parent.height
width: parent.width
opacity: 0.65
color: "black"
}
HifiControlsUit.Keyboard {
id: loginKeyboard
raised: root.keyboardEnabled && root.keyboardRaised

View file

@ -63,9 +63,15 @@ PerformanceManager::PerformancePreset PerformanceManager::getPerformancePreset()
void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformancePreset preset) {
// Ugly case that prevent us to run deferred everywhere...
bool isDeferredCapable = platform::Profiler::isRenderMethodDeferredCapable();
switch (preset) {
case PerformancePreset::HIGH:
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED);
RenderScriptingInterface::getInstance()->setRenderMethod( ( isDeferredCapable ?
RenderScriptingInterface::RenderMethod::DEFERRED :
RenderScriptingInterface::RenderMethod::FORWARD ) );
RenderScriptingInterface::getInstance()->setShadowsEnabled(true);
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
@ -73,7 +79,10 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
break;
case PerformancePreset::MID:
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED);
RenderScriptingInterface::getInstance()->setRenderMethod((isDeferredCapable ?
RenderScriptingInterface::RenderMethod::DEFERRED :
RenderScriptingInterface::RenderMethod::FORWARD));
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE);
DependencyManager::get<LODManager>()->setWorldDetailQuality(0.5f);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -256,28 +256,18 @@ void EntityTreeRenderer::clear() {
}
// reset the engine
if (_wantScripts && !_shuttingDown) {
resetEntitiesScriptEngine();
}
// remove all entities from the scene
auto scene = _viewState->getMain3DScene();
if (_shuttingDown) {
if (scene) {
render::Transaction transaction;
for (const auto& entry : _entitiesInScene) {
const auto& renderer = entry.second;
renderer->removeFromScene(scene, transaction);
}
scene->enqueueTransaction(transaction);
if (scene) {
for (const auto& entry : _entitiesInScene) {
const auto& renderer = entry.second;
fadeOutRenderable(renderer);
}
} else {
if (_wantScripts) {
resetEntitiesScriptEngine();
}
if (scene) {
for (const auto& entry : _entitiesInScene) {
const auto& renderer = entry.second;
fadeOutRenderable(renderer);
}
} else {
qCWarning(entitiesrenderer) << "EntitityTreeRenderer::clear(), Unexpected null scene";
}
qCWarning(entitiesrenderer) << "EntitityTreeRenderer::clear(), Unexpected null scene, possibly during application shutdown";
}
_entitiesInScene.clear();
_renderablesToUpdate.clear();

View file

@ -7,7 +7,6 @@
//
#include "RenderableWebEntityItem.h"
#include <atomic>
#include <QtCore/QTimer>
#include <QtGui/QOpenGLContext>
@ -47,7 +46,7 @@ static uint64_t MAX_NO_RENDER_INTERVAL = 30 * USECS_PER_SECOND;
static uint8_t YOUTUBE_MAX_FPS = 30;
// Don't allow more than 20 concurrent web views
static std::atomic<uint32_t> _currentWebCount(0);
static uint32_t _currentWebCount { 0 };
static const uint32_t MAX_CONCURRENT_WEB_VIEWS = 20;
static QTouchDevice _touchDevice;
@ -357,15 +356,16 @@ void WebEntityRenderer::buildWebSurface(const EntityItemPointer& entity, const Q
void WebEntityRenderer::destroyWebSurface() {
QSharedPointer<OffscreenQmlSurface> webSurface;
ContentType contentType = ContentType::NoContent;
withWriteLock([&] {
webSurface.swap(_webSurface);
_contentType = ContentType::NoContent;
if (webSurface) {
--_currentWebCount;
WebEntityRenderer::releaseWebSurface(webSurface, _cachedWebSurface, _connections);
}
_contentType = contentType;
});
if (webSurface) {
--_currentWebCount;
WebEntityRenderer::releaseWebSurface(webSurface, _cachedWebSurface, _connections);
}
}
glm::vec2 WebEntityRenderer::getWindowSize(const TypedEntityPointer& entity) const {
@ -469,12 +469,6 @@ void WebEntityRenderer::handlePointerEventAsMouse(const PointerEvent& event) {
QCoreApplication::sendEvent(_webSurface->getWindow(), &mouseEvent);
}
void WebEntityRenderer::onRemoveFromSceneTyped(const TypedEntityPointer& entity) {
// HACK: destroyWebSurface() here to avoid a crash on shutdown.
// TODO: fix the real problem: EntityRenderer<>::dtor never called on shutdown for smart-pointer resource leak.
destroyWebSurface();
}
void WebEntityRenderer::setProxyWindow(QWindow* proxyWindow) {
withReadLock([&] {
if (_webSurface) {

View file

@ -64,7 +64,6 @@ protected:
void handlePointerEventAsTouch(const PointerEvent& event);
void handlePointerEventAsMouse(const PointerEvent& event);
void onRemoveFromSceneTyped(const TypedEntityPointer& entity) override;
private:
void onTimeout();
void buildWebSurface(const EntityItemPointer& entity, const QString& newSourceURL);

View file

@ -12,6 +12,7 @@
#include "Platform.h"
#include "PlatformKeys.h"
#include <qglobal.h>
using namespace platform;
@ -124,4 +125,35 @@ bool filterOnProcessors(const platform::json& computer, const platform::json& cp
// Not able to profile
return false;
}
}
// Ugly very adhoc capability check to know if a particular hw can REnder with Deferred method or not
// YES for PC windows and linux
// NO for android
// YES on macos EXCEPT for macbookair with gpu intel iris or intel HD 6000
bool Profiler::isRenderMethodDeferredCapable() {
#if defined(Q_OS_MAC)
auto computer = platform::getComputer();
const auto computerModel = (computer.count(keys::computer::model) ? computer[keys::computer::model].get<std::string>() : "");
auto gpuInfo = platform::getGPU(0);
const auto gpuModel = (gpuInfo.count(keys::gpu::model) ? gpuInfo[keys::gpu::model].get<std::string>() : "");
// Macbook air 2018 are a problem
if ((computerModel.find("MacBookAir") != std::string::npos) && (gpuModel.find("Intel HD Graphics 6000") != std::string::npos)) {
return false;
}
// We know for fact that one INtel Iris is problematic, not enough info yet for sure
// if ((gpuModel.find("Intel Iris ....") != std::string::npos)) {
// return false;
//}
return true;
#elif defined(Q_OS_ANDROID)
return false;
#else
return true;
#endif
}

View file

@ -28,6 +28,9 @@ public:
static const std::array<const char*, Tier::NumTiers> TierNames;
static Tier profilePlatform();
// Ugly very adhoc capability check to know if a particular hw can REnder with Deferred method or not
static bool isRenderMethodDeferredCapable();
};
}

View file

@ -47,6 +47,7 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer)
GLint rendererInfoCount;
CGLError err = CGLQueryRendererInfo(cglDisplayMask, &rendererInfo, &rendererInfoCount);
GLint j, numRenderers = 0, deviceVRAM, bestVRAM = 0;
int bestGPUid = 0;
err = CGLQueryRendererInfo(cglDisplayMask, &rendererInfo, &numRenderers);
if (0 == err) {
// Iterate over all of them and use the figure for the one with the most VRAM,
@ -55,6 +56,7 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer)
for (j = 0; j < numRenderers; j++) {
CGLDescribeRenderer(rendererInfo, j, kCGLRPVideoMemoryMegabytes, &deviceVRAM);
if (deviceVRAM > bestVRAM) {
bestGPUid = j;
bestVRAM = deviceVRAM;
_isValid = true;
}
@ -78,6 +80,8 @@ GPUIdent* GPUIdent::ensureQuery(const QString& vendor, const QString& renderer)
for (int i = 0; i < parts.size(); ++i) {
if (parts[i].toLower().contains("radeon") || parts[i].toLower().contains("nvidia")) {
_name=parts[i];
} else if (i == bestGPUid) {
_name=parts[i];
}
}

View file

@ -686,43 +686,52 @@ void OffscreenQmlSurface::setKeyboardRaised(QObject* object, bool raised, bool n
return;
}
#if !defined(Q_OS_ANDROID)
// if HMD is being worn, allow keyboard to open. allow it to close, HMD or not.
if (!raised || qApp->property(hifi::properties::HMD).toBool()) {
QQuickItem* item = dynamic_cast<QQuickItem*>(object);
if (!item) {
return;
}
bool android = false;
#if defined(Q_OS_ANDROID)
android = true;
#endif
// for future probably makes sense to consider one of the following:
// 1. make keyboard a singleton, which will be dynamically re-parented before showing
// 2. track currently visible keyboard somewhere, allow to subscribe for this signal
// any of above should also eliminate need in duplicated properties and code below
bool hmd = qApp->property(hifi::properties::HMD).toBool();
while (item) {
// Numeric value may be set in parameter from HTML UI; for QML UI, detect numeric fields here.
numeric = numeric || QString(item->metaObject()->className()).left(7) == "SpinBox";
if (item->property("keyboardRaised").isValid()) {
// FIXME - HMD only: Possibly set value of "keyboardEnabled" per isHMDMode() for use in WebView.qml.
if (item->property("punctuationMode").isValid()) {
item->setProperty("punctuationMode", QVariant(numeric));
}
if (item->property("passwordField").isValid()) {
item->setProperty("passwordField", QVariant(passwordField));
}
if (raised) {
item->setProperty("keyboardRaised", QVariant(!raised));
}
item->setProperty("keyboardRaised", QVariant(raised));
if (!android || hmd) {
// if HMD is being worn, allow keyboard to open. allow it to close, HMD or not.
if (!raised || hmd) {
QQuickItem* item = dynamic_cast<QQuickItem*>(object);
if (!item) {
return;
}
item = dynamic_cast<QQuickItem*>(item->parentItem());
// for future probably makes sense to consider one of the following:
// 1. make keyboard a singleton, which will be dynamically re-parented before showing
// 2. track currently visible keyboard somewhere, allow to subscribe for this signal
// any of above should also eliminate need in duplicated properties and code below
while (item) {
// Numeric value may be set in parameter from HTML UI; for QML UI, detect numeric fields here.
numeric = numeric || QString(item->metaObject()->className()).left(7) == "SpinBox";
if (item->property("keyboardRaised").isValid()) {
if (item->property("punctuationMode").isValid()) {
item->setProperty("punctuationMode", QVariant(numeric));
}
if (item->property("passwordField").isValid()) {
item->setProperty("passwordField", QVariant(passwordField));
}
if (hmd && item->property("keyboardEnabled").isValid()) {
item->setProperty("keyboardEnabled", true);
}
item->setProperty("keyboardRaised", QVariant(raised));
return;
}
item = dynamic_cast<QQuickItem*>(item->parentItem());
}
}
}
#endif
}
void OffscreenQmlSurface::emitScriptEvent(const QVariant& message) {

View file

@ -26,8 +26,9 @@ Rectangle {
color: global.color
ScrollView {
id: control
id: scrollView
anchors.fill: parent
contentWidth: parent.width
clip: true
Column {

View file

@ -24,9 +24,12 @@ Rectangle {
color: global.colorBack
ScrollView {
id: scrollView
anchors.fill: parent
contentWidth: parent.width
clip: true
Column {
Column {
anchors.left: parent.left
anchors.right: parent.right
@ -35,8 +38,6 @@ Rectangle {
isUnfold: true
panelFrameData: Component {
PerformanceSettings {
anchors.left: parent.left
anchors.right: parent.right
}
}
}
@ -45,8 +46,6 @@ Rectangle {
isUnfold: true
panelFrameData: Component {
RenderSettings {
anchors.left: parent.left
anchors.right: parent.right
}
}
}
@ -54,8 +53,6 @@ Rectangle {
label: "Platform"
panelFrameData: Component {
Platform {
anchors.left: parent.left
anchors.right: parent.right
}
}
}

View file

@ -415,7 +415,7 @@ function getInputDeviceMutedOverlayTopY() {
var inputDeviceMutedOverlay = false;
var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_X_PX = 353;
var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_Y_PX = 95;
var INPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX = 20;
var INPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX = 20 + TOP_BAR_HEIGHT_PX;
function updateInputDeviceMutedOverlay(isMuted) {
if (isMuted) {
var props = {