commit 7db886cbb472bbfe4d7f74f9d55e85b9a5216db4
parent 232c50172e1809791a00662dce837fc2b9633a35
Author: Martin Stransky <stransky@redhat.com>
Date: Mon, 1 Dec 2025 11:29:56 +0000
Bug 2002192 [Linux] Add more logging to expose event to print painted regions r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D273964
Diffstat:
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
@@ -3996,7 +3996,8 @@ bool nsWindow::HasPendingInputEvent() {
#ifdef cairo_copy_clip_rectangle_list
# error "Looks like we're including Mozilla's cairo instead of system cairo"
#endif
-static bool ExtractExposeRegion(LayoutDeviceIntRegion& aRegion, cairo_t* cr) {
+bool nsWindow::ExtractExposeRegion(LayoutDeviceIntRegion& aRegion,
+ cairo_t* cr) {
cairo_rectangle_list_t* rects = cairo_copy_clip_rectangle_list(cr);
if (rects->status != CAIRO_STATUS_SUCCESS) {
NS_WARNING("Failed to obtain cairo rectangle list.");
@@ -4005,6 +4006,8 @@ static bool ExtractExposeRegion(LayoutDeviceIntRegion& aRegion, cairo_t* cr) {
for (int i = 0; i < rects->num_rectangles; i++) {
const cairo_rectangle_t& r = rects->rectangles[i];
+ LOGVERBOSE(" expose region unscaled: [%d, %d] -> [%d x %d]", (int)r.x,
+ (int)r.y, (int)r.width, (int)r.height);
aRegion.Or(aRegion,
LayoutDeviceIntRect::Truncate((float)r.x, (float)r.y,
(float)r.width, (float)r.height));
@@ -4133,6 +4136,8 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) {
}
region.AndWith(LayoutDeviceIntRect(LayoutDeviceIntPoint(), GetClientSize()));
+ LOGVERBOSE("painted region scaled %s (client size scaled %s)",
+ ToString(region).c_str(), ToString(GetClientSize()).c_str());
if (region.IsEmpty()) {
LOG("quit, region.IsEmpty()");
return TRUE;
diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
@@ -1058,6 +1058,7 @@ class nsWindow final : public nsIWidget {
void RequestRepaint(LayoutDeviceIntRegion& aRepaintRegion);
bool DrawDragPopupSurface(cairo_t* cr);
+ bool ExtractExposeRegion(LayoutDeviceIntRegion& aRegion, cairo_t* cr);
#ifdef MOZ_X11
typedef enum {