Bug 1877541 - WebGL about:support prints per-context inProcess/outOfProcess bool status. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D200065
This commit is contained in:
@@ -2405,12 +2405,15 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname,
|
||||
if (asString) {
|
||||
const auto maybe = GetString(pname);
|
||||
if (maybe) {
|
||||
auto str = *maybe;
|
||||
auto str = std::string{};
|
||||
if (pname == dom::MOZ_debug_Binding::WSI_INFO) {
|
||||
nsPrintfCString more("\nIsWebglOutOfProcessEnabled: %i",
|
||||
int(IsWebglOutOfProcessEnabled()));
|
||||
str += more.BeginReading();
|
||||
const auto& outOfProcess = mNotLost->outOfProcess;
|
||||
const auto& inProcess = mNotLost->inProcess;
|
||||
str += PrintfStdString("outOfProcess: %s\ninProcess: %s\n",
|
||||
ToChars(bool(outOfProcess)),
|
||||
ToChars(bool(inProcess)));
|
||||
}
|
||||
str += *maybe;
|
||||
retval.set(StringValue(cx, str.c_str(), rv));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1273,6 +1273,20 @@ struct IndexedBufferBinding final {
|
||||
uint64_t ByteCount() const;
|
||||
};
|
||||
|
||||
// -
|
||||
|
||||
template <class... Args>
|
||||
inline std::string PrintfStdString(const char* const format,
|
||||
const Args&... args) {
|
||||
const auto nsStr = nsPrintfCString(format, args...);
|
||||
return ToString(nsStr);
|
||||
}
|
||||
|
||||
inline const char* ToChars(const bool val) {
|
||||
if (val) return "true";
|
||||
return "false";
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user