Kevin Lubick | bbb9281 | 2019-03-18 14:15:24 -0400 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "include/gpu/gl/GrGLAssembleHelpers.h" |
| 9 | #include "src/gpu/gl/GrGLUtil.h" |
Kevin Lubick | bbb9281 | 2019-03-18 14:15:24 -0400 | [diff] [blame] | 10 | |
| 11 | void 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 | } |