[canvaskit] Use proper texture tracking method

The emscripten generated GL texture tracking code uses an
integer, not the length of the textures array.
https://github.com/emscripten-core/emscripten/blob/a8e7d3b8f27b05eb39b73151e1ff2914241acae8/src/library_webgl.js#L242
I believe this is to make sure a texture and buffer do
not share the same handle.

Therefore, we must use this method when making our own
additions to the textures array, otherwise Skia-created
textures will overlap with supplied textures, causing
mis-drawings and feedback loops.

Change-Id: I4e1be5ff2b0c3d1ba5f5984232980724cb492313
Bug: skia:12797
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/495416
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2 files changed