Update ImGui to v1.62 (June 22, 2018)

He's been steadily adding features and fixing bugs, figured it was time
to fetch a new version.

Change-Id: I496aefc0a1b60c3be5c89a0e58dc64811fccc77e
Reviewed-on: https://skia-review.googlesource.com/138591
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2018-06-29 14:30:48 -04:00 committed by Skia Commit-Bot
parent 0c3ceb2a14
commit 7197e05eae
4 changed files with 11 additions and 4 deletions

2
DEPS
View File

@ -15,7 +15,7 @@ deps = {
"third_party/externals/googletest" : "https://android.googlesource.com/platform/external/googletest@dd43b9998e9a44a579a7aba6c1309407d1a5ed95",
"third_party/externals/harfbuzz" : "https://skia.googlesource.com/third_party/harfbuzz.git@1.4.2",
"third_party/externals/icu" : "https://chromium.googlesource.com/chromium/deps/icu.git@ec9c1133693148470ffe2e5e53576998e3650c1d",
"third_party/externals/imgui" : "https://skia.googlesource.com/external/github.com/ocornut/imgui.git@6384eee34f08cb7eab8d835043e1738e4adcdf75",
"third_party/externals/imgui" : "https://skia.googlesource.com/external/github.com/ocornut/imgui.git@00418d13e369bf53cc4b8f817eb10b8ce65f0904",
# TODO: remove jsoncpp after migrating clients to SkJSON
"third_party/externals/jsoncpp" : "https://chromium.googlesource.com/external/github.com/open-source-parsers/jsoncpp.git@1.0.0",
"third_party/externals/libjpeg-turbo" : "https://skia.googlesource.com/external/github.com/libjpeg-turbo/libjpeg-turbo.git@26f109290dc4ffc9c522d9f5d5a7d5d1ee2c0e0a",

View File

@ -22,6 +22,7 @@ using namespace sk_app;
ImGuiLayer::ImGuiLayer() {
// ImGui initialization:
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
// Keymap...
@ -59,6 +60,10 @@ ImGuiLayer::ImGuiLayer() {
io.Fonts->TexID = &fFontPaint;
}
ImGuiLayer::~ImGuiLayer() {
ImGui::DestroyContext();
}
void ImGuiLayer::onAttach(Window* window) {
fWindow = window;
}

View File

@ -16,6 +16,7 @@
class ImGuiLayer : public sk_app::Window::Layer {
public:
ImGuiLayer();
~ImGuiLayer() override;
typedef std::function<void(SkCanvas*)> SkiaWidgetFunc;
void skiaWidget(const ImVec2& size, SkiaWidgetFunc func);

View File

@ -1418,13 +1418,13 @@ static bool ImGui_DragQuad(SkPoint* pts) {
void Viewer::drawImGui() {
// Support drawing the ImGui demo window. Superfluous, but gives a good idea of what's possible
if (fShowImGuiTestWindow) {
ImGui::ShowTestWindow(&fShowImGuiTestWindow);
ImGui::ShowDemoWindow(&fShowImGuiTestWindow);
}
if (fShowImGuiDebugWindow) {
// We have some dynamic content that sizes to fill available size. If the scroll bar isn't
// always visible, we can end up in a layout feedback loop.
ImGui::SetNextWindowSize(ImVec2(400, 400), ImGuiSetCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(400, 400), ImGuiCond_FirstUseEver);
DisplayParams params = fWindow->getRequestedDisplayParams();
bool paramsChanged = false;
if (ImGui::Begin("Tools", &fShowImGuiDebugWindow,
@ -1827,7 +1827,8 @@ void Viewer::drawImGui() {
}
if (fShowZoomWindow && fLastImage) {
if (ImGui::Begin("Zoom", &fShowZoomWindow, ImVec2(200, 200))) {
ImGui::SetNextWindowSize(ImVec2(200, 200), ImGuiCond_FirstUseEver);
if (ImGui::Begin("Zoom", &fShowZoomWindow)) {
static int zoomFactor = 8;
if (ImGui::Button("<<")) {
zoomFactor = SkTMax(zoomFactor / 2, 4);