Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda