diff options
author | Chia-I Wu <olv@google.com> | 2017-12-15 14:58:58 -0800 |
---|---|---|
committer | Chia-I Wu <olv@google.com> | 2018-01-14 21:39:38 -0800 |
commit | 699df2167a9749ae3f091b7f5ed2e343251afbcc (patch) | |
tree | 58a07c4f5a384324f2806ef31b4ad099fdf606d3 /graphics/allocator/2.0/default/passthrough.cpp | |
parent | 864c9f82340cae767c3665c91abe3cfc7928ac64 (diff) |
graphics: use allocator HAL support library in default impl
Rename Gralloc0Allocator to Gralloc0Hal and make it inherit from
AllocatorHal. Do the same to Gralloc1Allocator. Add GrallocLoader
to load either of Gralloc[01]Hal and create a IAllocator instance.
Test: boots and VTS
Change-Id: I09ae680c0086ca9e73e412a34d7cd2f3665d3bc2
Diffstat (limited to 'graphics/allocator/2.0/default/passthrough.cpp')
-rw-r--r-- | graphics/allocator/2.0/default/passthrough.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/graphics/allocator/2.0/default/passthrough.cpp b/graphics/allocator/2.0/default/passthrough.cpp new file mode 100644 index 0000000000..132cab3c60 --- /dev/null +++ b/graphics/allocator/2.0/default/passthrough.cpp @@ -0,0 +1,25 @@ +/* + * Copyright 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. + */ + +#include <allocator-passthrough/2.0/GrallocLoader.h> +#include <android/hardware/graphics/allocator/2.0/IAllocator.h> + +using android::hardware::graphics::allocator::V2_0::IAllocator; +using android::hardware::graphics::allocator::V2_0::passthrough::GrallocLoader; + +extern "C" IAllocator* HIDL_FETCH_IAllocator(const char* /* name */) { + return GrallocLoader::load(); +} |