Cleaning too many changes

This commit is contained in:
sam gateau 2018-11-20 17:40:59 -08:00
parent 44b9b92450
commit f3bbd412d1
4 changed files with 6 additions and 33 deletions

View file

@ -165,11 +165,11 @@ static const uint32_t MIN_THROTTLE_CHECK_FRAMES = 60;
bool Basic2DWindowOpenGLDisplayPlugin::isThrottled() const {
static auto lastCheck = presentCount();
// Don't access the menu API every single frame
// if ((presentCount() - lastCheck) > MIN_THROTTLE_CHECK_FRAMES) {
if ((presentCount() - lastCheck) > MIN_THROTTLE_CHECK_FRAMES) {
static const QString ThrottleFPSIfNotFocus = "Throttle FPS If Not Focus"; // FIXME - this value duplicated in Menu.h
_isThrottled = (!_container->isForeground() && _container->isOptionChecked(ThrottleFPSIfNotFocus));
// lastCheck = presentCount();
// }
lastCheck = presentCount();
}
return _isThrottled;
}

View file

@ -172,16 +172,7 @@ public:
// If there's no active plugin, just sleep
if (currentPlugin == nullptr) {
// Minimum sleep ends up being about 2 ms anyway
QThread::msleep(16);
continue;
}
static uint _vsyncLoopIndex = 0;
_vsyncLoopIndex++;
if (currentPlugin->isThrottled() && (_vsyncLoopIndex % 8)) {
// Minimum sleep ends up being about 2 ms anyway
QThread::msleep(16);
QThread::msleep(1);
continue;
}

View file

@ -163,24 +163,6 @@ Buffer::Size Buffer::getSize() const {
const Element BufferView::DEFAULT_ELEMENT = Element( gpu::SCALAR, gpu::UINT8, gpu::RAW );
BufferView::BufferView(const BufferView& view) :
_buffer(view._buffer),
_offset(view._offset),
_size(view._size),
_element(view._element),
_stride(view._stride)
{}
BufferView& BufferView::operator=(const BufferView& view) {
_buffer = (view._buffer);
_offset = (view._offset);
_size = (view._size);
_element = (view._element);
_stride = (view._stride);
return (*this);
}
BufferView::BufferView() :
BufferView(DEFAULT_ELEMENT) {}

View file

@ -183,8 +183,8 @@ public:
Element _element { DEFAULT_ELEMENT };
uint16 _stride { 0 };
BufferView(const BufferView& view);
BufferView& operator=(const BufferView& view);
BufferView(const BufferView& view) = default;
BufferView& operator=(const BufferView& view) = default;
BufferView();
BufferView(const Element& element);