From 2055abaa0a590c35e27e1ae2e7d7cfccdfb98b59 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 18 Jan 2013 16:42:51 -0800 Subject: 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 --- libs/hwui/LayerCache.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'libs/hwui/LayerCache.cpp') 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; -- cgit v1.2.3-59-g8ed1b