Community
Participate
Working Groups
PJM (10/10/2001 4:45:17 PM) we should NOT be calling PmMemFlush() after memory context operations, only as needed. Which is not at all obvious when that might be. I guess whenever we draw the underlying image, or get an ImageData on it. I'm going to prototype this to see how workable it is ... NOTES: PJM (10/11/2001 12:50:03 PM) Here are the changes I made to SWT: GC: added the following static field: static final boolean LazyFlushMC = (System.getProperty("lfmc") != null); added the following to public void drawImage(Image image, int x, int y), after the isDisposed() check: if (GC.LazyFlushMC) image.internal_flushMCs(); added the following to public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) after the isDisposed() check: if (GC.LazyFlushMC) image.internal_flushMCs(); in unsetGC(), changed: OS.PmMemFlush(handle, image.handle); to: if (!GC.LazyFlushMC) OS.PmMemFlush(handle, image.handle); Image: added: import java.util.*; added inst field: private Vector memoryContexts = new Vector(); added the following to getImageData(), after the isDisposed() check: if (GC.LazyFlushMC) internal_flushMCs(); added the following to internal_new_GC(), before the return: if (GC.LazyFlushMC) memoryContexts.addElement (new Integer(pmMC)); added the following to internal_dispose_GC, as the first statement: if (GC.LazyFlushMC) internal_flushMCs(); added the following to internal_dispose_GC, as the last statement: if (GC.LazyFlushMC) memoryContexts.removeElement (new Integer(pmMC)); added the following method: void internal_flushMCs() { if (!GC.LazyFlushMC) return; for (int i=0; i<memoryContexts.size(); i++) { int mc = ((Integer) (memoryContexts.elementAt(i))).intValue(); OS.PmMemFlush(mc,handle); } } PJM (10/11/2001 1:04:40 PM) Timings per step in the Delphi TestIntView sample: P3 500Mz before: 60ms P3 500Mz after: 52ms P3 500Mz not using mc's: 21ms Aspen/Tahoe nofix before: 590ms Aspen/Tahoe nofix before: 521ms Aspen/Tahoe twox before: 380ms Aspen/Tahoe twox before: 301ms Aspen/Tahoe not using mc's: 140ms Notes: before is WITHOUT -Dlfmc=X after is WITH -Dlfmc=X The Aspen/Tahoe nofix/twox differences are different photon libraries statically linked with the vm. twox has faster mc functions. "not using mc's" is the TestIntView sample rerigged to paint all the child gauges directly to the window instead of the offscreen image. Very flashy, but also very quick.
PRODUCT VERSION: 2.002
Did we ever do anything about this? If we did (or did something equivalent), mark PR as FIXED. If we still want to, mark PR as LATER (post R2.0). If we aren't going to mark PR as WONTFIX.
This has been fixed for a while.