Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Dynamically created canvas elements V.S Static canvas tags in html (in case of simulating multiple layers)

Here I am actually talking about performance question.

I've already done some research about creating layers in html canvas projects, and I found in most tuts, they just told me to write a lot of static html canvas tags, then get context from each of them (then use css / absolution position/ z-index to simulate the order of layers).

But I am wondering if THIS WAY is better:

  1. write only ONE canvas tag(and let's call it background canvas) in html.
  2. create other canvas element using createElement api for each layer, but not appending them into DOM.
  3. get context from these "virtual" canvas(which is dynamically created)
  4. use canvas api to draw things on these "virtual" canvas.
  5. use requestAnimationFrame and drawImage to draw every "virtual" canvas onto background canvas

Actually, I thought dynamically created canvas is more acceptable/flexible to me, but I don't have a lot of experience in canvas performance optimization (And it's why I am here).

I think I need some guide about how to test performance of this two cases.

If anyone here have any suggestion will be appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!