Delete renderengine::Surface
It is now unused.
Bug: 117680609
Test: Builds
Change-Id: Ibe897696957a0b0f0813d40c9157868f72f02fd2
diff --git a/libs/renderengine/gl/GLES20RenderEngine.cpp b/libs/renderengine/gl/GLES20RenderEngine.cpp
index e244a83..d35762d 100644
--- a/libs/renderengine/gl/GLES20RenderEngine.cpp
+++ b/libs/renderengine/gl/GLES20RenderEngine.cpp
@@ -41,7 +41,6 @@
#include "GLExtensions.h"
#include "GLFramebuffer.h"
#include "GLImage.h"
-#include "GLSurface.h"
#include "Program.h"
#include "ProgramCache.h"
@@ -423,10 +422,6 @@
return std::make_unique<GLFramebuffer>(*this);
}
-std::unique_ptr<Surface> GLES20RenderEngine::createSurface() {
- return std::make_unique<GLSurface>(*this);
-}
-
std::unique_ptr<Image> GLES20RenderEngine::createImage() {
return std::make_unique<GLImage>(*this);
}
@@ -439,31 +434,6 @@
return mEGLDisplay == eglGetCurrentDisplay() && mEGLContext == eglGetCurrentContext();
}
-bool GLES20RenderEngine::setCurrentSurface(const Surface& surface) {
- // Surface is an abstract interface. GLES20RenderEngine only ever
- // creates GLSurface's, so it is safe to just cast to the actual
- // type.
- bool success = true;
- const GLSurface& glSurface = static_cast<const GLSurface&>(surface);
- EGLSurface eglSurface = glSurface.getEGLSurface();
- if (eglSurface != eglGetCurrentSurface(EGL_DRAW)) {
- success = eglMakeCurrent(mEGLDisplay, eglSurface, eglSurface, mEGLContext) == EGL_TRUE;
- if (success && glSurface.getAsync()) {
- eglSwapInterval(mEGLDisplay, 0);
- }
- if (success) {
- mSurfaceHeight = glSurface.getHeight();
- }
- }
-
- return success;
-}
-
-void GLES20RenderEngine::resetCurrentSurface() {
- eglMakeCurrent(mEGLDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- mSurfaceHeight = 0;
-}
-
base::unique_fd GLES20RenderEngine::flush() {
if (!GLExtensions::getInstance().hasNativeFenceSync()) {
return base::unique_fd();
@@ -577,7 +547,7 @@
void GLES20RenderEngine::setScissor(const Rect& region) {
// Invert y-coordinate to map to GL-space.
- int32_t canvasHeight = mRenderToFbo ? mFboHeight : mSurfaceHeight;
+ int32_t canvasHeight = mFboHeight;
int32_t glBottom = canvasHeight - region.bottom;
glScissor(region.left, glBottom, region.getWidth(), region.getHeight());
@@ -620,7 +590,6 @@
glBindFramebuffer(GL_FRAMEBUFFER, framebufferName);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureName, 0);
- mRenderToFbo = true;
mFboHeight = glFramebuffer->getBufferHeight();
uint32_t glStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER);
@@ -632,7 +601,6 @@
}
void GLES20RenderEngine::unbindFrameBuffer(Framebuffer* /* framebuffer */) {
- mRenderToFbo = false;
mFboHeight = 0;
// back to main framebuffer
@@ -661,9 +629,7 @@
int32_t r = sourceCrop.right;
int32_t b = sourceCrop.bottom;
int32_t t = sourceCrop.top;
- if (mRenderToFbo) {
- std::swap(t, b);
- }
+ std::swap(t, b);
mat4 m = mat4::ortho(l, r, b, t, 0, 1);
// Apply custom rotation to the projection.