1

I use a big picture(33440 x 440) and transform the big image, then achieve a animation like as frame animation; and also I use the translate3D to get a GPU Acceleration,

simplified code below:

 @keyframes testName { 0% { transform: translate3d(0,0,0); } 100% { transform: translate3d(-33440px,0,0); } } 

as we know, the work of composite layers will move to GPU; but in chrome devtools of performance, the task of composite layers in main thread cost too much time: (decode image happens in raster thread not in main thread) enter image description here enter image description here

so why and what the taskcomposite layers did in main thread?

1 Answer 1

1

The problem is that your image is HUGE. "Compositing layers" roughly means rendering all of the elements (layers) on the page on top of each other in the correct order and location, which will take a long time if these layers are gigantic. Just because it's happening on the GPU doesn't mean it will happen instantly if you throw a 14 megapixel image into it.

Sign up to request clarification or add additional context in comments.

4 Comments

can you be more detail? Where did “this long time” take?
or what dose composite layers means in Chrome Dev Tools?
Encountered this as well, with an image of 16000x9000 that was scaled down to a thumbnail - when any animations are enabled Chrome becomes basically unresponsive. Seemed to work a lot better in other browsers though.
@SKing7 did you find a solution apart from resizing/optimizing the image?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.