tangrams/tangram — pull request #76 by bcamper (2014-12-28 23:05:46+00:00)
Title: Sprites + texture utils

Adds functionality for more easily mapping textures, and sprites (sub-areas of textures) onto polys. This can be used to create 'icon' styles (for POIs, etc.). TODO: add a built-in 'icons' style to simplify this process further, currently creating an icon style from polygons still requires setting a few flags, these can be easily pre-set instead.

Also adds a number of texture-related functions, such as auto-setting uniform samplers for one or more textures (see [here](https://github.com/tangrams/tangram/compare/icons#diff-e90eeb4f0c5a50cd03b669245e7e0724R112)).

Also adds a facility for the WorkerBroker to makes calls **from the worker** to the main thread, following the existing pattern used for calls from main thread to workers (a set of pending messages is kept, and return values are delivered as promises). This is currently only used when the workers request that texture info (width/height, needed for sprite UV calculation) be synced from the main thread, but will be used for other similar sync operations in the future.