2015-11-05 09:22:17 -08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 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.
|
|
|
|
*/
|
|
|
|
#ifndef DEVICEINFO_H
|
|
|
|
#define DEVICEINFO_H
|
|
|
|
|
2018-12-11 07:56:07 -08:00
|
|
|
#include <SkImageInfo.h>
|
2017-07-17 09:55:02 -07:00
|
|
|
#include <ui/DisplayInfo.h>
|
|
|
|
|
2017-11-03 10:12:19 -07:00
|
|
|
#include "utils/Macros.h"
|
2015-11-05 09:22:17 -08:00
|
|
|
|
|
|
|
namespace android {
|
|
|
|
namespace uirenderer {
|
|
|
|
|
2018-09-13 14:14:00 -04:00
|
|
|
namespace renderthread {
|
|
|
|
class RenderThread;
|
|
|
|
}
|
|
|
|
|
2015-11-05 09:22:17 -08:00
|
|
|
class DeviceInfo {
|
|
|
|
PREVENT_COPY_AND_ASSIGN(DeviceInfo);
|
2017-11-03 10:12:19 -07:00
|
|
|
|
2015-11-05 09:22:17 -08:00
|
|
|
public:
|
|
|
|
static const DeviceInfo* get();
|
|
|
|
|
2018-09-13 14:14:00 -04:00
|
|
|
// this value is only valid after the GPU has been initialized and there is a valid graphics
|
|
|
|
// context or if you are using the HWUI_NULL_GPU
|
|
|
|
int maxTextureSize() const;
|
2017-07-17 09:55:02 -07:00
|
|
|
const DisplayInfo& displayInfo() const { return mDisplayInfo; }
|
2018-12-11 07:56:07 -08:00
|
|
|
SkColorSpace::Gamut getWideColorGamut() const { return mWideColorGamut; }
|
|
|
|
sk_sp<SkColorSpace> getWideColorSpace() const { return mWideColorSpace; }
|
|
|
|
SkColorType getWideColorType() const { return mWideColorType; }
|
2018-03-16 17:27:17 -07:00
|
|
|
|
2015-11-05 09:22:17 -08:00
|
|
|
private:
|
2018-09-13 14:14:00 -04:00
|
|
|
friend class renderthread::RenderThread;
|
|
|
|
static void setMaxTextureSize(int maxTextureSize);
|
2018-09-10 16:28:08 -07:00
|
|
|
|
2018-09-13 14:14:00 -04:00
|
|
|
DeviceInfo();
|
2015-11-05 09:22:17 -08:00
|
|
|
|
|
|
|
int mMaxTextureSize;
|
2017-07-17 09:55:02 -07:00
|
|
|
DisplayInfo mDisplayInfo;
|
2018-12-11 07:56:07 -08:00
|
|
|
SkColorSpace::Gamut mWideColorGamut;
|
|
|
|
sk_sp<SkColorSpace> mWideColorSpace;
|
|
|
|
SkColorType mWideColorType;
|
2015-11-05 09:22:17 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace uirenderer */
|
|
|
|
} /* namespace android */
|
|
|
|
|
|
|
|
#endif /* DEVICEINFO_H */
|