John Reck | e170fb6 | 2018-05-07 08:12:07 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include <hwui/Bitmap.h> |
| 20 | |
| 21 | namespace android::uirenderer { |
| 22 | |
Leon Scroggins III | ee3bfe7 | 2019-01-31 08:42:23 -0500 | [diff] [blame] | 23 | class ANDROID_API HardwareBitmapUploader { |
John Reck | e170fb6 | 2018-05-07 08:12:07 -0700 | [diff] [blame] | 24 | public: |
Greg Daniel | c073252 | 2019-02-20 08:31:03 -0500 | [diff] [blame] | 25 | static void initialize(); |
John Reck | 6104cea | 2019-01-10 14:37:17 -0800 | [diff] [blame] | 26 | static void terminate(); |
Leon Scroggins III | ee3bfe7 | 2019-01-31 08:42:23 -0500 | [diff] [blame] | 27 | |
Greg Daniel | c073252 | 2019-02-20 08:31:03 -0500 | [diff] [blame] | 28 | static sk_sp<Bitmap> allocateHardwareBitmap(const SkBitmap& sourceBitmap); |
| 29 | |
Jerome Gaillard | 21e7e2d | 2019-05-14 14:34:46 +0100 | [diff] [blame] | 30 | #ifdef __ANDROID__ |
Leon Scroggins III | ee3bfe7 | 2019-01-31 08:42:23 -0500 | [diff] [blame] | 31 | static bool hasFP16Support(); |
Jerome Gaillard | 21e7e2d | 2019-05-14 14:34:46 +0100 | [diff] [blame] | 32 | #else |
| 33 | static bool hasFP16Support() { |
| 34 | return true; |
| 35 | } |
| 36 | #endif |
John Reck | e170fb6 | 2018-05-07 08:12:07 -0700 | [diff] [blame] | 37 | }; |
| 38 | |
Chris Blume | 7b8a808 | 2018-11-30 15:51:58 -0800 | [diff] [blame] | 39 | } // namespace android::uirenderer |