Closed
Bug 88282
Opened 24 years ago
Closed 24 years ago
Xlib-toolkit uses XCreateGC()/XDrawString16()/XFreeGC() instead of using the GC-cache
Categories
(Core :: XUL, enhancement)
Tracking
()
VERIFIED
FIXED
mozilla0.9.3
People
(Reporter: roland.mainz, Assigned: roland.mainz)
Details
(Keywords: perf)
Attachments
(1 file)
6.44 KB,
patch
|
Details | Diff | Splinter Review |
Xlib-toolkit uses a very inefficient way to draw some fonts:
(from mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp)
-- snip --
{
/* XXX is this the right way to do it? Can I get GCCache to give me a
* new GC? */
GC copyGC;
XGCValues values;
memset(&values, 0, sizeof(XGCValues));
XGetGCValues(aSurface->GetDisplay(), *gc, GCForeground | GCBackground,
&values);
values.font = mFont->fid;
copyGC = XCreateGC(aSurface->GetDisplay(), aSurface->GetDrawable(),
GCForeground | GCBackground | GCFont, &values);
/* note the length must be divided by 2 for X*16 functions */
XDrawString16(aSurface->GetDisplay(),
aSurface->GetDrawable(),
copyGC,
aX, aY + mBaselineAdjust, (XChar2b *)p, len / 2);
XFreeGC(aSurface->GetDisplay(), copyGC);
gc->Release();
textWidth = XTextWidth16(mFont, (XChar2b *)p, len / 2);
}
-- snip --
It would be far more efficient if we could use the GC-cache instead of fireing a
XCreateGC()/XFreeGC() sequence for drawing each single string...
Suggested fix:
- Create the following API or make it accessible to nsFontMetricsXlib class:
- nsRenderingContextXlib::UpdateGC()
- nsRenderingContextXlib::GetCurrentFont()
- nsRenderingContextXlib::SetCurrentFont()
- Use this new API to get rid of this BAD code...
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.3
Assignee | ||
Comment 1•24 years ago
|
||
Accepting. Looks easy... :-)
Assignee | ||
Comment 2•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
Filed patch for both Xlib-toolkit and Xprint.
Requesting r= from pocemit ...
The patch looks great, and works great.
r=pocemit
Looking for sr=
This patch makes a nice performance improvement on a page with lots of mixed
doublebyte/normal fonts.
Assignee | ||
Comment 6•24 years ago
|
||
CC:'ing mkaply@us.ibm.com for checkin, please...
Comment 7•24 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
massive speed improvement noted, verifying.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•