MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / _has_high_dpi

Function _has_high_dpi

dm_control/viewer/renderer.py:54–66  ·  view source on GitHub ↗

Returns True if the display is a high DPI display.

()

Source from the content-addressed store, hash-verified

52
53
54def _has_high_dpi() -> bool:
55 """Returns True if the display is a high DPI display."""
56 if sys.platform == 'darwin':
57 # On macOS, we can use the system_profiler command to determine if the
58 # display is retina.
59 return subprocess.call(
60 'system_profiler SPDisplaysDataType | grep -i "retina"',
61 shell=True,
62 stdout=subprocess.DEVNULL,
63 stderr=subprocess.DEVNULL
64 ) == 0
65 # TODO(zakka): Figure out how to detect high DPI displays on Linux.
66 return False
67
68
69class BaseRenderer(metaclass=abc.ABCMeta):

Callers 1

renderMethod · 0.85

Calls 1

callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…