Giter VIP home page Giter VIP logo

Comments (5)

hyperandroid avatar hyperandroid commented on August 15, 2024

Hi,

it's not been planned such a feature. I've always believed it to be counterproductive unless in very specific situations like few on-screen actors. For example, the need of tracking per actor on-screen coordinates, the need to union different affected areas, the need to set a clip rectangle to redraw only affected areas etc. make me think about that probably all that extra code complexity and its execution overhead is not worth the saved drawing time. sometimes
surely i'm wrong, so please, proof me I am. ^^
will keep this issue open and think about it.
Thanks for asking,
best.

from caat.

ngryman avatar ngryman commented on August 15, 2024

Just for info, a little jsfiddle : http://jsfiddle.net/mgbUc/6/.

I have different results, very surprising results ...

  • iPhone 4 / iOS 5.0.1 : same results.
  • iPhone 4, iPad 1, iPad 2 / iOS 4.2.1 : 4 times faster with invalidation.
  • Samsung Teos / Android 2.1 : 10 times faster without invalidation Oo
  • Samsung Galaxy Note / Android 2.3.6 : same results.

Of course this is a a very basic example, there is no clipping algorithm, and just one square moving ^^ ...
Clear operation is meant to be quite expensive on not accelerated device, but apparently some progress have been done in recent versions of iOS / Android.

I would like to test a very basic invalidation algorithm with CAAT to ... invalidate ^^ or validate if it can be useful or not.
Can you tell me how do you build CAAT ? And where do you think is the best place to put this code ?

Thanks a lot :)

from caat.

hyperandroid avatar hyperandroid commented on August 15, 2024

Hey there,

I've made some code changes regarding coordinate clamping from float to integer. You should notice a performance improvement while in mobile canvas. Could you confirm it ?
Despite I think in most situations is not worth it, I'm taking seriously the possibility of setting a dirty rectangle redraw mechanism which should be explicitly allowed by the developer. Unfortunately, I can't tell when.
Thanks,
-ibon

from caat.

ngryman avatar ngryman commented on August 15, 2024

Yeah that's a very cool improvement ;)
I think this will improve performances on non-hardware accelerated devices (every mobile devices indeed).
I will update CAAT and report any changes in perfs.

The solution of giving the programmer the ability to specify a list of dirty rectangles and apply it, is a great compromise.
Anyone could adapt his own invalidation mechanism following his needs.

My test results are very strange, I would like to know if I get the same results in a much more complex scene using CAAT.
So, this update will be very interesting for me ;)

Thanks a lot.

from caat.

hyperandroid avatar hyperandroid commented on August 15, 2024

Hey Nicholas,

have made some changes to CAAT and added an experimental dirty rectangles clearing procedure.
To be enabled you must call director.setClear( CAAT.Director.CLEAR_DIRTY_RECTS );
Every actor which changes affine transformation, either position, rotation or scale, will automatically be invalidated. In you want any other actor to be explicitly invalidated, just call actor.invalidate();

Let me know how it works for you.

-ibon

from caat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.