blob: 74e1907615f45084b272ae4dd943c8b9af151299 [file] [log] [blame]
Miao Wangda488202018-10-29 16:26:26 -07001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Miao Wang4772b602017-01-20 10:30:38 -080017#ifndef ANDROID_HARDWARE_RENDERSCRIPT_V1_0_DEVICE_H
18#define ANDROID_HARDWARE_RENDERSCRIPT_V1_0_DEVICE_H
19
20#include "cpp/rsDispatch.h"
21#include "dlfcn.h"
22#include <android/hardware/renderscript/1.0/IDevice.h>
23#include <hidl/MQDescriptor.h>
24#include <hidl/Status.h>
25
26namespace android {
27namespace hardware {
28namespace renderscript {
29namespace V1_0 {
30namespace implementation {
31
32using ::android::hardware::renderscript::V1_0::ContextType;
33using ::android::hardware::renderscript::V1_0::IContext;
34using ::android::hardware::renderscript::V1_0::IDevice;
35using ::android::hidl::base::V1_0::IBase;
36using ::android::hardware::Return;
37using ::android::sp;
38
39struct Device : public IDevice {
40 Device();
41 static dispatchTable& getHal();
42
43 // Methods from ::android::hardware::renderscript::V1_0::IDevice follow.
44 Return<sp<IContext>> contextCreate(uint32_t sdkVersion, ContextType ct, int32_t flags) override;
45
46 // Methods from ::android::hidl::base::V1_0::IBase follow.
47
48 private:
49 static dispatchTable mDispatchHal;
50};
51
52extern "C" IDevice* HIDL_FETCH_IDevice(const char* name);
53
54} // namespace implementation
55} // namespace V1_0
56} // namespace renderscript
57} // namespace hardware
58} // namespace android
59
60#endif // ANDROID_HARDWARE_RENDERSCRIPT_V1_0_DEVICE_H