blob: 5e5163f26a0fa337d50925c866b33e6608af8531 [file] [log] [blame]
Kevin Lubickbbb92812019-03-18 14:15:24 -04001/*
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
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "include/gpu/gl/GrGLAssembleHelpers.h"
9#include "src/gpu/gl/GrGLUtil.h"
Kevin Lubickbbb92812019-03-18 14:15:24 -040010
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}