diff options
author | 2013-01-18 16:42:51 -0800 | |
---|---|---|
committer | 2013-01-18 16:42:51 -0800 | |
commit | 2055abaa0a590c35e27e1ae2e7d7cfccdfb98b59 (patch) | |
tree | 1e302d08b6aa3714048a4d8435aa44f155c998c9 /libs/hwui/LayerCache.cpp | |
parent | f25febf01453733e8bdd1ac241ecd9d3bcbef475 (diff) |
Allow layers with a stencil buffer to be resized on the fly
Bug #7146141
This change moves the resizeLayer() from LayerCache (where it should
never have been anyway) to Layer. This makes a little more sense.
Change-Id: I8b2f9c19c558e738405a58b9e71ec5799fc6be88
Diffstat (limited to 'libs/hwui/LayerCache.cpp')
-rw-r--r-- | libs/hwui/LayerCache.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp index cfc5b04f2183..427846459162 100644 --- a/libs/hwui/LayerCache.cpp +++ b/libs/hwui/LayerCache.cpp @@ -136,31 +136,6 @@ void LayerCache::dump() { } } -bool LayerCache::resize(Layer* layer, const uint32_t width, const uint32_t height) { - // TODO: We should be smarter and see if we have a texture of the appropriate - // size already in the cache, and reuse it instead of creating a new one - - LayerEntry entry(width, height); - if (entry.mWidth <= layer->getWidth() && entry.mHeight <= layer->getHeight()) { - return true; - } - - uint32_t oldWidth = layer->getWidth(); - uint32_t oldHeight = layer->getHeight(); - - Caches::getInstance().activeTexture(0); - layer->bindTexture(); - layer->setSize(entry.mWidth, entry.mHeight); - layer->allocateTexture(GL_RGBA, GL_UNSIGNED_BYTE); - - if (glGetError() != GL_NO_ERROR) { - layer->setSize(oldWidth, oldHeight); - return false; - } - - return true; -} - bool LayerCache::put(Layer* layer) { if (!layer->isCacheable()) return false; |