Loading libs/input/InputDispatcher.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ #include <utils/Trace.h> #include <cutils/log.h> #include <androidfw/PowerManager.h> #include <ui/Region.h> #include <stddef.h> #include <unistd.h> Loading Loading @@ -172,21 +173,23 @@ static bool isMainDisplay(int32_t displayId) { return displayId == ADISPLAY_ID_DEFAULT || displayId == ADISPLAY_ID_NONE; } static void dumpRegion(String8& dump, const SkRegion& region) { static void dumpRegion(String8& dump, const Region& region) { if (region.isEmpty()) { dump.append("<empty>"); return; } bool first = true; for (SkRegion::Iterator it(region); !it.done(); it.next()) { Region::const_iterator cur = region.begin(); Region::const_iterator const tail = region.end(); while (cur != tail) { if (first) { first = false; } else { dump.append("|"); } const SkIRect& rect = it.rect(); dump.appendFormat("[%d,%d][%d,%d]", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom); dump.appendFormat("[%d,%d][%d,%d]", cur->left, cur->top, cur->right, cur->bottom); cur++; } } Loading libs/input/InputWindow.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -15,14 +15,21 @@ */ #define LOG_TAG "InputWindow" #define LOG_NDEBUG 0 #include "InputWindow.h" #include <cutils/log.h> #include <ui/Rect.h> #include <ui/Region.h> namespace android { // --- InputWindowInfo --- void InputWindowInfo::addTouchableRegion(const Rect& region) { touchableRegion.orSelf(region); } bool InputWindowInfo::touchableRegionContainsPoint(int32_t x, int32_t y) const { return touchableRegion.contains(x,y); Loading libs/input/InputWindow.h +6 −3 Original line number Diff line number Diff line Loading @@ -19,16 +19,17 @@ #include <input/Input.h> #include <input/InputTransport.h> #include <ui/Rect.h> #include <ui/Region.h> #include <utils/RefBase.h> #include <utils/Timers.h> #include <utils/String8.h> #include <SkRegion.h> #include "InputApplication.h" namespace android { /* * Describes the properties of a window that can receive input. */ Loading Loading @@ -125,7 +126,7 @@ struct InputWindowInfo { int32_t frameRight; int32_t frameBottom; float scaleFactor; SkRegion touchableRegion; Region touchableRegion; bool visible; bool canReceiveKeys; bool hasFocus; Loading @@ -137,6 +138,8 @@ struct InputWindowInfo { int32_t inputFeatures; int32_t displayId; void addTouchableRegion(const Rect& region); bool touchableRegionContainsPoint(int32_t x, int32_t y) const; bool frameContainsPoint(int32_t x, int32_t y) const; Loading services/core/jni/com_android_server_input_InputWindowHandle.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <android_view_InputChannel.h> #include <android/graphics/Region.h> #include <ui/Region.h> #include "com_android_server_input_InputWindowHandle.h" #include "com_android_server_input_InputApplicationHandle.h" Loading Loading @@ -86,6 +87,8 @@ bool NativeInputWindowHandle::updateInfo() { if (!mInfo) { mInfo = new InputWindowInfo(); } else { mInfo->touchableRegion.clear(); } jobject inputChannelObj = env->GetObjectField(obj, Loading Loading @@ -131,10 +134,11 @@ bool NativeInputWindowHandle::updateInfo() { gInputWindowHandleClassInfo.touchableRegion); if (regionObj) { SkRegion* region = android_graphics_Region_getSkRegion(env, regionObj); mInfo->touchableRegion.set(*region); for (SkRegion::Iterator it(*region); !it.done(); it.next()) { const SkIRect& rect = it.rect(); mInfo->addTouchableRegion(Rect(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom)); } env->DeleteLocalRef(regionObj); } else { mInfo->touchableRegion.setEmpty(); } mInfo->visible = env->GetBooleanField(obj, Loading Loading
libs/input/InputDispatcher.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ #include <utils/Trace.h> #include <cutils/log.h> #include <androidfw/PowerManager.h> #include <ui/Region.h> #include <stddef.h> #include <unistd.h> Loading Loading @@ -172,21 +173,23 @@ static bool isMainDisplay(int32_t displayId) { return displayId == ADISPLAY_ID_DEFAULT || displayId == ADISPLAY_ID_NONE; } static void dumpRegion(String8& dump, const SkRegion& region) { static void dumpRegion(String8& dump, const Region& region) { if (region.isEmpty()) { dump.append("<empty>"); return; } bool first = true; for (SkRegion::Iterator it(region); !it.done(); it.next()) { Region::const_iterator cur = region.begin(); Region::const_iterator const tail = region.end(); while (cur != tail) { if (first) { first = false; } else { dump.append("|"); } const SkIRect& rect = it.rect(); dump.appendFormat("[%d,%d][%d,%d]", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom); dump.appendFormat("[%d,%d][%d,%d]", cur->left, cur->top, cur->right, cur->bottom); cur++; } } Loading
libs/input/InputWindow.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -15,14 +15,21 @@ */ #define LOG_TAG "InputWindow" #define LOG_NDEBUG 0 #include "InputWindow.h" #include <cutils/log.h> #include <ui/Rect.h> #include <ui/Region.h> namespace android { // --- InputWindowInfo --- void InputWindowInfo::addTouchableRegion(const Rect& region) { touchableRegion.orSelf(region); } bool InputWindowInfo::touchableRegionContainsPoint(int32_t x, int32_t y) const { return touchableRegion.contains(x,y); Loading
libs/input/InputWindow.h +6 −3 Original line number Diff line number Diff line Loading @@ -19,16 +19,17 @@ #include <input/Input.h> #include <input/InputTransport.h> #include <ui/Rect.h> #include <ui/Region.h> #include <utils/RefBase.h> #include <utils/Timers.h> #include <utils/String8.h> #include <SkRegion.h> #include "InputApplication.h" namespace android { /* * Describes the properties of a window that can receive input. */ Loading Loading @@ -125,7 +126,7 @@ struct InputWindowInfo { int32_t frameRight; int32_t frameBottom; float scaleFactor; SkRegion touchableRegion; Region touchableRegion; bool visible; bool canReceiveKeys; bool hasFocus; Loading @@ -137,6 +138,8 @@ struct InputWindowInfo { int32_t inputFeatures; int32_t displayId; void addTouchableRegion(const Rect& region); bool touchableRegionContainsPoint(int32_t x, int32_t y) const; bool frameContainsPoint(int32_t x, int32_t y) const; Loading
services/core/jni/com_android_server_input_InputWindowHandle.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <android_view_InputChannel.h> #include <android/graphics/Region.h> #include <ui/Region.h> #include "com_android_server_input_InputWindowHandle.h" #include "com_android_server_input_InputApplicationHandle.h" Loading Loading @@ -86,6 +87,8 @@ bool NativeInputWindowHandle::updateInfo() { if (!mInfo) { mInfo = new InputWindowInfo(); } else { mInfo->touchableRegion.clear(); } jobject inputChannelObj = env->GetObjectField(obj, Loading Loading @@ -131,10 +134,11 @@ bool NativeInputWindowHandle::updateInfo() { gInputWindowHandleClassInfo.touchableRegion); if (regionObj) { SkRegion* region = android_graphics_Region_getSkRegion(env, regionObj); mInfo->touchableRegion.set(*region); for (SkRegion::Iterator it(*region); !it.done(); it.next()) { const SkIRect& rect = it.rect(); mInfo->addTouchableRegion(Rect(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom)); } env->DeleteLocalRef(regionObj); } else { mInfo->touchableRegion.setEmpty(); } mInfo->visible = env->GetBooleanField(obj, Loading