Lines Matching refs:texture

1 /* libs/opengles/texture.cpp
23 #include "texture.h"
33 ogles_context_t* c, int tmu, GLuint texture, const sp<EGLTextureObject>& tex);
50 // each context has a default named (0) texture (not shared)
54 // bind the default texture to each texture unit
57 memset(c->current.texture[i].v, 0, sizeof(vec4_t));
58 c->current.texture[i].Q = 0x10000;
68 if (c->textures.tmu[i].texture)
69 c->textures.tmu[i].texture->decStrong(c);
80 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
86 GGL_TEXTURE_WRAP_S, u.texture->wraps);
88 GGL_TEXTURE_WRAP_T, u.texture->wrapt);
90 GGL_TEXTURE_MIN_FILTER, u.texture->min_filter);
92 GGL_TEXTURE_MAG_FILTER, u.texture->mag_filter);
94 // disable this texture unit if it's not complete
95 if (!u.texture->isComplete()) {
104 if (c->rasterizer.state.texture[i].enable)
126 if (c->rasterizer.state.texture[i].enable) {
128 ANativeWindowBuffer* native_buffer = u.texture->buffer;
144 u.texture->setImageBits(vaddr);
145 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
154 if (c->rasterizer.state.texture[i].enable) {
156 ANativeWindowBuffer* native_buffer = u.texture->buffer;
167 u.texture->setImageBits(NULL);
168 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
316 if (u.texture)
317 u.texture->decStrong(c);
320 // 0 is our local texture object, not shared with anyone.
322 // (we need to invalidate all units bound to this texture object)
325 if (c->textures.tmu[i].texture == tex.get())
329 // get a new texture object for that name
333 // bind this texture to the current active texture unit
334 // and add a reference to this texture object
335 u.texture = tex.get();
336 u.texture->incStrong(c);
343 ogles_context_t* c, int tmu, GLuint texture, const sp<EGLTextureObject>& tex)
345 if (tex.get() == c->textures.tmu[tmu].texture)
350 if (u.texture)
351 u.texture->decStrong(c);
353 // bind this texture to the current active texture unit
354 // and add a reference to this texture object
355 u.texture = tex.get();
356 u.texture->incStrong(c);
357 u.name = texture;
366 // find out which texture is bound to the current unit
385 EGLTextureObject* tex = c->textures.tmu[active].texture;
621 EGLTextureObject* tex = c->textures.tmu[active].texture;
640 EGLTextureObject* textureObject = c->textures.tmu[c->textures.active].texture;
701 // set up all texture units
703 if (!c->rasterizer.state.texture[i].enable)
718 EGLTextureObject* textureObject = u.texture;
724 // computes texture coordinates (pre-multiplied)
771 // texture unit active and no scaling is required
778 EGLTextureObject* textureObject = u.texture;
787 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
789 GGL_TEXTURE_MIN_FILTER, u.texture->min_filter);
791 GGL_TEXTURE_MAG_FILTER, u.texture->mag_filter);
854 void glActiveTexture(GLenum texture)
857 if (uint32_t(texture-GL_TEXTURE0) > uint32_t(GGL_TEXTURE_UNIT_COUNT)) {
861 c->textures.active = texture - GL_TEXTURE0;
865 void glBindTexture(GLenum target, GLuint texture)
873 // Bind or create a texture
875 if (texture == 0) {
876 // 0 is our local texture object
879 tex = c->surfaceManager->texture(texture);
881 tex = c->surfaceManager->createTexture(texture);
888 bindTextureTmu(c, c->textures.active, texture, tex);
898 // generate unique (shared) texture names
910 // If deleting a bound texture, bind this unit to 0
916 // bind this tmu to texture 0
935 c->current.texture[tmu].S = gglFloatToFixed(s);
936 c->current.texture[tmu].T = gglFloatToFixed(t);
937 c->current.texture[tmu].R = gglFloatToFixed(r);
938 c->current.texture[tmu].Q = gglFloatToFixed(q);
950 c->current.texture[tmu].S = s;
951 c->current.texture[tmu].T = t;
952 c->current.texture[tmu].R = r;
953 c->current.texture[tmu].Q = q;
1019 EGLTextureObject* textureObject = c->textures.tmu[c->textures.active].texture;
1071 // "uncompress" the texture since pixelflinger doesn't support
1072 // any compressed texture format natively.
1253 // find out which texture is bound to the current unit
1255 EGLTextureObject* tex = c->textures.tmu[active].texture;
1307 // since we only changed the content of the texture, we don't need
1355 // figure out the format to use for the new texture
1382 // create the new texture...
1437 // find out which texture is bound to the current unit
1439 EGLTextureObject* tex = c->textures.tmu[active].texture;
1627 // bind it to the texture unit