[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Independent scroll bar operation
Date: Tue, 15 Oct 1991 12:29 EDT
From: curt@eraserhead.Jpl.Nasa.Gov (Curt Eggemeyer)
Don't you mean to conduct this conversation on CLIM@BBN.COM?
Also, please state exactly what platform you are using.
...
I already responded to the stuff elided above.
Finally, speed has become an issue. There could be a total of 20k presentation
objects total on my display-pane generated from that loop above. I have also
noticed that if I have some complicated presentations with about 200 or more
atomic drawing operations CLIM takes forever to get it out to the screen?
If I draw it out not as a presentation it takes seconds, whereas if it is
a presentation it may take over a minute#(#*&$ even though I told the
presentation to use :single-box. How can I avoid this? One of my possible
solutions is that I only present what the user can see on the
display and manually erase and generate presentations? Any thought on this?
What does "draw not as a presentation" mean? Do you mean "with output
recording disabled"? If that is what you mean, then the overhead is
clearly coming from the creation of the presentation output records,
although I don't see how it can take quite so much time.
If you can closely characterize the "200 or more atomic drawing
operations" by a few parameters, then it may be appropriate to define
your own class of output record that knows how to fully draw the whole
figure from the data contained in a single output record. For example,
here is how a line output record is defined. Macroexpand these to see
more stuff. You may need to get more assistance from your appropriate
support organization.
;; This defines the DRAW-LINE generic operation
(define-graphics-operation draw-line (x1 y1 x2 y2)
:arguments ((point x1 y1 x2 y2))
:drawing-options :line-cap
:method-body
(with-transformed-arguments
(draw-line-internal stream 0 0 x1 y1 x2 y2
(medium-ink stream) (medium-line-style stream))))
;; This defines the internal methods for output recording
(define-graphics-internal draw-line-internal (x1 y1 x2 y2 ink line-style)
:points-to-convert (x1 y1 x2 y2)
:bounding-rectangle
(with-half-thickness (lthickness rthickness) line-style
(fix-rectangle (- (min x1 x2) lthickness) (- (min y1 y2) lthickness)
(+ (max x1 x2) rthickness) (+ (max y1 y2) rthickness)))
:highlighting-test
((x y)
(with-slots (x1 y1 x2 y2 line-style) record
(point-close-to-line-p x y x1 y1 x2 y2 (line-style-thickness line-style))))
:highlighting-function
((stream state)
(declare (ignore state)) ;for now.
(multiple-value-bind (xoff yoff)
(convert-from-relative-to-absolute-coordinates
stream (output-record-parent record))
(with-slots (x1 y1 x2 y2 line-style) record
(outline-line-with-hexagon stream xoff yoff
x1 y1 x2 y2 (line-style-thickness line-style))))))
;; Here is the CLX code that actually draws the line
(defmethod draw-line-internal ((stream clx-window) x-offset y-offset
start-x start-y end-x end-y ink line-style)
(fix-points start-x end-x start-y end-y)
(translate-positions x-offset y-offset start-x start-y end-x end-y)
(with-slots (window) stream
(xlib:draw-line window
(clx-adjust-ink (clx-decode-ink ink stream) stream line-style)
start-x start-y end-x end-y))
(clx-force-output-if-necessary stream))
Also, note that :SINGLE-BOX T does not affect drawing speed. It affects
only how sensitivity and highlighting is done.