2018-05-07 08:12:07 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hwui/Bitmap.h>
|
|
|
|
|
|
|
|
namespace android::uirenderer {
|
|
|
|
|
2020-02-21 13:07:28 -05:00
|
|
|
class HardwareBitmapUploader {
|
2018-05-07 08:12:07 -07:00
|
|
|
public:
|
2019-02-20 08:31:03 -05:00
|
|
|
static void initialize();
|
2019-01-10 14:37:17 -08:00
|
|
|
static void terminate();
|
2019-01-31 08:42:23 -05:00
|
|
|
|
2019-02-20 08:31:03 -05:00
|
|
|
static sk_sp<Bitmap> allocateHardwareBitmap(const SkBitmap& sourceBitmap);
|
|
|
|
|
2019-05-14 14:34:46 +01:00
|
|
|
#ifdef __ANDROID__
|
2019-01-31 08:42:23 -05:00
|
|
|
static bool hasFP16Support();
|
2019-05-14 14:34:46 +01:00
|
|
|
#else
|
|
|
|
static bool hasFP16Support() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
2018-05-07 08:12:07 -07:00
|
|
|
};
|
|
|
|
|
2018-11-30 15:51:58 -08:00
|
|
|
} // namespace android::uirenderer
|