[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] OSRenderRegion::DrawTransformedBitmap



Phil,

It does indeed run very slowly, I think because it's trying to background
redraw the gallery or something - certainly doesn't look like it is
rectangle merging.

GRenderRegions do not background render in themselves - background rendering is handled by the View classes which shoudl not be involved here. Related: I've noticed that rectangle merging appears to be disabled on a document view when the bitmap gallery is opened and dragged around. But only while the gallery window falls partly inside, partly outside the view. As soon as the gallery window falls entirely within the view rect, region merging seems to start up again.

Bizarre. No idea!

However, fixing up the text is not a simple exercize. The way
DrawFixedSystemText seems to work in GRenderRegion is it plots it to the
MSW equivalent of a memory DC. This then gets into a kernel bitmap, and is plotted as a bitmap using the normal GDraw routines. But this itself is not particularly simple, because the wxMemoryDC will be in wxImage format, and
I am left with the former problem but in reverse, i.e. how to get the
wxImage into a KernelBitmap format. So I've got just as much odd code to
write!

No scaling or resampling involved this time... ???

True. Actually it occurred to me that I could do the resampling myself
no worse than StretchDIB does it (i.e. badly) in about 2 lines of code
at the same time as the OilBitmap to image conversion, so that's the
memory issue fixed. But again, see below.

I realise there are reasons why maybe this stuff has to be tackled in the long run for other areas of the program - just pointing out possible options.

Well further investigation shows I read the code wrong. It only does a
StretchDIB when printing. Otherwise it called the (still disabled)
call to render a bitmap fill into a rectangle, which does indeed use
GDraw to do it, even in OSRenderRegion. So hopefully I can just nurse
that back into life and all will be well.

Alex