gnustep-dev
[Top][All Lists]
Advanced

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

Re: High-DPI screenshot


From: Quentin Mathé
Subject: Re: High-DPI screenshot
Date: Wed, 20 Apr 2011 13:19:13 +0200

Le 19 avr. 2011 à 23:16, Eric Wasylishen a écrit :

> On 2011-04-17, at 5:51 AM, Quentin Mathé wrote:
> 
>> Le 17 avr. 2011 à 04:10, Eric Wasylishen a écrit :
>> 
>>> On 2011-04-16, at 5:40 PM, Fred Kiefer wrote:
>>> 
>>>> This change is probably related to the change in _rebuildCoordinates, 
>>>> which I didn't quite understand.
>>>> 
>>> In _rebuildCoordinates, there was a special case which made the assumption 
>>> that the topmost view in a window has the identity transformation matrix 
>>> (bounds = frame). With my patch that is not necessarily true anymore, so I 
>>> had to rework the method to remove that assumption.
>> 
>> On this topic, NSView might need to call _rebuildCoordinates more often that 
>> we do. For example, suppose -isFlipped is switched to YES, then a point or 
>> rect conversion method is called, shouldn't _rebuildCoordinates being called 
>> if wasFlipped doesn't match isFlipped? I haven't tried it, but I suspect Mac 
>> OS X takes in account -isFlipped change in various cases we don't cover such 
>> as conversion methods. In our case, a redraw is necessary before the 
>> flipping change is fully taken in account.
>> 
> Hm, good point. Do you know if a view is allowed to return different values 
> from -isFlipped during its lifetime?

Yes, it has always been supported on Mac OS X (and since last year on GNUstep).

> It doesn't seem too useful to me.

Graphics editors are good use cases (it's minor, but this way you can avoid to 
touch the bounds transform to set the basic orientation). 
I support that in EtoileUI.

> My rewritten conversion methods now call [self _matrixFromWindow] rather than 
> (possibly) calling [self _rebuildCoordinates] and then reading the ivar 
> directly, so they are less fragile if we make changes in the future.

Agreed. By looking at the current code, we could just use the method below 
rather than the direct ivar acces with _coordinatesValid, to get -isFlipped 
change handled immediately in all cases.

-_areCoordinatesValid
{
        return _coordinatesValid && isFlipped == wasFlipped;
}

>>>> The change on NSCachedImageRep seems fine to me.
>>>> 
>>>> The biggest change is, I think, the one to NSImage. Here the central 
>>>> drawing method gets replaced. It seems that the change matches the Apple 
>>>> documentation, but we will need more tests to decide whether it matches 
>>>> the actual implementation. You already noticed that. If this really works 
>>>> we get ride of one of the drawing primitives which would make the backend 
>>>> interaction a lot simpler.
>>> 
>>> I agree, it's a big change and will need testing. :-) 
>> 
>> Does -compositeToPoint: still work the same than on Mac OS X when you start 
>> to rotate the bounds or frame of superviews?
>> 
> Yes, it seems to work correctly with rotation.

Great :-)

>> The downside of this change is that it's going to make -compositeToPoint: 
>> slower, but not in a way that matters I think.
>> 
> Agreed. I want to do some more cleanup on NSImage in the future.

Yes, that would be nice. Apple also changed the API a lot in 10.6. However it 
involves to support almost two NSImage behaviors now.
The new behavior is documented extensively in the Mac OS X SnowLeopard Release 
Notes for AppKit.

Cheers,
Quentin.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]