Skip to content

Commit

Permalink
Remove OpenGL backend (#1029)
Browse files Browse the repository at this point in the history
The OpenGL backend requires a lot of effort to maintain, is not complete and doesn't seem to be be being used in practice.

Fixes #1010
  • Loading branch information
corranwebster authored Apr 18, 2023
1 parent 03bb941 commit 7292e61
Show file tree
Hide file tree
Showing 69 changed files with 15 additions and 13,765 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/bleeding-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
if: matrix.toolkit != 'wx' && matrix.toolkit != 'null'
- name: Install dependencies for Linux
run: |
# needed for GL
sudo apt-get install libglu1-mesa-dev
# needed for Celiagg
sudo apt-get install libfreetype-dev libharfbuzz-dev
# needed for Cairo
Expand All @@ -49,7 +47,7 @@ jobs:
run: |
python -m pip install --upgrade pip wheel
- name: Install local packages
run: pip install ".[cairo,gl,layout,pdf,svg,test,${{ matrix.toolkit }}]"
run: pip install ".[cairo,layout,pdf,svg,test,${{ matrix.toolkit }}]"
- name: Install source dependencies
run: |
python -m pip install git+https://github.com/enthought/traits.git
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/test-with-edm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
if: matrix.toolkit != 'wx'
- name: Install GL dependencies for Linux
run: sudo apt-get install libglu1-mesa-dev
- name: Cache EDM packages
uses: actions/cache@v2
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test-with-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
if: matrix.toolkit != 'wx' && matrix.toolkit != 'null'
- name: Install dependencies for Linux
run: |
# needed for GL
sudo apt-get install libglu1-mesa-dev
# needed for Celiagg
sudo apt-get install libfreetype-dev libharfbuzz-dev
# needed for Cairo
Expand All @@ -52,7 +50,7 @@ jobs:
run: |
python -m pip install --upgrade pip wheel
- name: Install local packages
run: pip install ".[cairo,gl,layout,pdf,svg,test,${{ matrix.toolkit }}]"
run: pip install ".[cairo,layout,pdf,svg,test,${{ matrix.toolkit }}]"
- name: Install celiagg manually
# This is needed until new release of celiagg
# - numpy is needed for install in current released version
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ kiva/agg/src/gtk1/plat_support_wrap.cpp
kiva/agg/src/osx/plat_support_wrap.cpp
kiva/agg/src/win32/plat_support_wrap.cpp
kiva/agg/src/x11/plat_support_wrap.cpp
kiva/gl/gl.py
kiva/gl/gl_wrap.cpp
kiva/quartz/ABCGI.c
kiva/quartz/CTFont.c

Expand Down
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ the Enable/Kiva project:
- `SWIG <http://www.swig.org/>`_
- `fonttools <https://pypi.org/project/FontTools>`_
- (on Linux) X11-devel (development tools for X11)
- (on Linux) libglu1-mesa-dev (OpenGL utility library for development)
- (on Mac OS X) `Cython <https://cython.org/>`_

Enable/Kiva also have the following requirements:
Expand All @@ -89,8 +88,6 @@ Enable/Kiva also have the following requirements:
- `apptools <https://pypi.org/project/apptools/>`_
- (Qt backend) `PySide <https://pypi.org/project/PySide>`_ or `PyQt4 <https://pypi.org/project/PyQt4>`_
- (WX backend) `WxPython <https://pypi.org/project/wxPython/>`_
- (GL backend) `pyglet <https://pypi.org/project/pyglet/>`_
- (GL backend) `pygarrayimage <https://pypi.org/project/pygarrayimage>`_
- (SVG backend) `PyParsing <https://pypi.org/project/pyparsing>`_
- (PDF backend) `ReportLab Toolkit <https://www.reportlab.com/dev/install/version_3_and_up/>`_
- (Cairo backend) `PyCairo <https://cairographics.org/releases/>`_
Expand Down
1 change: 0 additions & 1 deletion ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ def docs(runtime, toolkit, environment):
"kiva/qpainter.py",
"kiva/svg.py",
"kiva/agg",
"kiva/gl",
"kiva/quartz",
"*/tests",
])
Expand Down
2 changes: 0 additions & 2 deletions ci/requirements_3.8.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
pygarrayimage
pyglet<2.0
pypdf2<3.0
reportlab
3 changes: 1 addition & 2 deletions docs/source/enable/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ Backbuffer
A backbuffer provides the ability to render into an offscreen buffer, which is
blitted on every draw, until it is invalidated. Various traits such as
:attr:`use_backbuffer` and :attr:`backbuffer_padding` control the behavior of
the backbuffer. A backbuffer is used for non-OpenGL backends, such as `agg`
and on OS X. If :attr:`use_backbuffer` is False, a backbuffer is never used,
the backbuffer. If :attr:`use_backbuffer` is False, a backbuffer is never used,
even if a backbuffer is referenced by a component.

Users typically subclass Chaco :class:`PlotComponent`, but may need features
Expand Down
10 changes: 3 additions & 7 deletions docs/source/kiva/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ Kiva is a 2D vector drawing interface providing functionality similar to
`Quartz <http://en.wikipedia.org/wiki/Quartz_2D>`_,
`Cairo <http://cairographics.org/>`_, the
`Qt QPainter interface <http://qt-project.org/doc/qt-4.8/qpainter.html>`_,
the 2D drawing routines of `OpenGL <http://www.opengl.org/>`_ , the HTML5
Canvas element and many other similar 2D vector drawing APIs. Rather than
re-implementing everything, Kiva is a Python interface layer that sits on top
of many different back-ends, some of which are in fact provided by some of
the HTML5 Canvas element and many other similar 2D vector drawing APIs. Rather
than re-implementing everything, Kiva is a Python interface layer that sits on
top of many different back-ends, some of which are in fact provided by some of
these libraries. Which back-ends are available depends on the platform, GUI
toolkit, and capabilities of the system. For example the Quartz backend is only
available on Mac OS systems, while the QPainter backend is available if PyQt
Expand Down Expand Up @@ -410,9 +409,6 @@ celiagg
kiva/enable. It is planned that this will become the default image backend
in a future release.

gl
OpenGL drawing. This backend is quite limited compared to others.

qpainter
Qt ``QPainter`` drawing. This is only availble with the Qt toolkit.

Expand Down
4 changes: 1 addition & 3 deletions enable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
# Dependencies for documentation
"docs": ["enthought-sphinx-theme", "sphinx", "sphinx-copybutton"],
# Dependencies for running enable/kiva's examples
"examples": ["chaco", "mayavi", "scipy", "kiwisolver", "pyglet"],
# Dependencies for GL backend support
"gl": ["pygarrayimage", "pyglet<2.0"],
"examples": ["chaco", "mayavi", "scipy", "kiwisolver"],
# Dependencies for constrained layout
"layout": ["kiwisolver"],
# Dependencies for PDF backend
Expand Down
6 changes: 1 addition & 5 deletions enable/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,11 +729,7 @@ def _draw(self, gc, view_bounds=None, mode="default"):
self.drawn_outer_position = list(self.outer_position[:])
self.drawn_outer_bounds = list(self.outer_bounds[:])

# OpenGL-based graphics-contexts have a `gl_init()` method. We
# test for this to avoid having to import the OpenGL
# GraphicsContext just to do an isinstance() check.
is_gl = hasattr(gc, "gl_init")
if self.use_backbuffer and (not is_gl):
if self.use_backbuffer:
if self.backbuffer_padding:
x, y = self.outer_position
width, height = self.outer_bounds
Expand Down
1 change: 0 additions & 1 deletion enable/gcbench/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"blend2d": "enable.null.blend2d",
"cairo": "enable.null.cairo",
"celiagg": "enable.null.celiagg",
"opengl": "enable.gcbench.opengl",
"qpainter": "enable.null.qpainter",
"quartz": "enable.null.quartz",
},
Expand Down
39 changes: 0 additions & 39 deletions enable/gcbench/opengl.py

This file was deleted.

19 changes: 0 additions & 19 deletions enable/gl_graphics_context.py

This file was deleted.

60 changes: 0 additions & 60 deletions enable/qt4/gl.py

This file was deleted.

90 changes: 0 additions & 90 deletions enable/wx/gl.py

This file was deleted.

Loading

0 comments on commit 7292e61

Please sign in to comment.