Skip to content

Commit

Permalink
Allow renderers to build with pytype.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 520145182
Change-Id: I7875a1e39d7e65d32132d47a0ff62b4174ea6e16
  • Loading branch information
nimrod-gileadi authored and copybara-github committed Mar 28, 2023
1 parent 6817b67 commit 9c06314
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions dm_control/_render/pyopengl/egl_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class EGLContext(base.ContextBase):
def __init__(self, max_width, max_height):
# EGLContext currently only works with `PassthroughRenderExecutor`.
# TODO(b/110927854) Make this work with the offloading executor.
self._context = None
super().__init__(max_width, max_height, executor.PassthroughRenderExecutor)

def _platform_init(self, unused_max_width, unused_max_height):
Expand Down
4 changes: 4 additions & 0 deletions dm_control/_render/pyopengl/osmesa_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
class OSMesaContext(base.ContextBase):
"""An OpenGL context backed by OSMesa."""

def __init__(self, *args, **kwargs):
self._context = None
super().__init__(*args, **kwargs)

def _platform_init(self, max_width, max_height):
"""Initializes this OSMesa context."""
self._context = osmesa.OSMesaCreateContextExt(
Expand Down

0 comments on commit 9c06314

Please sign in to comment.