skia2/tools/viewer
Brian Osman 79086b94ed Integrate the ImGui library with viewer
Code and docs are at: https://github.com/ocornut/imgui

ImGui is an open source immediate mode GUI library that's
lightweight and fairly simply to integrate. Widget functions
return their state, and the library emits vertex and index
data to render everything. It's got a huge set of built-in
widgets and really robust layout control.

For the initial integration, I had to fix up event handling
in the viewer's app framework (to get mouse wheel and more
keys, etc...).

The new viewer 'Debug' window is toggled with the space bar.
For this change, I've added one feature to that window: the
slide picker. It's got a list of all slides, with filtering
support, and the ability to click to switch slides.

I also included the ImGui 'Demo' window (toggled with 'g').
This is nicely laid out, and includes examples of pretty
much everything the library can do. It also serves as good
documentation - find something that looks like what you want,
and then go look at the corresponding code (all of it is in
imgui_demo.cpp).

I have other CLs with other features (like directly editing
the primaries of the working color space), but I wanted to
land this chunk first, then start adding more features.

Other than adding new debugging features, there are few
more outstanding work items:

1) Raster doesn't render the GUI correctly, due to non-
invertible pos -> UV matrices. Florin is working on that.
2) Touch inputs aren't being routed yet, so the GUI isn't
usable on Android yet. Might also be tough to work with,
given the size.
3) ImGui has clipboard integration (that's why it wants
the C, X, and V keys), but we need to wire it up to the
OS' clipboard functions.
4) Draw commands can carry a void* payload to support
drawing images (using whatever mechanism the engine has).
I'd like to set that up (probably using SkImage*), which
makes it really easy to add visualization of off-screen
images in GMs, etc...

BUG=skia:

Change-Id: Iac2a63e37228d33141cb55b7e4d60bf11b7e9ae1
Reviewed-on: https://skia-review.googlesource.com/7702
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-02-10 19:17:03 +00:00
..
sk_app Integrate the ImGui library with viewer 2017-02-10 19:17:03 +00:00
GMSlide.cpp More refactoring for Viewer 2016-05-05 12:32:03 -07:00
GMSlide.h More refactoring for Viewer 2016-05-05 12:32:03 -07:00
ImageSlide.cpp Simplify viewer's handling of backbuffer surface and color space 2017-02-08 17:34:05 +00:00
ImageSlide.h Simplify viewer's handling of backbuffer surface and color space 2017-02-08 17:34:05 +00:00
SampleSlide.cpp chmod -x *.cpp *.h 2016-10-27 16:41:14 +00:00
SampleSlide.h chmod -x *.cpp *.h 2016-10-27 16:41:14 +00:00
SKPSlide.cpp SkFontData to use smart pointers. 2016-09-16 06:24:20 -07:00
SKPSlide.h Add samples to Viewer. 2016-06-16 09:52:35 -07:00
Slide.h Add samples to Viewer. 2016-06-16 09:52:35 -07:00
Viewer.cpp Integrate the ImGui library with viewer 2017-02-10 19:17:03 +00:00
Viewer.h Integrate the ImGui library with viewer 2017-02-10 19:17:03 +00:00