Use mapped memory for uploading large textures.
commit4e297d74fef5371fe545e994aa479c5e7b7eb2f9
authordyen <dyen@chromium.org>
Wed, 10 Jun 2015 23:56:22 +0000 (10 16:56 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 10 Jun 2015 23:57:02 +0000 (10 23:57 +0000)
tree53e127684e72325fec2a6ae62100dcb995246650
parent8bbf734edbf7455530ee06e6a3c6293f6eca0b47
Use mapped memory for uploading large textures.

When TexImage2D/TexImage3D is called with an image that is larger than
the ring buffer, we had previously fallen back to calling
TexSubImage2D/TexSubImage3D multiple times. This is suboptimal because
we always issue a clear along with TexSubImage calls for security
reasons (the image is not being completely replaced so we do not want
to leak old texture data).

This CL now makes it so it falls back to using mapped memory instead. If
we run out of memory, then we fall back to TexSubImage2D as we did
before.

R=jbauman@chromium.org, piman@chromium.org
BUG=462078

Review URL: https://codereview.chromium.org/1168853002

Cr-Commit-Position: refs/heads/master@{#333851}
gpu/command_buffer/client/gles2_implementation.cc
gpu/command_buffer/client/gles2_implementation_unittest.cc
gpu/command_buffer/client/mapped_memory.cc
gpu/command_buffer/client/mapped_memory.h
gpu/command_buffer/client/mapped_memory_unittest.cc
gpu/command_buffer/client/ring_buffer.cc
gpu/command_buffer/client/ring_buffer.h
gpu/command_buffer/client/ring_buffer_test.cc
gpu/command_buffer/client/transfer_buffer.cc
gpu/command_buffer/client/transfer_buffer.h