Merge "Replace non-const references by pointers"
diff --git a/include/ui/GrallocAllocator.h b/include/ui/GrallocAllocator.h
index 5645bed..dd0f9e0 100644
--- a/include/ui/GrallocAllocator.h
+++ b/include/ui/GrallocAllocator.h
@@ -47,14 +47,14 @@
Error createBufferDescriptor(
const IAllocatorClient::BufferDescriptorInfo& descriptorInfo,
- BufferDescriptor& descriptor) const;
+ BufferDescriptor* outDescriptor) const;
void destroyBufferDescriptor(BufferDescriptor descriptor) const;
- Error allocate(BufferDescriptor descriptor, Buffer& buffer) const;
+ Error allocate(BufferDescriptor descriptor, Buffer* outBuffer) const;
void free(Buffer buffer) const;
Error exportHandle(BufferDescriptor descriptor, Buffer buffer,
- native_handle_t*& bufferHandle) const;
+ native_handle_t** outBufferHandle) const;
private:
sp<IAllocator> mAllocator;
diff --git a/include/ui/GrallocMapper.h b/include/ui/GrallocMapper.h
index 99d2837..509cb6e 100644
--- a/include/ui/GrallocMapper.h
+++ b/include/ui/GrallocMapper.h
@@ -52,70 +52,71 @@
void release(buffer_handle_t handle) const;
Error getDimensions(buffer_handle_t handle,
- uint32_t& width, uint32_t& height) const
+ uint32_t* outWidth, uint32_t* outHeight) const
{
- return mMapper->getDimensions(mDevice, handle, &width, &height);
+ return mMapper->getDimensions(mDevice, handle, outWidth, outHeight);
}
Error getFormat(buffer_handle_t handle,
- PixelFormat& format) const
+ PixelFormat* outFormat) const
{
- return mMapper->getFormat(mDevice, handle, &format);
+ return mMapper->getFormat(mDevice, handle, outFormat);
}
- Error getLayerCount(buffer_handle_t handle, uint32_t& layerCount) const
+ Error getLayerCount(buffer_handle_t handle, uint32_t* outLayerCount) const
{
- return mMapper->getLayerCount(mDevice, handle, &layerCount);
+ return mMapper->getLayerCount(mDevice, handle, outLayerCount);
}
Error getProducerUsageMask(buffer_handle_t handle,
- uint64_t& usageMask) const
+ uint64_t* outUsageMask) const
{
- return mMapper->getProducerUsageMask(mDevice, handle, &usageMask);
+ return mMapper->getProducerUsageMask(mDevice, handle, outUsageMask);
}
Error getConsumerUsageMask(buffer_handle_t handle,
- uint64_t& usageMask) const
+ uint64_t* outUsageMask) const
{
- return mMapper->getConsumerUsageMask(mDevice, handle, &usageMask);
+ return mMapper->getConsumerUsageMask(mDevice, handle, outUsageMask);
}
Error getBackingStore(buffer_handle_t handle,
- BackingStore& store) const
+ BackingStore* outStore) const
{
- return mMapper->getBackingStore(mDevice, handle, &store);
+ return mMapper->getBackingStore(mDevice, handle, outStore);
}
- Error getStride(buffer_handle_t handle, uint32_t& stride) const
+ Error getStride(buffer_handle_t handle, uint32_t* outStride) const
{
- return mMapper->getStride(mDevice, handle, &stride);
+ return mMapper->getStride(mDevice, handle, outStride);
}
- Error getNumFlexPlanes(buffer_handle_t handle, uint32_t& numPlanes) const
+ Error getNumFlexPlanes(buffer_handle_t handle,
+ uint32_t* outNumPlanes) const
{
- return mMapper->getNumFlexPlanes(mDevice, handle, &numPlanes);
+ return mMapper->getNumFlexPlanes(mDevice, handle, outNumPlanes);
}
Error lock(buffer_handle_t handle,
uint64_t producerUsageMask,
uint64_t consumerUsageMask,
const Device::Rect& accessRegion,
- int acquireFence, void*& data) const
+ int acquireFence, void** outData) const
{
return mMapper->lock(mDevice, handle,
producerUsageMask, consumerUsageMask,
- &accessRegion, acquireFence, &data);
+ &accessRegion, acquireFence, outData);
}
Error lock(buffer_handle_t handle,
uint64_t producerUsageMask,
uint64_t consumerUsageMask,
const Device::Rect& accessRegion,
- int acquireFence, FlexLayout& flexLayout) const
+ int acquireFence, FlexLayout* outFlexLayout) const
{
return mMapper->lockFlex(mDevice, handle,
producerUsageMask, consumerUsageMask,
- &accessRegion, acquireFence, &flexLayout);
+ &accessRegion, acquireFence, outFlexLayout);
}
int unlock(buffer_handle_t handle) const;
diff --git a/libs/ui/GrallocAllocator.cpp b/libs/ui/GrallocAllocator.cpp
index 021122a..ca67990 100644
--- a/libs/ui/GrallocAllocator.cpp
+++ b/libs/ui/GrallocAllocator.cpp
@@ -55,7 +55,7 @@
Error Allocator::createBufferDescriptor(
const IAllocatorClient::BufferDescriptorInfo& descriptorInfo,
- BufferDescriptor& descriptor) const
+ BufferDescriptor* outDescriptor) const
{
Error error = kDefaultError;
mClient->createDescriptor(descriptorInfo,
@@ -65,7 +65,7 @@
return;
}
- descriptor = tmpDescriptor;
+ *outDescriptor = tmpDescriptor;
});
return error;
@@ -76,7 +76,8 @@
mClient->destroyDescriptor(descriptor);
}
-Error Allocator::allocate(BufferDescriptor descriptor, Buffer& buffer) const
+Error Allocator::allocate(BufferDescriptor descriptor,
+ Buffer* outBuffer) const
{
hardware::hidl_vec<BufferDescriptor> descriptors;
descriptors.setToExternal(&descriptor, 1);
@@ -89,7 +90,7 @@
return;
}
- buffer = tmpBuffers[0];
+ *outBuffer = tmpBuffers[0];
});
return error;
@@ -101,7 +102,7 @@
}
Error Allocator::exportHandle(BufferDescriptor descriptor, Buffer buffer,
- native_handle_t*& bufferHandle) const
+ native_handle_t** outBufferHandle) const
{
Error error = kDefaultError;
auto status = mClient->exportHandle(descriptor, buffer,
@@ -111,8 +112,8 @@
return;
}
- bufferHandle = native_handle_clone(tmpBufferHandle);
- if (!bufferHandle) {
+ *outBufferHandle = native_handle_clone(tmpBufferHandle);
+ if (!*outBufferHandle) {
error = Error::NO_RESOURCES;
}
});
diff --git a/libs/ui/GraphicBufferAllocator.cpp b/libs/ui/GraphicBufferAllocator.cpp
index d258586..f30ec84 100644
--- a/libs/ui/GraphicBufferAllocator.cpp
+++ b/libs/ui/GraphicBufferAllocator.cpp
@@ -115,14 +115,14 @@
info.consumerUsageMask = usage;
Gralloc2::BufferDescriptor descriptor;
- auto error = mAllocator->createBufferDescriptor(info, descriptor);
+ auto error = mAllocator->createBufferDescriptor(info, &descriptor);
if (error != Gralloc2::Error::NONE) {
ALOGE("Failed to create desc (%u x %u) layerCount %u format %d usage %u: %d",
width, height, layerCount, format, usage, error);
return;
}
- error = mAllocator->allocate(descriptor, mBuffer);
+ error = mAllocator->allocate(descriptor, &mBuffer);
if (error == Gralloc2::Error::NOT_SHARED) {
error = Gralloc2::Error::NONE;
}
@@ -134,7 +134,7 @@
return;
}
- error = mAllocator->exportHandle(descriptor, mBuffer, mHandle);
+ error = mAllocator->exportHandle(descriptor, mBuffer, &mHandle);
if (error != Gralloc2::Error::NONE) {
ALOGE("Failed to export handle");
mAllocator->free(mBuffer);
@@ -172,7 +172,7 @@
*handle = mHandle;
- auto error = mapper.getGrallocMapper().getStride(mHandle, *stride);
+ auto error = mapper.getGrallocMapper().getStride(mHandle, stride);
if (error != Gralloc2::Error::NONE) {
ALOGW("Failed to get stride from buffer: %d", error);
*stride = 0;
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp
index fb55bf1..13ab38c 100644
--- a/libs/ui/GraphicBufferMapper.cpp
+++ b/libs/ui/GraphicBufferMapper.cpp
@@ -151,7 +151,7 @@
const Gralloc2::Device::Rect& accessRect =
*reinterpret_cast<Gralloc2::Device::Rect*>(&accessRegion);
error = static_cast<gralloc1_error_t>(mMapper->lock(
- handle, usage, usage, accessRect, fenceFd, *vaddr));
+ handle, usage, usage, accessRect, fenceFd, vaddr));
} else {
sp<Fence> fence = new Fence(fenceFd);
error = mDevice->lock(handle,
@@ -213,7 +213,7 @@
gralloc1_error_t error;
if (mMapper->valid()) {
error = static_cast<gralloc1_error_t>(
- mMapper->getNumFlexPlanes(handle, numPlanes));
+ mMapper->getNumFlexPlanes(handle, &numPlanes));
} else {
error = mDevice->getNumFlexPlanes(handle, &numPlanes);
}
@@ -238,7 +238,7 @@
Gralloc2::FlexLayout& layout =
*reinterpret_cast<Gralloc2::FlexLayout*>(&flexLayout);
error = static_cast<gralloc1_error_t>(mMapper->lock(
- handle, usage, usage, accessRect, fenceFd, layout));
+ handle, usage, usage, accessRect, fenceFd, &layout));
} else {
sp<Fence> fence = new Fence(fenceFd);
error = mDevice->lockFlex(handle,
diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.cpp b/services/surfaceflinger/DisplayHardware/ComposerHal.cpp
index 63fd1e8..3555075 100644
--- a/services/surfaceflinger/DisplayHardware/ComposerHal.cpp
+++ b/services/surfaceflinger/DisplayHardware/ComposerHal.cpp
@@ -100,13 +100,6 @@
return unwrapRet(ret, kDefaultError);
}
-template<typename T>
-void assignFromHidlVec(std::vector<T>& vec, const hidl_vec<T>& data)
-{
- vec.clear();
- vec.insert(vec.begin(), &data[0], &data[data.size()]);
-}
-
} // anonymous namespace
Composer::Composer()
@@ -134,7 +127,7 @@
std::vector<IComposer::Capability> capabilities;
mComposer->getCapabilities(
[&](const auto& tmpCapabilities) {
- assignFromHidlVec(capabilities, tmpCapabilities);
+ capabilities = tmpCapabilities;
});
return capabilities;
@@ -165,11 +158,11 @@
}
Error Composer::createVirtualDisplay(uint32_t width, uint32_t height,
- PixelFormat& format, Display& display)
+ PixelFormat* format, Display* outDisplay)
{
const uint32_t bufferSlotCount = 1;
Error error = kDefaultError;
- mClient->createVirtualDisplay(width, height, format, bufferSlotCount,
+ mClient->createVirtualDisplay(width, height, *format, bufferSlotCount,
[&](const auto& tmpError, const auto& tmpDisplay,
const auto& tmpFormat) {
error = tmpError;
@@ -177,8 +170,8 @@
return;
}
- display = tmpDisplay;
- format = tmpFormat;
+ *outDisplay = tmpDisplay;
+ *format = tmpFormat;
});
return error;
@@ -197,7 +190,7 @@
return Error::NONE;
}
-Error Composer::createLayer(Display display, Layer& layer)
+Error Composer::createLayer(Display display, Layer* outLayer)
{
const uint32_t bufferSlotCount = 1;
Error error = kDefaultError;
@@ -208,7 +201,7 @@
return;
}
- layer = tmpLayer;
+ *outLayer = tmpLayer;
});
return error;
@@ -220,7 +213,7 @@
return unwrapRet(ret);
}
-Error Composer::getActiveConfig(Display display, Config& config)
+Error Composer::getActiveConfig(Display display, Config* outConfig)
{
Error error = kDefaultError;
mClient->getActiveConfig(display,
@@ -230,22 +223,22 @@
return;
}
- config = tmpConfig;
+ *outConfig = tmpConfig;
});
return error;
}
Error Composer::getChangedCompositionTypes(Display display,
- std::vector<Layer>& layers,
- std::vector<IComposerClient::Composition>& types)
+ std::vector<Layer>* outLayers,
+ std::vector<IComposerClient::Composition>* outTypes)
{
- mReader.takeChangedCompositionTypes(display, layers, types);
+ mReader.takeChangedCompositionTypes(display, outLayers, outTypes);
return Error::NONE;
}
Error Composer::getColorModes(Display display,
- std::vector<ColorMode>& modes)
+ std::vector<ColorMode>* outModes)
{
Error error = kDefaultError;
mClient->getColorModes(display,
@@ -255,14 +248,14 @@
return;
}
- assignFromHidlVec(modes, tmpModes);
+ *outModes = tmpModes;
});
return error;
}
Error Composer::getDisplayAttribute(Display display, Config config,
- IComposerClient::Attribute attribute, int32_t& value)
+ IComposerClient::Attribute attribute, int32_t* outValue)
{
Error error = kDefaultError;
mClient->getDisplayAttribute(display, config, attribute,
@@ -272,14 +265,14 @@
return;
}
- value = tmpValue;
+ *outValue = tmpValue;
});
return error;
}
Error Composer::getDisplayConfigs(Display display,
- std::vector<Config>& configs)
+ std::vector<Config>* outConfigs)
{
Error error = kDefaultError;
mClient->getDisplayConfigs(display,
@@ -289,13 +282,13 @@
return;
}
- assignFromHidlVec(configs, tmpConfigs);
+ *outConfigs = tmpConfigs;
});
return error;
}
-Error Composer::getDisplayName(Display display, std::string& name)
+Error Composer::getDisplayName(Display display, std::string* outName)
{
Error error = kDefaultError;
mClient->getDisplayName(display,
@@ -305,22 +298,23 @@
return;
}
- name = tmpName.c_str();
+ *outName = tmpName.c_str();
});
return error;
}
Error Composer::getDisplayRequests(Display display,
- uint32_t& displayRequestMask, std::vector<Layer>& layers,
- std::vector<uint32_t>& layerRequestMasks)
+ uint32_t* outDisplayRequestMask, std::vector<Layer>* outLayers,
+ std::vector<uint32_t>* outLayerRequestMasks)
{
- mReader.takeDisplayRequests(display, displayRequestMask,
- layers, layerRequestMasks);
+ mReader.takeDisplayRequests(display, outDisplayRequestMask,
+ outLayers, outLayerRequestMasks);
return Error::NONE;
}
-Error Composer::getDisplayType(Display display, IComposerClient::DisplayType& type)
+Error Composer::getDisplayType(Display display,
+ IComposerClient::DisplayType* outType)
{
Error error = kDefaultError;
mClient->getDisplayType(display,
@@ -330,13 +324,13 @@
return;
}
- type = tmpType;
+ *outType = tmpType;
});
return error;
}
-Error Composer::getDozeSupport(Display display, bool& support)
+Error Composer::getDozeSupport(Display display, bool* outSupport)
{
Error error = kDefaultError;
mClient->getDozeSupport(display,
@@ -346,15 +340,15 @@
return;
}
- support = tmpSupport;
+ *outSupport = tmpSupport;
});
return error;
}
-Error Composer::getHdrCapabilities(Display display, std::vector<Hdr>& types,
- float& maxLuminance, float& maxAverageLuminance,
- float& minLuminance)
+Error Composer::getHdrCapabilities(Display display,
+ std::vector<Hdr>* outTypes, float* outMaxLuminance,
+ float* outMaxAverageLuminance, float* outMinLuminance)
{
Error error = kDefaultError;
mClient->getHdrCapabilities(display,
@@ -367,23 +361,23 @@
return;
}
- assignFromHidlVec(types, tmpTypes);
- maxLuminance = tmpMaxLuminance;
- maxAverageLuminance = tmpMaxAverageLuminance;
- minLuminance = tmpMinLuminance;
+ *outTypes = tmpTypes;
+ *outMaxLuminance = tmpMaxLuminance;
+ *outMaxAverageLuminance = tmpMaxAverageLuminance;
+ *outMinLuminance = tmpMinLuminance;
});
return error;
}
-Error Composer::getReleaseFences(Display display, std::vector<Layer>& layers,
- std::vector<int>& releaseFences)
+Error Composer::getReleaseFences(Display display,
+ std::vector<Layer>* outLayers, std::vector<int>* outReleaseFences)
{
- mReader.takeReleaseFences(display, layers, releaseFences);
+ mReader.takeReleaseFences(display, outLayers, outReleaseFences);
return Error::NONE;
}
-Error Composer::presentDisplay(Display display, int& presentFence)
+Error Composer::presentDisplay(Display display, int* outPresentFence)
{
mWriter.selectDisplay(display);
mWriter.presentDisplay();
@@ -393,7 +387,7 @@
return error;
}
- mReader.takePresentFence(display, presentFence);
+ mReader.takePresentFence(display, outPresentFence);
return Error::NONE;
}
@@ -454,8 +448,8 @@
return unwrapRet(ret);
}
-Error Composer::validateDisplay(Display display, uint32_t& numTypes,
- uint32_t& numRequests)
+Error Composer::validateDisplay(Display display, uint32_t* outNumTypes,
+ uint32_t* outNumRequests)
{
mWriter.selectDisplay(display);
mWriter.validateDisplay();
@@ -465,7 +459,7 @@
return error;
}
- mReader.hasChanges(display, numTypes, numRequests);
+ mReader.hasChanges(display, outNumTypes, outNumRequests);
return Error::NONE;
}
@@ -601,7 +595,7 @@
bool queueChanged = false;
uint32_t commandLength = 0;
hidl_vec<hidl_handle> commandHandles;
- if (!mWriter.writeQueue(queueChanged, commandLength, commandHandles)) {
+ if (!mWriter.writeQueue(&queueChanged, &commandLength, &commandHandles)) {
mWriter.reset();
return Error::NO_RESOURCES;
}
@@ -686,7 +680,7 @@
uint16_t length = 0;
while (!isEmpty()) {
- if (!beginCommand(command, length)) {
+ if (!beginCommand(&command, &length)) {
break;
}
@@ -863,87 +857,87 @@
}
bool CommandReader::hasChanges(Display display,
- uint32_t& numChangedCompositionTypes,
- uint32_t& numLayerRequestMasks) const
+ uint32_t* outNumChangedCompositionTypes,
+ uint32_t* outNumLayerRequestMasks) const
{
auto found = mReturnData.find(display);
if (found == mReturnData.end()) {
- numChangedCompositionTypes = 0;
- numLayerRequestMasks = 0;
+ *outNumChangedCompositionTypes = 0;
+ *outNumLayerRequestMasks = 0;
return false;
}
const ReturnData& data = found->second;
- numChangedCompositionTypes = data.compositionTypes.size();
- numLayerRequestMasks = data.requestMasks.size();
+ *outNumChangedCompositionTypes = data.compositionTypes.size();
+ *outNumLayerRequestMasks = data.requestMasks.size();
return !(data.compositionTypes.empty() && data.requestMasks.empty());
}
void CommandReader::takeChangedCompositionTypes(Display display,
- std::vector<Layer>& layers,
- std::vector<IComposerClient::Composition>& types)
+ std::vector<Layer>* outLayers,
+ std::vector<IComposerClient::Composition>* outTypes)
{
auto found = mReturnData.find(display);
if (found == mReturnData.end()) {
- layers.clear();
- types.clear();
+ outLayers->clear();
+ outTypes->clear();
return;
}
ReturnData& data = found->second;
- layers = std::move(data.changedLayers);
- types = std::move(data.compositionTypes);
+ *outLayers = std::move(data.changedLayers);
+ *outTypes = std::move(data.compositionTypes);
}
void CommandReader::takeDisplayRequests(Display display,
- uint32_t& displayRequestMask, std::vector<Layer>& layers,
- std::vector<uint32_t>& layerRequestMasks)
+ uint32_t* outDisplayRequestMask, std::vector<Layer>* outLayers,
+ std::vector<uint32_t>* outLayerRequestMasks)
{
auto found = mReturnData.find(display);
if (found == mReturnData.end()) {
- displayRequestMask = 0;
- layers.clear();
- layerRequestMasks.clear();
+ *outDisplayRequestMask = 0;
+ outLayers->clear();
+ outLayerRequestMasks->clear();
return;
}
ReturnData& data = found->second;
- displayRequestMask = data.displayRequests;
- layers = std::move(data.requestedLayers);
- layerRequestMasks = std::move(data.requestMasks);
+ *outDisplayRequestMask = data.displayRequests;
+ *outLayers = std::move(data.requestedLayers);
+ *outLayerRequestMasks = std::move(data.requestMasks);
}
void CommandReader::takeReleaseFences(Display display,
- std::vector<Layer>& layers, std::vector<int>& releaseFences)
+ std::vector<Layer>* outLayers, std::vector<int>* outReleaseFences)
{
auto found = mReturnData.find(display);
if (found == mReturnData.end()) {
- layers.clear();
- releaseFences.clear();
+ outLayers->clear();
+ outReleaseFences->clear();
return;
}
ReturnData& data = found->second;
- layers = std::move(data.releasedLayers);
- releaseFences = std::move(data.releaseFences);
+ *outLayers = std::move(data.releasedLayers);
+ *outReleaseFences = std::move(data.releaseFences);
}
-void CommandReader::takePresentFence(Display display, int& presentFence)
+void CommandReader::takePresentFence(Display display, int* outPresentFence)
{
auto found = mReturnData.find(display);
if (found == mReturnData.end()) {
- presentFence = -1;
+ *outPresentFence = -1;
return;
}
ReturnData& data = found->second;
- presentFence = data.presentFence;
+ *outPresentFence = data.presentFence;
data.presentFence = -1;
}
diff --git a/services/surfaceflinger/DisplayHardware/ComposerHal.h b/services/surfaceflinger/DisplayHardware/ComposerHal.h
index 2246f76..6e42ba0 100644
--- a/services/surfaceflinger/DisplayHardware/ComposerHal.h
+++ b/services/surfaceflinger/DisplayHardware/ComposerHal.h
@@ -71,25 +71,25 @@
};
std::vector<CommandError> takeErrors();
- bool hasChanges(Display display, uint32_t& numChangedCompositionTypes,
- uint32_t& numLayerRequestMasks) const;
+ bool hasChanges(Display display, uint32_t* outNumChangedCompositionTypes,
+ uint32_t* outNumLayerRequestMasks) const;
// Get and clear saved changed composition types.
void takeChangedCompositionTypes(Display display,
- std::vector<Layer>& layers,
- std::vector<IComposerClient::Composition>& types);
+ std::vector<Layer>* outLayers,
+ std::vector<IComposerClient::Composition>* outTypes);
// Get and clear saved display requests.
void takeDisplayRequests(Display display,
- uint32_t& displayRequestMask, std::vector<Layer>& layers,
- std::vector<uint32_t>& layerRequestMasks);
+ uint32_t* outDisplayRequestMask, std::vector<Layer>* outLayers,
+ std::vector<uint32_t>* outLayerRequestMasks);
// Get and clear saved release fences.
- void takeReleaseFences(Display display, std::vector<Layer>& layers,
- std::vector<int>& releaseFences);
+ void takeReleaseFences(Display display, std::vector<Layer>* outLayers,
+ std::vector<int>* outReleaseFences);
// Get and clear saved present fence.
- void takePresentFence(Display display, int& presentFence);
+ void takePresentFence(Display display, int* outPresentFence);
private:
void resetData();
@@ -137,39 +137,39 @@
uint32_t getMaxVirtualDisplayCount();
Error createVirtualDisplay(uint32_t width, uint32_t height,
- PixelFormat& format, Display& display);
+ PixelFormat* format, Display* outDisplay);
Error destroyVirtualDisplay(Display display);
Error acceptDisplayChanges(Display display);
- Error createLayer(Display display, Layer& layer);
+ Error createLayer(Display display, Layer* outLayer);
Error destroyLayer(Display display, Layer layer);
- Error getActiveConfig(Display display, Config& config);
+ Error getActiveConfig(Display display, Config* outConfig);
Error getChangedCompositionTypes(Display display,
- std::vector<Layer>& layers,
- std::vector<IComposerClient::Composition>& types);
- Error getColorModes(Display display, std::vector<ColorMode>& modes);
+ std::vector<Layer>* outLayers,
+ std::vector<IComposerClient::Composition>* outTypes);
+ Error getColorModes(Display display, std::vector<ColorMode>* outModes);
Error getDisplayAttribute(Display display, Config config,
- IComposerClient::Attribute attribute, int32_t& value);
- Error getDisplayConfigs(Display display,
- std::vector<Config>& configs);
- Error getDisplayName(Display display, std::string& name);
+ IComposerClient::Attribute attribute, int32_t* outValue);
+ Error getDisplayConfigs(Display display, std::vector<Config>* outConfigs);
+ Error getDisplayName(Display display, std::string* outName);
- Error getDisplayRequests(Display display, uint32_t& displayRequestMask,
- std::vector<Layer>& layers,
- std::vector<uint32_t>& layerRequestMasks);
+ Error getDisplayRequests(Display display, uint32_t* outDisplayRequestMask,
+ std::vector<Layer>* outLayers,
+ std::vector<uint32_t>* outLayerRequestMasks);
- Error getDisplayType(Display display, IComposerClient::DisplayType& type);
- Error getDozeSupport(Display display, bool& support);
- Error getHdrCapabilities(Display display, std::vector<Hdr>& types,
- float& maxLuminance, float& maxAverageLuminance,
- float& minLuminance);
+ Error getDisplayType(Display display,
+ IComposerClient::DisplayType* outType);
+ Error getDozeSupport(Display display, bool* outSupport);
+ Error getHdrCapabilities(Display display, std::vector<Hdr>* outTypes,
+ float* outMaxLuminance, float* outMaxAverageLuminance,
+ float* outMinLuminance);
- Error getReleaseFences(Display display, std::vector<Layer>& layers,
- std::vector<int>& releaseFences);
+ Error getReleaseFences(Display display, std::vector<Layer>* outLayers,
+ std::vector<int>* outReleaseFences);
- Error presentDisplay(Display display, int& presentFence);
+ Error presentDisplay(Display display, int* outPresentFence);
Error setActiveConfig(Display display, Config config);
Error setClientTarget(Display display, const native_handle_t* target,
@@ -185,8 +185,8 @@
Error setClientTargetSlotCount(Display display);
- Error validateDisplay(Display display, uint32_t& numTypes,
- uint32_t& numRequests);
+ Error validateDisplay(Display display, uint32_t* outNumTypes,
+ uint32_t* outNumRequests);
Error setCursorPosition(Display display, Layer layer,
int32_t x, int32_t y);
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.cpp b/services/surfaceflinger/DisplayHardware/HWC2.cpp
index 10b0acf..85c21b2 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWC2.cpp
@@ -231,7 +231,7 @@
#else
auto intFormat = static_cast<Hwc2::PixelFormat>(*format);
auto intError = mComposer->createVirtualDisplay(width, height,
- intFormat, displayId);
+ &intFormat, &displayId);
#endif
auto error = static_cast<Error>(intError);
if (error != Error::None) {
@@ -590,7 +590,7 @@
#ifdef BYPASS_IHWC
int32_t intError = mDevice.mCreateLayer(mDevice.mHwcDevice, mId, &layerId);
#else
- auto intError = mDevice.mComposer->createLayer(mId, layerId);
+ auto intError = mDevice.mComposer->createLayer(mId, &layerId);
#endif
auto error = static_cast<Error>(intError);
if (error != Error::None) {
@@ -612,7 +612,7 @@
int32_t intError = mDevice.mGetActiveConfig(mDevice.mHwcDevice, mId,
&configId);
#else
- auto intError = mDevice.mComposer->getActiveConfig(mId, configId);
+ auto intError = mDevice.mComposer->getActiveConfig(mId, &configId);
#endif
auto error = static_cast<Error>(intError);
@@ -655,7 +655,7 @@
std::vector<Hwc2::Layer> layerIds;
std::vector<Hwc2::IComposerClient::Composition> types;
auto intError = mDevice.mComposer->getChangedCompositionTypes(mId,
- layerIds, types);
+ &layerIds, &types);
uint32_t numElements = layerIds.size();
auto error = static_cast<Error>(intError);
#endif
@@ -699,7 +699,7 @@
error = static_cast<Error>(intError);
#else
std::vector<Hwc2::ColorMode> modes;
- auto intError = mDevice.mComposer->getColorModes(mId, modes);
+ auto intError = mDevice.mComposer->getColorModes(mId, &modes);
uint32_t numModes = modes.size();
auto error = static_cast<Error>(intError);
#endif
@@ -745,7 +745,7 @@
*outName = std::string(rawName.cbegin(), rawName.cend());
return Error::None;
#else
- auto intError = mDevice.mComposer->getDisplayName(mId, *outName);
+ auto intError = mDevice.mComposer->getDisplayName(mId, outName);
return static_cast<Error>(intError);
#endif
}
@@ -775,7 +775,7 @@
std::vector<Hwc2::Layer> layerIds;
std::vector<uint32_t> layerRequests;
auto intError = mDevice.mComposer->getDisplayRequests(mId,
- intDisplayRequests, layerIds, layerRequests);
+ &intDisplayRequests, &layerIds, &layerRequests);
uint32_t numElements = layerIds.size();
auto error = static_cast<Error>(intError);
#endif
@@ -810,7 +810,7 @@
#else
Hwc2::IComposerClient::DisplayType intType =
Hwc2::IComposerClient::DisplayType::INVALID;
- auto intError = mDevice.mComposer->getDisplayType(mId, intType);
+ auto intError = mDevice.mComposer->getDisplayType(mId, &intType);
#endif
auto error = static_cast<Error>(intError);
if (error != Error::None) {
@@ -829,7 +829,7 @@
&intSupport);
#else
bool intSupport = false;
- auto intError = mDevice.mComposer->getDozeSupport(mId, intSupport);
+ auto intError = mDevice.mComposer->getDozeSupport(mId, &intSupport);
#endif
auto error = static_cast<Error>(intError);
if (error != Error::None) {
@@ -861,8 +861,8 @@
error = static_cast<HWC2::Error>(intError);
#else
std::vector<Hwc2::Hdr> intTypes;
- auto intError = mDevice.mComposer->getHdrCapabilities(mId, intTypes,
- maxLuminance, maxAverageLuminance, minLuminance);
+ auto intError = mDevice.mComposer->getHdrCapabilities(mId, &intTypes,
+ &maxLuminance, &maxAverageLuminance, &minLuminance);
auto error = static_cast<HWC2::Error>(intError);
std::vector<int32_t> types;
@@ -901,7 +901,7 @@
std::vector<Hwc2::Layer> layerIds;
std::vector<int> fenceFds;
auto intError = mDevice.mComposer->getReleaseFences(mId,
- layerIds, fenceFds);
+ &layerIds, &fenceFds);
auto error = static_cast<Error>(intError);
uint32_t numElements = layerIds.size();
#endif
@@ -934,7 +934,7 @@
int32_t intError = mDevice.mPresentDisplay(mDevice.mHwcDevice, mId,
&presentFenceFd);
#else
- auto intError = mDevice.mComposer->presentDisplay(mId, presentFenceFd);
+ auto intError = mDevice.mComposer->presentDisplay(mId, &presentFenceFd);
#endif
auto error = static_cast<Error>(intError);
if (error != Error::None) {
@@ -1051,7 +1051,7 @@
&numTypes, &numRequests);
#else
auto intError = mDevice.mComposer->validateDisplay(mId,
- numTypes, numRequests);
+ &numTypes, &numRequests);
#endif
auto error = static_cast<Error>(intError);
if (error != Error::None && error != Error::HasChanges) {
@@ -1072,9 +1072,9 @@
int32_t intError = mDevice.mGetDisplayAttribute(mDevice.mHwcDevice, mId,
configId, static_cast<int32_t>(attribute), &value);
#else
- auto intError = mDevice.mComposer->getDisplayAttribute(mId,
- configId, static_cast<Hwc2::IComposerClient::Attribute>(attribute),
- value);
+ auto intError = mDevice.mComposer->getDisplayAttribute(mId, configId,
+ static_cast<Hwc2::IComposerClient::Attribute>(attribute),
+ &value);
#endif
auto error = static_cast<Error>(intError);
if (error != Error::None) {
@@ -1121,7 +1121,7 @@
error = static_cast<Error>(intError);
#else
std::vector<Hwc2::Config> configIds;
- auto intError = mDevice.mComposer->getDisplayConfigs(mId, configIds);
+ auto intError = mDevice.mComposer->getDisplayConfigs(mId, &configIds);
auto error = static_cast<Error>(intError);
#endif
if (error != Error::None) {