Issue #1829 - Revert "Issue #1751"

This commit is contained in:
Brian Smith 2022-04-26 11:34:08 -05:00 committed by roytam1
commit 13fcc4a046
949 changed files with 95662 additions and 444 deletions

View file

@ -30,6 +30,10 @@
#include "ScopedGLHelpers.h"
#include "TexUnpackBlob.h"
#ifdef XP_MACOSX
#include "ForceDiscreteGPUHelperCGL.h"
#endif
// Local
#include "WebGLContextLossHandler.h"
#include "WebGLContextUnchecked.h"
@ -2011,6 +2015,15 @@ protected:
JSObject* WebGLObjectAsJSObject(JSContext* cx, const WebGLObjectType*,
ErrorResult& rv) const;
#ifdef XP_MACOSX
// see bug 713305. This RAII helper guarantees that we're on the discrete GPU, during its lifetime
// Debouncing note: we don't want to switch GPUs too frequently, so try to not create and destroy
// these objects at high frequency. Having WebGLContext's hold one such object seems fine,
// because WebGLContext objects only go away during GC, which shouldn't happen too frequently.
// If in the future GC becomes much more frequent, we may have to revisit then (maybe use a timer).
ForceDiscreteGPUHelperCGL mForceDiscreteGPUHelper;
#endif
public:
// console logging helpers
void GenerateWarning(const char* fmt, ...);