Skip to content

Commit

Permalink
Bug 1790873 - Send a full line at a time to printf_stderr in Composit…
Browse files Browse the repository at this point in the history
…orOGL.cpp r=jgilbert

Differential Revision: https://phabricator.services.mozilla.com/D166851
  • Loading branch information
hotsphink committed Jan 11, 2024
1 parent 31c5852 commit 46aea38
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions gfx/layers/opengl/CompositorOGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,16 +1464,13 @@ void CompositorOGL::InitializeVAO(const GLuint aAttrib, const GLint aComponents,
#ifdef MOZ_DUMP_PAINTING
template <typename T>
void WriteSnapshotToDumpFile_internal(T* aObj, DataSourceSurface* aSurf) {
nsCString string(aObj->Name());
string.Append('-');
string.AppendInt((uint64_t)aObj);
if (gfxUtils::sDumpPaintFile != stderr) {
fprintf_stderr(gfxUtils::sDumpPaintFile, R"(array["%s"]=")",
string.BeginReading());
}
gfxUtils::DumpAsDataURI(aSurf, gfxUtils::sDumpPaintFile);
if (gfxUtils::sDumpPaintFile != stderr) {
fprintf_stderr(gfxUtils::sDumpPaintFile, R"(";)");
gfxUtils::DumpAsDataURI(aSurf, gfxUtils::sDumpPaintFile);
} else {
nsCString uri = gfxUtils::GetAsDataURI(aSurf);
nsPrintfCString string(R"(array["%s-%)" PRIu64 R"("]="%s";\n)",
aObj->Name(), uint64_t(aObj), uri.BeginReading());
fprintf_stderr(gfxUtils::sDumpPaintFile, "%s", string.get());
}
}

Expand Down

0 comments on commit 46aea38

Please sign in to comment.