summaryrefslogtreecommitdiff
path: root/libs/gui
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-11-07 01:40:04 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-11-07 01:40:04 +0000
commit394f9bce22c8ebb8d1c45a9b6fd52d851a19ca7e (patch)
treef1f2351ba0720c5d26c992be4a3cf60679079311 /libs/gui
parentc556dfeee1de47086a7404df3f0093daa86dcb1a (diff)
parent37965d4d225e333b70110c5715998eebed5eedd2 (diff)
Merge "ISurfaceComposer: rename isColorManagementUsed()"
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/ISurfaceComposer.cpp28
-rw-r--r--libs/gui/include/gui/ISurfaceComposer.h4
-rw-r--r--libs/gui/tests/Surface_test.cpp2
3 files changed, 17 insertions, 17 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index e66c0e5dd6..accf72c390 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -588,19 +588,16 @@ public:
return error;
}
- virtual bool isColorManagementUsed() const {
+ virtual status_t getColorManagement(bool* outGetColorManagement) const {
Parcel data, reply;
data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- remote()->transact(BnSurfaceComposer::IS_COLOR_MANAGEMET_USED, data, &reply);
- int32_t result = 0;
- status_t err = reply.readInt32(&result);
- if (err != NO_ERROR) {
- ALOGE("ISurfaceComposer::isColorManagementUsed: error "
- "retrieving result: %s (%d)",
- strerror(-err), -err);
- return false;
+ remote()->transact(BnSurfaceComposer::GET_COLOR_MANAGEMENT, data, &reply);
+ bool result;
+ status_t err = reply.readBool(&result);
+ if (err == NO_ERROR) {
+ *outGetColorManagement = result;
}
- return result != 0;
+ return err;
}
};
@@ -945,11 +942,14 @@ status_t BnSurfaceComposer::onTransact(
}
return NO_ERROR;
}
- case IS_COLOR_MANAGEMET_USED: {
+ case GET_COLOR_MANAGEMENT: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
- int32_t result = isColorManagementUsed() ? 1 : 0;
- reply->writeInt32(result);
- return NO_ERROR;
+ bool result;
+ status_t error = getColorManagement(&result);
+ if (error == NO_ERROR) {
+ reply->writeBool(result);
+ }
+ return result;
}
default: {
return BBinder::onTransact(code, data, reply, flags);
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h
index 9316ae69bc..761f31a04b 100644
--- a/libs/gui/include/gui/ISurfaceComposer.h
+++ b/libs/gui/include/gui/ISurfaceComposer.h
@@ -280,7 +280,7 @@ public:
*/
virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const = 0;
- virtual bool isColorManagementUsed() const = 0;
+ virtual status_t getColorManagement(bool* outGetColorManagement) const = 0;
/* Gets the composition preference of the default data space and default pixel format,
* as well as the wide color gamut data space and wide color gamut pixel format.
@@ -331,7 +331,7 @@ public:
GET_LAYER_DEBUG_INFO,
CREATE_SCOPED_CONNECTION,
GET_COMPOSITION_PREFERENCE,
- IS_COLOR_MANAGEMET_USED,
+ GET_COLOR_MANAGEMENT,
};
virtual status_t onTransact(uint32_t code, const Parcel& data,
diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp
index a3e9249ac2..d0600daa0d 100644
--- a/libs/gui/tests/Surface_test.cpp
+++ b/libs/gui/tests/Surface_test.cpp
@@ -635,7 +635,7 @@ public:
return NO_ERROR;
}
- virtual bool isColorManagementUsed() const { return false; }
+ virtual status_t getColorManagement(bool* /*outGetColorManagement*/) const { return NO_ERROR; }
protected:
IBinder* onAsBinder() override { return nullptr; }