summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2016-11-10 23:20:54 -0500
committerRobert Foss <robert.foss@collabora.com>2017-03-15 17:37:09 -0400
commit04a37e741f3d96d4c510806f424d56be3f550450 (patch)
treef6a34211b33b50248f636303b56cb4f3cf0da7cb
parentf2ba047cd82d2941005b809d77438d73141d735b (diff)
downloaddrm_hwcomposer-hwc2_fence_v3_threading.tar.gz
drm_hwcomposer-hwc2_fence_v3_threading.tar.xz
THREADING: Removed Begin/EndContexthwc2_fence_v3_threading
Change-Id: Ia917a95757c58269eeff810e21880236c346d983
-rw-r--r--glworker.cpp33
-rw-r--r--glworker.h7
2 files changed, 0 insertions, 40 deletions
diff --git a/glworker.cpp b/glworker.cpp
index 683fd0f..3e6134f 100644
--- a/glworker.cpp
+++ b/glworker.cpp
@@ -145,16 +145,6 @@ static bool HasExtension(const char *extension, const char *extensions) {
}
int GLWorkerCompositor::BeginContext() {
- private_.saved_egl_display = eglGetCurrentDisplay();
- private_.saved_egl_ctx = eglGetCurrentContext();
-
- if (private_.saved_egl_display != egl_display_ ||
- private_.saved_egl_ctx != egl_ctx_) {
- private_.saved_egl_read = eglGetCurrentSurface(EGL_READ);
- private_.saved_egl_draw = eglGetCurrentSurface(EGL_DRAW);
- } else {
- return 0;
- }
if (!eglMakeCurrent(egl_display_, EGL_NO_SURFACE, EGL_NO_SURFACE, egl_ctx_)) {
ALOGE("BeginContext failed: %s", GetEGLError());
@@ -163,19 +153,6 @@ int GLWorkerCompositor::BeginContext() {
return 0;
}
-int GLWorkerCompositor::EndContext() {
- if (private_.saved_egl_display != eglGetCurrentDisplay() ||
- private_.saved_egl_ctx != eglGetCurrentContext()) {
- if (!eglMakeCurrent(private_.saved_egl_display, private_.saved_egl_read,
- private_.saved_egl_draw, private_.saved_egl_ctx)) {
- ALOGE("EndContext failed: %s", GetEGLError());
- return 1;
- }
- }
-
- return 0;
-}
-
static AutoGLShader CompileAndCheckShader(GLenum type, unsigned source_count,
const GLchar **sources,
std::ostringstream *shader_log) {
@@ -509,7 +486,6 @@ int GLWorkerCompositor::Init() {
int ret = 0;
ret = InitWorker();
-// _Init();
return ret;
}
@@ -603,8 +579,6 @@ int GLWorkerCompositor::_Init() {
std::ostringstream shader_log;
blend_programs_.emplace_back(GenerateProgram(1, &shader_log));
- EndContext();
-
if (blend_programs_.back().get() == 0) {
ALOGE("%s", shader_log.str().c_str());
return 1;
@@ -663,17 +637,12 @@ int GLWorkerCompositor::_Composite(DrmHwcLayer *layers,
return -EALREADY;
}
- ret = BeginContext();
- if (ret)
- return -1;
-
GLint frame_width = framebuffer->getWidth();
GLint frame_height = framebuffer->getHeight();
CachedFramebuffer *cached_framebuffer =
PrepareAndCacheFramebuffer(framebuffer);
if (cached_framebuffer == NULL) {
ALOGE("Composite failed because of failed framebuffer");
- EndContext();
return -EINVAL;
}
@@ -709,7 +678,6 @@ int GLWorkerCompositor::_Composite(DrmHwcLayer *layers,
}
if (ret) {
- EndContext();
return ret;
}
@@ -789,7 +757,6 @@ int GLWorkerCompositor::_Composite(DrmHwcLayer *layers,
glBindFramebuffer(GL_FRAMEBUFFER, 0);
- EndContext();
return ret;
}
diff --git a/glworker.h b/glworker.h
index 5aeefac..d55e189 100644
--- a/glworker.h
+++ b/glworker.h
@@ -71,13 +71,6 @@ class GLWorkerCompositor : public Worker {
};
struct {
- EGLDisplay saved_egl_display = EGL_NO_DISPLAY;
- EGLContext saved_egl_ctx = EGL_NO_CONTEXT;
- EGLSurface saved_egl_read = EGL_NO_SURFACE;
- EGLSurface saved_egl_draw = EGL_NO_SURFACE;
- } private_;
-
- struct {
DrmHwcLayer *layers;
DrmCompositionRegion *regions;
size_t num_regions;