Lines Matching refs:texture
98 void GradientCache::operator()(GradientCacheEntry& shader, Texture*& texture) {
99 if (texture) {
100 const uint32_t size = texture->width * texture->height * GRADIENT_BYTES_PER_PIXEL;
104 if (texture) {
105 glDeleteTextures(1, &texture->id);
106 delete texture;
117 Texture* texture = mCache.get(gradient);
119 if (!texture) {
120 texture = addLinearGradient(gradient, colors, positions, count);
123 return texture;
156 Texture* texture = new Texture;
157 texture->width = info.width;
158 texture->height = GRADIENT_TEXTURE_HEIGHT;
159 texture->blend = info.hasAlpha;
160 texture->generation = 1;
163 const uint32_t size = texture->width * texture->height * GRADIENT_BYTES_PER_PIXEL;
168 generateTexture(colors, positions, count, texture);
171 mCache.put(gradient, texture);
173 return texture;
177 int count, Texture* texture) {
179 const uint32_t width = texture->width;
181 uint32_t pixels[width * texture->height];
232 glGenTextures(1, &texture->id);
234 glBindTexture(GL_TEXTURE_2D, texture->id);
237 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, texture->height, 0,
240 texture->setFilter(GL_LINEAR);
241 texture->setWrap(GL_CLAMP_TO_EDGE);