Skip to content

Commit 7a0e393

Browse files
Dominik LaskowskiAndroid (Google) Code Review
authored andcommitted
Merge "ui: Pull PhysicalDisplayId into its own header"
2 parents 0be01b4 + 5acb2b8 commit 7a0e393

File tree

5 files changed

+35
-8
lines changed

5 files changed

+35
-8
lines changed

libs/gui/include/gui/ISurfaceComposer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <ui/FrameStats.h>
3131
#include <ui/GraphicBuffer.h>
3232
#include <ui/GraphicTypes.h>
33+
#include <ui/PhysicalDisplayId.h>
3334
#include <ui/PixelFormat.h>
3435

3536
#include <utils/Errors.h>

libs/ui/include/ui/GraphicTypes.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,12 @@
1616

1717
#pragma once
1818

19-
#include <cinttypes>
20-
#include <cstdint>
21-
2219
#include <android/hardware/graphics/common/1.1/types.h>
2320
#include <android/hardware/graphics/common/1.2/types.h>
2421
#include <system/graphics.h>
2522

26-
#define ANDROID_PHYSICAL_DISPLAY_ID_FORMAT PRIu64
27-
2823
namespace android {
2924

30-
using PhysicalDisplayId = uint64_t;
31-
3225
// android::ui::* in this header file will alias different types as
3326
// the HIDL interface is updated.
3427
namespace ui {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2019 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 <cinttypes>
20+
#include <cstdint>
21+
22+
#define ANDROID_PHYSICAL_DISPLAY_ID_FORMAT PRIu64
23+
24+
namespace android {
25+
26+
using PhysicalDisplayId = uint64_t;
27+
28+
constexpr uint8_t getPhysicalDisplayPort(PhysicalDisplayId displayId) {
29+
return static_cast<uint8_t>(displayId);
30+
}
31+
32+
} // namespace android
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../include/ui/PhysicalDisplayId.h

services/surfaceflinger/DisplayHardware/DisplayIdentification.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <string_view>
2424
#include <vector>
2525

26-
#include <ui/GraphicTypes.h>
26+
#include <ui/PhysicalDisplayId.h>
2727

2828
namespace android {
2929

0 commit comments

Comments
 (0)