Home | History | Annotate | Download | only in libagl

Lines Matching refs:texture

1 /* libs/opengles/texture.cpp
23 #include "texture.h"
34 ogles_context_t* c, int tmu, GLuint texture, const sp<EGLTextureObject>& tex);
51 // each context has a default named (0) texture (not shared)
55 // bind the default texture to each texture unit
58 memset(c->current.texture[i].v, 0, sizeof(vec4_t));
59 c->current.texture[i].Q = 0x10000;
69 if (c->textures.tmu[i].texture)
70 c->textures.tmu[i].texture->decStrong(c);
81 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
87 GGL_TEXTURE_WRAP_S, u.texture->wraps);
89 GGL_TEXTURE_WRAP_T, u.texture->wrapt);
91 GGL_TEXTURE_MIN_FILTER, u.texture->min_filter);
93 GGL_TEXTURE_MAG_FILTER, u.texture->mag_filter);
95 // disable this texture unit if it's not complete
96 if (!u.texture->isComplete()) {
105 if (c->rasterizer.state.texture[i].enable)
127 if (c->rasterizer.state.texture[i].enable) {
129 android_native_buffer_t* native_buffer = u.texture->buffer;
145 u.texture->setImageBits(vaddr);
146 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
155 if (c->rasterizer.state.texture[i].enable) {
157 android_native_buffer_t* native_buffer = u.texture->buffer;
168 u.texture->setImageBits(NULL);
169 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
317 if (u.texture)
318 u.texture->decStrong(c);
321 // 0 is our local texture object, not shared with anyone.
323 // (we need to invalidate all units bound to this texture object)
326 if (c->textures.tmu[i].texture == tex.get())
330 // get a new texture object for that name
334 // bind this texture to the current active texture unit
335 // and add a reference to this texture object
336 u.texture = tex.get();
337 u.texture->incStrong(c);
344 ogles_context_t* c, int tmu, GLuint texture, const sp<EGLTextureObject>& tex)
346 if (tex.get() == c->textures.tmu[tmu].texture)
351 if (u.texture)
352 u.texture->decStrong(c);
354 // bind this texture to the current active texture unit
355 // and add a reference to this texture object
356 u.texture = tex.get();
357 u.texture->incStrong(c);
358 u.name = texture;
367 // find out which texture is bound to the current unit
386 EGLTextureObject* tex = c->textures.tmu[active].texture;
622 EGLTextureObject* tex = c->textures.tmu[active].texture;
641 EGLTextureObject* textureObject = c->textures.tmu[c->textures.active].texture;
702 // set up all texture units
704 if (!c->rasterizer.state.texture[i].enable)
719 EGLTextureObject* textureObject = u.texture;
725 // computes texture coordinates (pre-multiplied)
772 // texture unit active and no scaling is required
779 EGLTextureObject* textureObject = u.texture;
788 c->rasterizer.procs.bindTexture(c, &(u.texture->surface));
790 GGL_TEXTURE_MIN_FILTER, u.texture->min_filter);
792 GGL_TEXTURE_MAG_FILTER, u.texture->mag_filter);
852 #pragma mark Texture API
855 void glActiveTexture(GLenum texture)
858 if (uint32_t(texture-GL_TEXTURE0) > uint32_t(GGL_TEXTURE_UNIT_COUNT)) {
862 c->textures.active = texture - GL_TEXTURE0;
866 void glBindTexture(GLenum target, GLuint texture)
874 // Bind or create a texture
876 if (texture == 0) {
877 // 0 is our local texture object
880 tex = c->surfaceManager->texture(texture);
882 tex = c->surfaceManager->createTexture(texture);
889 bindTextureTmu(c, c->textures.active, texture, tex);
899 // generate unique (shared) texture names
911 // If deleting a bound texture, bind this unit to 0
917 // bind this tmu to texture 0
936 c->current.texture[tmu].S = gglFloatToFixed(s);
937 c->current.texture[tmu].T = gglFloatToFixed(t);
938 c->current.texture[tmu].R = gglFloatToFixed(r);
939 c->current.texture[tmu].Q = gglFloatToFixed(q);
951 c->current.texture[tmu].S = s;
952 c->current.texture[tmu].T = t;
953 c->current.texture[tmu].R = r;
954 c->current.texture[tmu].Q = q;
1020 EGLTextureObject* textureObject = c->textures.tmu[c->textures.active].texture;
1072 // "uncompress" the texture since pixelflinger doesn't support
1073 // any compressed texture format natively.
1254 // find out which texture is bound to the current unit
1256 EGLTextureObject* tex = c->textures.tmu[active].texture;
1308 // since we only changed the content of the texture, we don't need
1356 // figure out the format to use for the new texture
1383 // create the new texture...
1438 // find out which texture is bound to the current unit
1440 EGLTextureObject* tex = c->textures.tmu[active].texture;
1628 // bind it to the texture unit