John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 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 | #ifndef DEVICEINFO_H |
| 17 | #define DEVICEINFO_H |
| 18 | |
John Reck | 8dc02f9 | 2017-07-17 09:55:02 -0700 | [diff] [blame] | 19 | #include <ui/DisplayInfo.h> |
| 20 | |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 21 | #include "utils/Macros.h" |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 22 | |
| 23 | namespace android { |
| 24 | namespace uirenderer { |
| 25 | |
Derek Sollenberger | 1766238 | 2018-09-13 14:14:00 -0400 | [diff] [blame] | 26 | namespace renderthread { |
| 27 | class RenderThread; |
| 28 | } |
| 29 | |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 30 | class DeviceInfo { |
| 31 | PREVENT_COPY_AND_ASSIGN(DeviceInfo); |
John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 32 | |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 33 | public: |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 34 | static const DeviceInfo* get(); |
| 35 | |
Derek Sollenberger | 1766238 | 2018-09-13 14:14:00 -0400 | [diff] [blame] | 36 | // this value is only valid after the GPU has been initialized and there is a valid graphics |
| 37 | // context or if you are using the HWUI_NULL_GPU |
| 38 | int maxTextureSize() const; |
John Reck | 8dc02f9 | 2017-07-17 09:55:02 -0700 | [diff] [blame] | 39 | const DisplayInfo& displayInfo() const { return mDisplayInfo; } |
John Reck | 5642847 | 2018-03-16 17:27:17 -0700 | [diff] [blame] | 40 | |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 41 | private: |
Derek Sollenberger | 1766238 | 2018-09-13 14:14:00 -0400 | [diff] [blame] | 42 | friend class renderthread::RenderThread; |
| 43 | static void setMaxTextureSize(int maxTextureSize); |
Peiyong Lin | 1f6aa12 | 2018-09-10 16:28:08 -0700 | [diff] [blame] | 44 | |
Derek Sollenberger | 1766238 | 2018-09-13 14:14:00 -0400 | [diff] [blame] | 45 | DeviceInfo(); |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 46 | |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 47 | int mMaxTextureSize; |
John Reck | 8dc02f9 | 2017-07-17 09:55:02 -0700 | [diff] [blame] | 48 | DisplayInfo mDisplayInfo; |
John Reck | 704bed0 | 2015-11-05 09:22:17 -0800 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | } /* namespace uirenderer */ |
| 52 | } /* namespace android */ |
| 53 | |
| 54 | #endif /* DEVICEINFO_H */ |