diff options
| author | 2024-02-09 18:09:50 +0000 | |
|---|---|---|
| committer | 2024-02-09 18:11:00 +0000 | |
| commit | 4b4f52f78fbf3d0959ba98c65b2d863c58f521e2 (patch) | |
| tree | 3c70ba74d41b279626dd255b60b2a424ea863cba | |
| parent | 2f85bb8d216b34a704af0e63aca9402ff713a43c (diff) | |
SpriteIcon: Clean up header
Bug: 305193969
Test: build
Change-Id: Ib1c910a11810b2eb4910c455363273ea20a2d080
| -rw-r--r-- | libs/input/SpriteIcon.h | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/libs/input/SpriteIcon.h b/libs/input/SpriteIcon.h index 9e6cc81f0bb4..0939af46c258 100644 --- a/libs/input/SpriteIcon.h +++ b/libs/input/SpriteIcon.h @@ -27,33 +27,20 @@ namespace android { * Icon that a sprite displays, including its hotspot. */ struct SpriteIcon { - inline SpriteIcon() : style(PointerIconStyle::TYPE_NULL), hotSpotX(0), hotSpotY(0) {} - inline SpriteIcon(const graphics::Bitmap& bitmap, PointerIconStyle style, float hotSpotX, - float hotSpotY, bool drawNativeDropShadow) + explicit SpriteIcon() = default; + explicit SpriteIcon(const graphics::Bitmap& bitmap, PointerIconStyle style, float hotSpotX, + float hotSpotY, bool drawNativeDropShadow) : bitmap(bitmap), style(style), hotSpotX(hotSpotX), hotSpotY(hotSpotY), drawNativeDropShadow(drawNativeDropShadow) {} - graphics::Bitmap bitmap; - PointerIconStyle style; - float hotSpotX; - float hotSpotY; - bool drawNativeDropShadow; - - inline SpriteIcon copy() const { - return SpriteIcon(bitmap.copy(ANDROID_BITMAP_FORMAT_RGBA_8888), style, hotSpotX, hotSpotY, - drawNativeDropShadow); - } - - inline void reset() { - bitmap.reset(); - style = PointerIconStyle::TYPE_NULL; - hotSpotX = 0; - hotSpotY = 0; - drawNativeDropShadow = false; - } + graphics::Bitmap bitmap{}; + PointerIconStyle style{PointerIconStyle::TYPE_NULL}; + float hotSpotX{}; + float hotSpotY{}; + bool drawNativeDropShadow{false}; inline bool isValid() const { return bitmap.isValid() && !bitmap.isEmpty(); } |