alloc'ing new drawable on every string draw

NEW
Assigned to

Status

()

Core
Internationalization
16 years ago
11 years ago

People

(Reporter: kill this account, Assigned: smontagu)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
I appears that moz allocates a new window for every string draw.

I added this code to gfx/src/gtk/nsFontMetricsGTK.cpp

 nsFontGTKNormal::DrawString(...)
 {
+  static Drawable last_win = 0;
+  Drawable win = GDK_WINDOW_XWINDOW(aSurface->GetDrawable());
+  if (win != last_win) {
+    printf("last_win=0x%lu, win=0x%lu\n", last_win, win);
+    last_win = win;
+  }
   if (!mFont) {
     LoadFont();

and when displaying the profile manager window and moving the mouse over the
"Start Mozilla" button I see the window


last_win=0x71303399, win=0x71303402
last_win=0x71303402, win=0x71303403
last_win=0x71303403, win=0x71303404
last_win=0x71303404, win=0x71303405
last_win=0x71303405, win=0x71303406
last_win=0x71303406, win=0x71303407
Summary: alloc'ing new window on every string draw → alloc'ing new window on every string draw
I'm 99% sure it's a pixmap you're drawing to, and we do create a new rendering
context for every draw event which includes creating a new pixmap.  This is
undeseriable, IMHO.
(Reporter)

Comment 2

16 years ago
doesn't creating a new drawable require a roundtrip?
Yep.  It sucks.
(Reporter)

Updated

16 years ago
Summary: alloc'ing new window on every string draw → alloc'ing new drawable on every string draw

Updated

11 years ago
Assignee: pavlov → smontagu
QA Contact: amyy → i18n
You need to log in before you can comment on or make changes to this bug.