| /* |
| * Copyright (C) 2016 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| package android.hardware.graphics.allocator@2.0; |
| |
| import IAllocatorClient; |
| |
| interface IAllocator { |
| enum Capability : int32_t { |
| /* reserved */ |
| INVALID = 0, |
| |
| /* |
| * IAllocatorClient::testAllocate must always return UNDEFINED unless |
| * this capability is supported. |
| */ |
| TEST_ALLOCATE = 1, |
| |
| /* |
| * IAllocatorClient::BufferDescriptorInfo::layerCount must be 1 unless |
| * this capability is supported. |
| */ |
| LAYERED_BUFFERS = 2, |
| }; |
| |
| /* |
| * Provides a list of supported capabilities (as described in the |
| * definition of Capability above). This list must not change after |
| * initialization. |
| * |
| * @return capabilities is a list of supported capabilities. |
| */ |
| @entry |
| @exit |
| @callflow(next="*") |
| getCapabilities() generates (vec<Capability> capabilities); |
| |
| /* |
| * Retrieves implementation-defined debug information, which will be |
| * displayed during, for example, `dumpsys SurfaceFlinger`. |
| * |
| * @return debugInfo is a string of debug information. |
| */ |
| @entry |
| @exit |
| @callflow(next="*") |
| dumpDebugInfo() generates (string debugInfo); |
| |
| /* |
| * Creates a client of the allocator. All resources created by the client |
| * are owned by the client and are only visible to the client, unless they |
| * are exported by exportHandle. |
| * |
| * @return error is NONE upon success. Otherwise, |
| * NO_RESOURCES when no more client can currently be created. |
| * @return client is the newly created client. |
| */ |
| @entry |
| @callflow(next="*") |
| createClient() generates (Error error, IAllocatorClient client); |
| }; |