Lines Matching refs:Texture
66 mCache(LruCache<GradientCacheEntry, Texture*>::kUnlimitedCapacity),
86 mCache(LruCache<GradientCacheEntry, Texture*>::kUnlimitedCapacity),
118 void GradientCache::operator()(GradientCacheEntry& shader, Texture*& texture) {
119 if (texture) {
120 const uint32_t size = texture->width * texture->height * bytesPerPixel();
123 texture->deleteTexture();
124 delete texture;
132 Texture* GradientCache::get(uint32_t* colors, float* positions, int count) {
134 Texture* texture = mCache.get(gradient);
136 if (!texture) {
137 texture = addLinearGradient(gradient, colors, positions, count);
140 return texture;
170 Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient,
176 Texture* texture = new Texture();
177 texture->width = info.width;
178 texture->height = 2;
179 texture->blend = info.hasAlpha;
180 texture->generation = 1;
183 const uint32_t size = texture->width * texture->height * bytesPerPixel();
188 generateTexture(colors, positions, count, texture);
191 mCache.put(gradient, texture);
193 return texture;
242 int count, Texture* texture) {
243 const uint32_t width = texture->width;
245 uint8_t pixels[rowBytes * texture->height];
288 glGenTextures(1, &texture->id);
289 Caches::getInstance().bindTexture(texture->id);
294 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, width, texture->height, 0,
297 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, texture->height, 0,
301 texture->setFilter(GL_LINEAR);
302 texture->setWrap(GL_CLAMP_TO_EDGE);