Skip to content

Commit

Permalink
Bug 1877541 - WebGL about:support prints per-context inProcess/outOfP…
Browse files Browse the repository at this point in the history
…rocess bool status. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D200065
  • Loading branch information
kdashg committed Jan 31, 2024
1 parent e6c5c3d commit 70df3f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dom/canvas/ClientWebGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 14 additions & 0 deletions dom/canvas/WebGLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 70df3f3

Please sign in to comment.