summaryrefslogtreecommitdiff
path: root/include/input/InputWindow.h
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2020-04-13 16:55:27 -0700
committer Rob Carr <racarr@google.com> 2020-04-14 20:30:11 +0000
commit7174efe2182376411ba2bcfb67d7e6025111183f (patch)
tree0270191d786023417ffd336daaa229cbfe8f9f49 /include/input/InputWindow.h
parent696b6c83b15397d6c6088f5be58e5f78e998d72b (diff)
InputWindow: Default initialize all values
A future patch will initialize InputWindows from a new location. It's a little troublesome to have to keep track of which values are initialized by default and not. Bug: 152064592 Test: Existing tests pass Change-Id: I200d9c050d8bf6d96c45ce75f95cb4d6537ab0ba
Diffstat (limited to 'include/input/InputWindow.h')
-rw-r--r--include/input/InputWindow.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/include/input/InputWindow.h b/include/input/InputWindow.h
index c44db514d2..edaf8f530b 100644
--- a/include/input/InputWindow.h
+++ b/include/input/InputWindow.h
@@ -123,17 +123,17 @@ struct InputWindowInfo {
// input windows that have the same token.
sp<IBinder> token;
// This uniquely identifies the input window.
- int32_t id = 0;
+ int32_t id = -1;
std::string name;
- int32_t layoutParamsFlags;
- int32_t layoutParamsType;
- nsecs_t dispatchingTimeout;
+ int32_t layoutParamsFlags = 0;
+ int32_t layoutParamsType = 0;
+ nsecs_t dispatchingTimeout = -1;
/* These values are filled in by SurfaceFlinger. */
- int32_t frameLeft;
- int32_t frameTop;
- int32_t frameRight;
- int32_t frameBottom;
+ int32_t frameLeft = -1;
+ int32_t frameTop = -1;
+ int32_t frameRight = -1;
+ int32_t frameBottom = -1;
/*
* SurfaceFlinger consumes this value to shrink the computed frame. This is
@@ -145,7 +145,7 @@ struct InputWindowInfo {
// A global scaling factor for all windows. Unlike windowScaleX/Y this results
// in scaling of the TOUCH_MAJOR/TOUCH_MINOR axis.
- float globalScaleFactor;
+ float globalScaleFactor = 1.0f;
// Scaling factors applied to individual windows.
float windowXScale = 1.0f;
@@ -156,18 +156,18 @@ struct InputWindowInfo {
* to absolute coordinates by SurfaceFlinger once the frame is computed.
*/
Region touchableRegion;
- bool visible;
- bool canReceiveKeys;
- bool hasFocus;
- bool hasWallpaper;
- bool paused;
- int32_t ownerPid;
- int32_t ownerUid;
- int32_t inputFeatures;
- int32_t displayId;
+ bool visible = false;
+ bool canReceiveKeys = false;
+ bool hasFocus = false;
+ bool hasWallpaper = false;
+ bool paused = false;
+ int32_t ownerPid = -1;
+ int32_t ownerUid = -1;
+ int32_t inputFeatures = 0;
+ int32_t displayId = ADISPLAY_ID_NONE;
int32_t portalToDisplayId = ADISPLAY_ID_NONE;
InputApplicationInfo applicationInfo;
- bool replaceTouchableRegionWithCrop;
+ bool replaceTouchableRegionWithCrop = false;
wp<IBinder> touchableRegionCropHandle;
void addTouchableRegion(const Rect& region);