diff options
Diffstat (limited to 'libs/hwui/Layer.cpp')
-rw-r--r-- | libs/hwui/Layer.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp index 31e169b..76b274b 100644 --- a/libs/hwui/Layer.cpp +++ b/libs/hwui/Layer.cpp @@ -25,10 +25,29 @@ namespace android { namespace uirenderer { +Layer::Layer(const uint32_t layerWidth, const uint32_t layerHeight) { + mesh = NULL; + meshIndices = NULL; + meshElementCount = 0; + cacheable = true; + textureLayer = false; + renderTarget = GL_TEXTURE_2D; + texture.width = layerWidth; + texture.height = layerHeight; + colorFilter = NULL; + deferredUpdateScheduled = false; + renderer = NULL; + displayList = NULL; + fbo = 0; + Caches::getInstance().resourceCache.incrementRefcount(this); +} + Layer::~Layer() { if (mesh) delete mesh; if (meshIndices) delete meshIndices; if (colorFilter) Caches::getInstance().resourceCache.decrementRefcount(colorFilter); + if (fbo) Caches::getInstance().fboCache.put(fbo); + deleteTexture(); } void Layer::setPaint(SkPaint* paint) { |