OSDN Git Service

Forget the name of a texture after freeing
authorRomain Guy <romainguy@google.com>
Mon, 14 May 2012 22:32:18 +0000 (15:32 -0700)
committerRomain Guy <romainguy@google.com>
Mon, 14 May 2012 22:32:18 +0000 (15:32 -0700)
commit99a6ddd4cd8762654a575eb4ac3d0e5431d919b8
tree998293d1bb9efd6b3e0fe2dcb6c994a377c98d8b
parent9d9758ae30a59dcf594e0d26ba5d4ee153a3e44a
Forget the name of a texture after freeing
Bug #6408362

FontRenderer allocates large font textures when more room is needed
to store all the glyphs used by an application. Thse large textures
are the first to be freed when memory needs to be reclaimed by the
system. When freeing a texture, the renderer would however not set
the texture name to an invalid name, leading future allocations to
be performed on the same texture name. That name could have by then
be recycled by the driver and returned by a call to glGenTexture
and used to create an entirely different texture. This would cause
the font renderer to point to the wrong texture, thus leading to
the "corruptions."

Change-Id: I8a1e80e5b79e8f21d1baf5320c090df4f2066cd4
libs/hwui/FontRenderer.cpp
libs/hwui/FontRenderer.h