blob: 1c77c1a45b8270be3c63b7273eed833911de3283 [file] [log] [blame]
sergeyv8bd5edf2016-05-13 15:03:35 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#ifndef HWUI_GLES_WRAP_ENABLED
20#error Wrapping wasn't enabled, can't use this!
21#endif
22
23#include <GLES/gl.h>
24#include <GLES/glext.h>
25#include <GLES2/gl2.h>
26#include <GLES2/gl2ext.h>
27#include <GLES3/gl3.h>
28#include <GLES3/gl31.h>
29#include <GLES3/gl32.h>
30
Derek Sollenberger7e044fe2016-11-07 10:57:59 -050031#include <gl/GrGLInterface.h>
sergeyv8bd5edf2016-05-13 15:03:35 -070032#include <memory>
33
34namespace android {
35namespace uirenderer {
36namespace debug {
37
38// All the gl methods on GlesDriver have a trailing underscore
39// This is to avoid collision with gles_redefine/gles_undefine
40class GlesDriver {
41public:
42 virtual ~GlesDriver() {}
Derek Sollenberger7e044fe2016-11-07 10:57:59 -050043 virtual sk_sp<const GrGLInterface> getSkiaInterface();
sergeyv8bd5edf2016-05-13 15:03:35 -070044
45#define GL_ENTRY(ret, api, ...) virtual ret api##_(__VA_ARGS__) = 0;
John Reck1bcacfd2017-11-03 10:12:19 -070046#include "gles_decls.in"
sergeyv8bd5edf2016-05-13 15:03:35 -070047#undef GL_ENTRY
48
49 static GlesDriver* get();
50 static std::unique_ptr<GlesDriver> replace(std::unique_ptr<GlesDriver>&& driver);
51};
52
John Reck1bcacfd2017-11-03 10:12:19 -070053} // namespace debug
54} // namespace uirenderer
55} // namespace android