patchGNUstep - Patches: patch #6630, Patch to always check -isFlipped...

Group
 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #6630: Patch to always check -isFlipped as Cocoa does rather than accessing the flag directly

Submitter:  Quentin Mathé <qmathe>
Submitted:  Wed 03 Sep 2008 05:53:02 PM UTC
   
 
Category:  AppKit Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Sun 07 Sep 2008 12:13:28 PM UTC, comment #3: 

Good point. I would expect that the optimisation is used less then five times per drawing request on each view. But it will be hard to count.

A grep on flipped_view shows that this mostly is used for NSScrollView and there is another hack in place for NSClipView.
(Apart from the usage in NSView and one marginal case in NSSplitView) Only the usage in NSView could be performance critical, as far as I can tell.

My current idea is to set this variable in _rebuildCoordinates, that way we have the correct value and as long as nothing changes the method wont get called.

Still, if the ivar only gets used as little as we all expect, we might as well remove it.

Fred Kiefer <FredKiefer>
Group Member
Sun 07 Sep 2008 09:34:46 AM UTC, comment #2: 

Well ... I don't remember much about this, so I can only state the obvious ...

how often would -isFlipped be called when a standard window is drawn ?  Is
it 10 times, 1k times, 10k times ?  That gives you an idea of how important
it would be to keep the optimization ...

If the optimization is useful, then maybe you could compute the flag once
at the beginning of each draw cycle ?

Anyway my guess is that it's quite likely that the optimization can go away
without any noticeable impact on the performance, but it's worth checking

Thanks

Nicola Pero <nico>
Group Member
Sat 06 Sep 2008 10:07:20 PM UTC, comment #1: 

Your patch removes only two usages of this flag from the code. I am not sure, whether this approach would create even more problems in the long run. Shouldn't we remove this optimisation completely?

Nicola, what is your opinion here, if I remember correctly it was you how introduced this bit.

Fred Kiefer <FredKiefer>
Group Member
Wed 03 Sep 2008 05:53:02 PM UTC, original submission:  

Here is a patch to ensure the flipping is always determined by calling -isFlipped as Cocoa does instead of accessing _rFlags.flipped_view.

To take a concrete example… If an NSView subclass adds a setter -setFlipped: and stores the flipping value in a subclass specific ivar (instead of _rFlags.flipped_view), then -setFlipped: YES isn't handled properly: the drawing and the resizing could behave in a really weird way. GNUstep has this problem because it caches -isFlipped in the initializer, then accesses the flipping value through the _rFlags.

My current workaround to this solution is to access _rFlags.flipped_view directly on GNUstep. But this patch would eliminate this need and make GNUstep AppKit matches Cocoa behavior.

Quentin.

Quentin Mathé <qmathe>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nico (Posted a comment)
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by qmathe (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-27 FredKiefer StatusNone Done
        Open/ClosedOpen Closed
    2008-09-03 qmathe Attached File- Added NSView-flipping.m.patch, #16424

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code