Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda