drm_hwcomposer: enhance stability using various wrapper classes
This commit contains a lot of churn because it changes code to use automatic
resource lifetimes as much as possible. As more things get changed, this is
essential to maintaining stability.
In addition, this change changes how layers are passed through the compositor
API. Before each layer was passed down one at a time. Now they are passed in
all at once. This is simpler for the implementation because it makes errors
more atomic and makes decisions easier for the compositors.
Change-Id: Ic3e6b5d0089fb1631ea256adcce9910ed8f38366
diff --git a/drmcompositor.cpp b/drmcompositor.cpp
index 082e75d..c61e60c 100644
--- a/drmcompositor.cpp
+++ b/drmcompositor.cpp
@@ -62,7 +62,8 @@
return composition;
}
-int DrmCompositor::QueueComposition(DrmComposition *composition) {
+int DrmCompositor::QueueComposition(
+ std::unique_ptr<DrmComposition> composition) {
int ret = composition->DisableUnusedPlanes();
if (ret) {
ALOGE("Failed to disable unused planes %d", ret);
@@ -76,7 +77,6 @@
composition->TakeDisplayComposition(display));
if (ret) {
ALOGE("Failed to queue composition for display %d", display);
- delete composition;
return ret;
}
}