summaryrefslogtreecommitdiffstats
path: root/gfx/skia/skia/src/gpu/gl/GrGLAssembleHelpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/skia/skia/src/gpu/gl/GrGLAssembleHelpers.cpp')
-rw-r--r--gfx/skia/skia/src/gpu/gl/GrGLAssembleHelpers.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/gfx/skia/skia/src/gpu/gl/GrGLAssembleHelpers.cpp b/gfx/skia/skia/src/gpu/gl/GrGLAssembleHelpers.cpp
new file mode 100644
index 0000000000..5e5163f26a
--- /dev/null
+++ b/gfx/skia/skia/src/gpu/gl/GrGLAssembleHelpers.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2019 Google LLC
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "include/gpu/gl/GrGLAssembleHelpers.h"
+#include "src/gpu/gl/GrGLUtil.h"
+
+void GrGetEGLQueryAndDisplay(GrEGLQueryStringFn** queryString, GrEGLDisplay* display,
+ void* ctx, GrGLGetProc get) {
+ *queryString = (GrEGLQueryStringFn*)get(ctx, "eglQueryString");
+ *display = GR_EGL_NO_DISPLAY;
+ if (*queryString) {
+ GrEGLGetCurrentDisplayFn* getCurrentDisplay =
+ (GrEGLGetCurrentDisplayFn*)get(ctx, "eglGetCurrentDisplay");
+ if (getCurrentDisplay) {
+ *display = getCurrentDisplay();
+ } else {
+ *queryString = nullptr;
+ }
+ }
+}