Add screen pixel to screen DIP conversion methods.

On Windows these new CefDisplay methods convert between screen pixel coordinates
and screen DIP coordinates. On macOS and Linux these methods just return a copy
of the input coordinates.
This commit is contained in:
npavlov
2022-10-13 20:43:40 +02:00
committed by Marshall Greenblatt
parent fa643b269e
commit 485f0b9caf
10 changed files with 171 additions and 8 deletions

View File

@@ -91,6 +91,20 @@ class CefDisplay : public CefBaseRefCounted {
/*--cef(count_func=displays:GetDisplayCount)--*/
static void GetAllDisplays(std::vector<CefRefPtr<CefDisplay>>& displays);
///
/// Convert |point| from DIP screen coordinates to pixel screen coordinates.
/// This method is only used on Windows.
///
/*--cef()--*/
static CefPoint ConvertScreenPointToPixels(const CefPoint& point);
///
/// Convert |point| from pixel screen coordinates to DIP screen coordinates.
/// This method is only used on Windows.
///
/*--cef()--*/
static CefPoint ConvertScreenPointFromPixels(const CefPoint& point);
///
/// Returns the unique identifier for this Display.
///