GrGLAssembleHelpers.cpp 776 B

123456789101112131415161718192021222324
  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. #include "include/gpu/gl/GrGLAssembleHelpers.h"
  8. #include "src/gpu/gl/GrGLUtil.h"
  9. void GrGetEGLQueryAndDisplay(GrEGLQueryStringFn** queryString, GrEGLDisplay* display,
  10. void* ctx, GrGLGetProc get) {
  11. *queryString = (GrEGLQueryStringFn*)get(ctx, "eglQueryString");
  12. *display = GR_EGL_NO_DISPLAY;
  13. if (*queryString) {
  14. GrEGLGetCurrentDisplayFn* getCurrentDisplay =
  15. (GrEGLGetCurrentDisplayFn*)get(ctx, "eglGetCurrentDisplay");
  16. if (getCurrentDisplay) {
  17. *display = getCurrentDisplay();
  18. } else {
  19. *queryString = nullptr;
  20. }
  21. }
  22. }