Native Themes With Cairo

From MozillaWiki
Revision as of 02:49, 25 November 2006 by Pawxava (talk | contribs)
Jump to navigation Jump to search
19:20 <@vlad> native theme stuff is ridiculously slow on linux19:20 < roc> vlad: I know. What's your plan?19:20 <@vlad> not sure yet19:20 < roc> Do you remember my plan?19:21 <@vlad> the one that you implemented? or another plan?19:21 < roc> vlad: a speedup plan19:21 <@vlad> render offsceen, recover alpha, composite?19:21 <@vlad> hmm, no19:23 < roc> vlad: whitelist native themes as being "well behaved". A well             behaved theme draws the same contents for a given widget type,             state and size19:23 <@vlad> hmm, I'm not sure that I heard this plan19:23 <@vlad> and if its well-behaved, we cache or something?19:23 < roc> vlad: then, cache cairo surfaces for widget renderings19:23 < roc> ALSO19:24 < roc> for each widget type+state, keep track of the maximum width and             maximum height we've seen rendered19:24 <@vlad> oh, also.. do we really need to recover alpha?19:25 < roc> vlad: yes. GNOME Industrial, for example, uses transparency in the             buttons19:25 < roc> also, quite a lot of widget/state combos don't paint anything at             all19:25 < roc> apparently19:26 <@vlad> does it use 8-bit transparency or 1-bit transparency?19:26 < roc> for each type+state, remember if we've ever seen 1) anything drawn             at all 2) any transparency19:26 < roc> vlad: 1-bit19:26 <@vlad> ok19:26 <@vlad> so for 1-bit19:26 < roc> chromakey?19:26 <@vlad> if we attach a picture to a Pixmap19:26 <@vlad> and clear to fully transparent first19:27 < roc> does it work?19:27 <@vlad> yeah19:27 < roc> sweet19:27 < roc> okay19:27 <@vlad> that should speed things up dramatically19:27 < roc> then for each type+state, remember if we've ever seen 1) anything             drawn at all 2) any transparency 3) any translucency19:28 < roc> if we get a request to paint a widget type+state at a size that is             smaller than we've already painted in both the horizontal and             vertical directions, then we believe it's no more complex than             what we've already seen19:28 < roc> oh, we also check for 4) painting of a single solid color19:28 <@pav> roc: ok, i fixed the os2 thing and a similar thing on windows             (some errors in the patch)19:28 <@vlad> yeah19:28 < roc> then we can optimize in the obvious ways19:28 <@pav> anything else?19:29 < roc> any theme that does something silly like paint a translucent image             for small widget sizes and an opaque one for large sizes will not             be marked as "well behaved"19:29 <@vlad> yep19:29 < roc> and we will do the horrible slow thing19:29 <@vlad> that's fine19:29 < roc> yeah19:29 < roc> it is19:29 <@vlad> people who are using those themes are already horrible and slow19:30 < biesi> how do you detect translucency?19:30 < biesi> if all you have is a Pixmap with 1-bit transparency19:30 < roc> paint onto white and paint onto black and analyze19:30 < roc> "paint nothing" and "paint a solid color" are pretty darn common             so if we detect those we'll actually end up with something faster             than what we have now, I think19:31 < biesi> can that go away with the cairo-using gtk 2.8?19:31 < roc> no19:31 < roc> it can't19:31 < roc> because themes are still allowed to use X calls to draw19:31 < roc> that's the biggie problem