Remove C++11 related warning
Change-Id: I250ff7bd0ea49908e11b14c995d77312cd09a8b4
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index c7a2014..ca9a38e 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -183,14 +183,7 @@
updateLayers();
- // If we know that we are going to redraw the entire framebuffer,
- // perform a discard to let the driver know we don't need to preserve
- // the back buffer for this frame.
- if (mCaches.extensions.hasDiscardFramebuffer() &&
- left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) {
- const GLenum attachments[] = { getTargetFbo() == 0 ? GL_COLOR_EXT : GL_COLOR_ATTACHMENT0 };
- glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments);
- }
+ discardFramebuffer(left, top, right, bottom);
syncState();
@@ -207,6 +200,18 @@
return clear(left, top, right, bottom, opaque);
}
+void OpenGLRenderer::discardFramebuffer(float left, float top, float right, float bottom) {
+ // If we know that we are going to redraw the entire framebuffer,
+ // perform a discard to let the driver know we don't need to preserve
+ // the back buffer for this frame.
+ if (mCaches.extensions.hasDiscardFramebuffer() &&
+ left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) {
+ const GLenum attachments[] = { getTargetFbo() == 0 ? (const GLenum) GL_COLOR_EXT :
+ (const GLenum) GL_COLOR_ATTACHMENT0 };
+ glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments);
+ }
+}
+
status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) {
if (!opaque) {
mCaches.enableScissor();
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index c5e4c8e..f165581 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -366,6 +366,13 @@
private:
/**
+ * Discards the content of the framebuffer if supported by the driver.
+ * This method should be called at the beginning of a frame to optimize
+ * rendering on some tiler architectures.
+ */
+ void discardFramebuffer(float left, float top, float right, float bottom);
+
+ /**
* Ensures the state of the renderer is the same as the state of
* the GL context.
*/
diff --git a/libs/hwui/SkiaShader.h b/libs/hwui/SkiaShader.h
index 2687592..bc12b0d 100644
--- a/libs/hwui/SkiaShader.h
+++ b/libs/hwui/SkiaShader.h
@@ -65,7 +65,7 @@
virtual void setupProgram(Program* program, const mat4& modelView, const Snapshot& snapshot,
GLuint* textureUnit);
- inline SkShader *getSkShader() {
+ inline SkShader* getSkShader() {
return mKey;
}