On Sep 21, 2009, at 9:38 AM, Sean Gilligan wrote:

> Simon Fraser wrote:
>> If you're changing -webkit-transition "by hand" from JavaScript and
>> want to achieve good performance (e.g. maybe you're responding to
>> touch events from the user, moving things around), then use one
>> of the 3d transform types: translate3d(), rotate3d() etc. Those
>> will be faster in this case.
>>
>
> Is there a reason why the 3d types are faster in this case?

Yes.

In iPhone 2.0, whenever you set -webkit-transform: to something,
the browser would go and render that element to a texture, so
animating it was then much more efficient. It would also use
textures for animations/transitions of opacity.

However, that wasted texture memory when the -webkit-transform
was just for a static visual effect, and never animated. So, in
iPhone 3.0, the rule was changed to only render something into
a texture in two situations:
1. The transform includes a 3d transform function (like translate3d())
2. The element is animating -webkit-transform or opacity.
In any other situations, the element is rendered in software, and thus
animates in software, just like 'left'. This typically gives poor  
framerates
on the phone.

So you can consider the 3d transform functions to be a hint that
you are going to be moving something around a lot in JS, and
to thus keep that element in a texture.

Simon


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to