GC manipulation - Xwindows

This is a discussion on GC manipulation - Xwindows ; Is is quicker for the program to create a new GC up front and keep it in waiting for the code to call upon it, than it is the call XChangeGC on demand?...

+ Reply to Thread
Results 1 to 4 of 4

Thread: GC manipulation

  1. GC manipulation

    Is is quicker for the program to create a new GC up front and keep it in
    waiting for the code to call upon it, than it is the call XChangeGC on
    demand?



  2. Re: GC manipulation

    Eigenvector wrote:
    > Is it quicker for the program to create a new GC up front and keep it in
    > waiting for the code to call upon it, than it is the call XChangeGC on
    > demand?


    If you have two GCs that you frequently swap between, then it would be
    faster to keep two separate GCs than to keep modifying one GC.

  3. Re: GC manipulation


    "Russell Shaw" wrote in message
    news:kl22s3-1e2.ln1@main.anatron.com.au...
    > Eigenvector wrote:
    >> Is it quicker for the program to create a new GC up front and keep it in
    >> waiting for the code to call upon it, than it is the call XChangeGC on
    >> demand?

    >
    > If you have two GCs that you frequently swap between, then it would be
    > faster to keep two separate GCs than to keep modifying one GC.


    So then it more of a matter of resource management than anything.



  4. Re: GC manipulation

    Eigenvector wrote:
    > "Russell Shaw" wrote in message
    > news:kl22s3-1e2.ln1@main.anatron.com.au...
    >
    >>Eigenvector wrote:
    >>
    >>>Is it quicker for the program to create a new GC up front and keep it in
    >>>waiting for the code to call upon it, than it is the call XChangeGC on
    >>>demand?

    >>
    >>If you have two GCs that you frequently swap between, then it would be
    >>faster to keep two separate GCs than to keep modifying one GC.

    >
    > So then it more of a matter of resource management than anything.


    You can easily have hundreds of GCs ok. The main reason to do it is
    to minimize network traffic (which makes things faster) if you want to
    redraw a non-double-buffered picture that has thousands of different
    lines and colours.

+ Reply to Thread