1/*
2 * Copyright 2019 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "include/gpu/gl/GrGLAssembleHelpers.h"
9#include "src/gpu/gl/GrGLUtil.h"
10
11void GrGetEGLQueryAndDisplay(GrEGLQueryStringFn** queryString, GrEGLDisplay* display,
12                             void* ctx, GrGLGetProc get) {
13    *queryString = (GrEGLQueryStringFn*)get(ctx, "eglQueryString");
14    *display = GR_EGL_NO_DISPLAY;
15    if (*queryString) {
16        GrEGLGetCurrentDisplayFn* getCurrentDisplay =
17                (GrEGLGetCurrentDisplayFn*)get(ctx, "eglGetCurrentDisplay");
18        if (getCurrentDisplay) {
19            *display = getCurrentDisplay();
20        } else {
21            *queryString = nullptr;
22        }
23    }
24}
25