summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Layer.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Layer.h')
-rw-r--r--libs/hwui/Layer.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index 181eb6c..9ef4894 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -48,7 +48,12 @@ struct Layer {
Layer(const uint32_t layerWidth, const uint32_t layerHeight);
~Layer();
- void removeFbo();
+ /**
+ * Calling this method will remove (either by recycling or
+ * destroying) the associated FBO, if present, and any render
+ * buffer (stencil for instance.)
+ */
+ void removeFbo(bool flush = true);
/**
* Sets this layer's region to a rectangle. Computes the appropriate
@@ -134,6 +139,14 @@ struct Layer {
return fbo;
}
+ inline void setStencilRenderBuffer(GLuint renderBuffer) {
+ this->stencil = renderBuffer;
+ }
+
+ inline GLuint getStencilRenderBuffer() {
+ return stencil;
+ }
+
inline GLuint getTexture() {
return texture.id;
}
@@ -212,10 +225,6 @@ struct Layer {
texture.id = 0;
}
- inline void deleteFbo() {
- if (fbo) glDeleteFramebuffers(1, &fbo);
- }
-
inline void allocateTexture(GLenum format, GLenum storage) {
#if DEBUG_LAYERS
ALOGD(" Allocate layer: %dx%d", getWidth(), getHeight());
@@ -275,6 +284,12 @@ private:
GLuint fbo;
/**
+ * Name of the render buffer used as the stencil buffer. If the
+ * name is 0, this layer does not have a stencil buffer.
+ */
+ GLuint stencil;
+
+ /**
* Indicates whether this layer has been used already.
*/
bool empty;