drm_hwcomposer: fix small class consistency issues
This also fixes a typo in an error message.
Change-Id: Ie6c369f5eb2496ac3ebb342dbdcdd70f3a176495
diff --git a/drm_hwcomposer.h b/drm_hwcomposer.h
index fdf389b..1490438 100644
--- a/drm_hwcomposer.h
+++ b/drm_hwcomposer.h
@@ -175,7 +175,7 @@
return importer_ != NULL;
}
- hwc_drm_bo *operator->();
+ const hwc_drm_bo *operator->() const;
void Clear();
@@ -257,11 +257,12 @@
UniqueFd acquire_fence;
OutputFd release_fence;
- DrmHwcLayer() = default;
- DrmHwcLayer(DrmHwcLayer &&rhs) = default;
-
int InitFromHwcLayer(hwc_layer_1_t *sf_layer, Importer *importer,
const gralloc_module_t *gralloc);
+
+ buffer_handle_t get_usable_handle() const {
+ return handle.get() != NULL ? handle.get() : sf_handle;
+ }
};
struct DrmHwcDisplayContents {
diff --git a/hwcomposer.cpp b/hwcomposer.cpp
index a7c9e43..fc421c3 100644
--- a/hwcomposer.cpp
+++ b/hwcomposer.cpp
@@ -191,9 +191,9 @@
return *this;
}
-hwc_drm_bo *DrmHwcBuffer::operator->() {
+const hwc_drm_bo *DrmHwcBuffer::operator->() const {
if (importer_ == NULL) {
- ALOGE("Access of none existent BO");
+ ALOGE("Access of non-existent BO");
exit(1);
return NULL;
}