blob: e94200e91fad0e2056011de06cce930c3326b70b [file] [log] [blame]
Mathias Agopian875d8e12013-06-07 15:35:48 -07001/*
2 * Copyright 2013 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
Peiyong Lincbc184f2018-08-22 13:24:10 -070017#include <renderengine/RenderEngine.h>
Fabien Sanglardc93afd52017-03-13 13:02:42 -070018
Peiyong Lin833074a2018-08-28 11:53:54 -070019#include <vector>
20
Jorim Jaggi5b15ef62018-01-17 18:31:39 +010021#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
22#include <configstore/Utils.h>
Peiyong Lincbc184f2018-08-22 13:24:10 -070023#include <log/log.h>
Lloyd Pique63f9dbf2018-06-21 13:13:07 -070024#include <private/gui/SyncFeatures.h>
Peiyong Lincbc184f2018-08-22 13:24:10 -070025#include <renderengine/Image.h>
26#include <renderengine/Mesh.h>
27#include <renderengine/Surface.h>
28#include <ui/Rect.h>
29#include <ui/Region.h>
Peiyong Lin833074a2018-08-28 11:53:54 -070030#include <utils/KeyedVector.h>
31#include "gl/GLES20RenderEngine.h"
32#include "gl/GLExtensions.h"
33#include "gl/ProgramCache.h"
Jorim Jaggi5b15ef62018-01-17 18:31:39 +010034
35using namespace android::hardware::configstore;
36using namespace android::hardware::configstore::V1_0;
Peiyong Lin833074a2018-08-28 11:53:54 -070037using namespace android::renderengine::gl;
Jorim Jaggi5b15ef62018-01-17 18:31:39 +010038
Jiyong Park00b15b82017-08-10 20:30:56 +090039extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name);
Jesse Hall19e87292013-12-23 21:02:15 -080040
Mathias Agopian875d8e12013-06-07 15:35:48 -070041namespace android {
Peiyong Lin833074a2018-08-28 11:53:54 -070042namespace renderengine {
Mathias Agopian875d8e12013-06-07 15:35:48 -070043
Lloyd Pique144e1162017-12-20 16:44:52 -080044RenderEngine::~RenderEngine() = default;
45
46namespace impl {
47
Chia-I Wud4d9c6f2017-11-09 16:55:31 -080048std::unique_ptr<RenderEngine> RenderEngine::create(int hwcFormat, uint32_t featureFlags) {
49 // initialize EGL for the default display
50 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
Peiyong Lin566a3b42018-01-09 18:22:43 -080051 if (!eglInitialize(display, nullptr, nullptr)) {
Chia-I Wud4d9c6f2017-11-09 16:55:31 -080052 LOG_ALWAYS_FATAL("failed to initialize EGL");
53 }
54
Peiyong Lin566a3b42018-01-09 18:22:43 -080055 GLExtensions& extensions = GLExtensions::getInstance();
Chia-I Wu767d7c92017-11-30 13:22:48 -080056 extensions.initWithEGLStrings(eglQueryStringImplementationANDROID(display, EGL_VERSION),
57 eglQueryStringImplementationANDROID(display, EGL_EXTENSIONS));
58
Jesse Hall19e87292013-12-23 21:02:15 -080059 // The code assumes that ES2 or later is available if this extension is
60 // supported.
61 EGLConfig config = EGL_NO_CONFIG;
Chia-I Wu767d7c92017-11-30 13:22:48 -080062 if (!extensions.hasNoConfigContext()) {
Steven Thomasd7f49c52017-07-26 18:48:28 -070063 config = chooseEglConfig(display, hwcFormat, /*logConfig*/ true);
Jesse Hall19e87292013-12-23 21:02:15 -080064 }
65
66 EGLint renderableType = 0;
67 if (config == EGL_NO_CONFIG) {
68 renderableType = EGL_OPENGL_ES2_BIT;
Chia-I Wub027f802017-11-29 14:00:52 -080069 } else if (!eglGetConfigAttrib(display, config, EGL_RENDERABLE_TYPE, &renderableType)) {
Jesse Hall19e87292013-12-23 21:02:15 -080070 LOG_ALWAYS_FATAL("can't query EGLConfig RENDERABLE_TYPE");
71 }
72 EGLint contextClientVersion = 0;
Mathias Agopian2185f8b2013-09-18 16:20:26 -070073 if (renderableType & EGL_OPENGL_ES2_BIT) {
74 contextClientVersion = 2;
75 } else if (renderableType & EGL_OPENGL_ES_BIT) {
76 contextClientVersion = 1;
77 } else {
78 LOG_ALWAYS_FATAL("no supported EGL_RENDERABLE_TYPEs");
79 }
80
Fabien Sanglardc93afd52017-03-13 13:02:42 -070081 std::vector<EGLint> contextAttributes;
82 contextAttributes.reserve(6);
83 contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION);
84 contextAttributes.push_back(contextClientVersion);
Jorim Jaggi5b15ef62018-01-17 18:31:39 +010085 bool useContextPriority = overrideUseContextPriorityFromConfig(extensions.hasContextPriority());
86 if (useContextPriority) {
Fabien Sanglardc93afd52017-03-13 13:02:42 -070087 contextAttributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG);
88 contextAttributes.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG);
89 }
Fabien Sanglardc93afd52017-03-13 13:02:42 -070090 contextAttributes.push_back(EGL_NONE);
91
Peiyong Lin566a3b42018-01-09 18:22:43 -080092 EGLContext ctxt = eglCreateContext(display, config, nullptr, contextAttributes.data());
Mathias Agopian875d8e12013-06-07 15:35:48 -070093
94 // if can't create a GL context, we can only abort.
Chia-I Wub027f802017-11-29 14:00:52 -080095 LOG_ALWAYS_FATAL_IF(ctxt == EGL_NO_CONTEXT, "EGLContext creation failed");
Mathias Agopian875d8e12013-06-07 15:35:48 -070096
97 // now figure out what version of GL did we actually get
98 // NOTE: a dummy surface is not needed if KHR_create_context is supported
99
Jesse Hall19e87292013-12-23 21:02:15 -0800100 EGLConfig dummyConfig = config;
101 if (dummyConfig == EGL_NO_CONFIG) {
Steven Thomasd7f49c52017-07-26 18:48:28 -0700102 dummyConfig = chooseEglConfig(display, hwcFormat, /*logConfig*/ true);
Jesse Hall19e87292013-12-23 21:02:15 -0800103 }
Chia-I Wub027f802017-11-29 14:00:52 -0800104 EGLint attribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE, EGL_NONE};
Jesse Hall19e87292013-12-23 21:02:15 -0800105 EGLSurface dummy = eglCreatePbufferSurface(display, dummyConfig, attribs);
Chia-I Wub027f802017-11-29 14:00:52 -0800106 LOG_ALWAYS_FATAL_IF(dummy == EGL_NO_SURFACE, "can't create dummy pbuffer");
Mathias Agopian875d8e12013-06-07 15:35:48 -0700107 EGLBoolean success = eglMakeCurrent(display, dummy, dummy, ctxt);
108 LOG_ALWAYS_FATAL_IF(!success, "can't make dummy pbuffer current");
109
Chia-I Wub027f802017-11-29 14:00:52 -0800110 extensions.initWithGLStrings(glGetString(GL_VENDOR), glGetString(GL_RENDERER),
111 glGetString(GL_VERSION), glGetString(GL_EXTENSIONS));
Mathias Agopian875d8e12013-06-07 15:35:48 -0700112
Chia-I Wub027f802017-11-29 14:00:52 -0800113 GlesVersion version = parseGlesVersion(extensions.getVersion());
Mathias Agopian875d8e12013-06-07 15:35:48 -0700114
115 // initialize the renderer while GL is current
116
Chia-I Wub2c76242017-11-09 17:17:07 -0800117 std::unique_ptr<RenderEngine> engine;
Mathias Agopian875d8e12013-06-07 15:35:48 -0700118 switch (version) {
Chia-I Wub027f802017-11-29 14:00:52 -0800119 case GLES_VERSION_1_0:
120 case GLES_VERSION_1_1:
121 LOG_ALWAYS_FATAL("SurfaceFlinger requires OpenGL ES 2.0 minimum to run.");
122 break;
123 case GLES_VERSION_2_0:
124 case GLES_VERSION_3_0:
125 engine = std::make_unique<GLES20RenderEngine>(featureFlags);
126 break;
Mathias Agopian875d8e12013-06-07 15:35:48 -0700127 }
Chia-I Wu2b6386e2017-11-09 13:03:17 -0800128 engine->setEGLHandles(display, config, ctxt);
Mathias Agopian875d8e12013-06-07 15:35:48 -0700129
130 ALOGI("OpenGL ES informations:");
131 ALOGI("vendor : %s", extensions.getVendor());
132 ALOGI("renderer : %s", extensions.getRenderer());
133 ALOGI("version : %s", extensions.getVersion());
Chia-I Wu767d7c92017-11-30 13:22:48 -0800134 ALOGI("extensions: %s", extensions.getExtensions());
Michael Lentine9ae79d82014-07-30 16:42:12 -0700135 ALOGI("GL_MAX_TEXTURE_SIZE = %zu", engine->getMaxTextureSize());
136 ALOGI("GL_MAX_VIEWPORT_DIMS = %zu", engine->getMaxViewportDims());
Mathias Agopian875d8e12013-06-07 15:35:48 -0700137
138 eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
139 eglDestroySurface(display, dummy);
140
141 return engine;
142}
143
Jorim Jaggi5b15ef62018-01-17 18:31:39 +0100144bool RenderEngine::overrideUseContextPriorityFromConfig(bool useContextPriority) {
145 OptionalBool ret;
Lloyd Pique144e1162017-12-20 16:44:52 -0800146 ISurfaceFlingerConfigs::getService()->useContextPriority([&ret](OptionalBool b) { ret = b; });
Jorim Jaggi5b15ef62018-01-17 18:31:39 +0100147 if (ret.specified) {
148 return ret.value;
149 } else {
150 return useContextPriority;
151 }
152}
153
Chia-I Wu93e14df2018-06-04 10:10:17 -0700154RenderEngine::RenderEngine(uint32_t featureFlags)
155 : mEGLDisplay(EGL_NO_DISPLAY),
156 mEGLConfig(nullptr),
157 mEGLContext(EGL_NO_CONTEXT),
158 mFeatureFlags(featureFlags) {}
Mathias Agopian875d8e12013-06-07 15:35:48 -0700159
160RenderEngine::~RenderEngine() {
Chia-I Wub01450b2017-11-09 16:55:31 -0800161 eglMakeCurrent(mEGLDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
162 eglTerminate(mEGLDisplay);
Mathias Agopian875d8e12013-06-07 15:35:48 -0700163}
164
Chia-I Wu2b6386e2017-11-09 13:03:17 -0800165void RenderEngine::setEGLHandles(EGLDisplay display, EGLConfig config, EGLContext ctxt) {
166 mEGLDisplay = display;
Jesse Hall05f8c702013-12-23 20:44:38 -0800167 mEGLConfig = config;
Mathias Agopian875d8e12013-06-07 15:35:48 -0700168 mEGLContext = ctxt;
169}
170
Chia-I Wu2b6386e2017-11-09 13:03:17 -0800171EGLDisplay RenderEngine::getEGLDisplay() const {
172 return mEGLDisplay;
173}
174
175EGLConfig RenderEngine::getEGLConfig() const {
Jesse Hall05f8c702013-12-23 20:44:38 -0800176 return mEGLConfig;
177}
178
Lloyd Pique63f9dbf2018-06-21 13:13:07 -0700179bool RenderEngine::useNativeFenceSync() const {
180 return SyncFeatures::getInstance().useNativeFenceSync();
181}
182
183bool RenderEngine::useWaitSync() const {
184 return SyncFeatures::getInstance().useWaitSync();
185}
186
Mathias Agopian875d8e12013-06-07 15:35:48 -0700187RenderEngine::GlesVersion RenderEngine::parseGlesVersion(const char* str) {
188 int major, minor;
189 if (sscanf(str, "OpenGL ES-CM %d.%d", &major, &minor) != 2) {
190 if (sscanf(str, "OpenGL ES %d.%d", &major, &minor) != 2) {
191 ALOGW("Unable to parse GL_VERSION string: \"%s\"", str);
192 return GLES_VERSION_1_0;
193 }
194 }
195
196 if (major == 1 && minor == 0) return GLES_VERSION_1_0;
197 if (major == 1 && minor >= 1) return GLES_VERSION_1_1;
198 if (major == 2 && minor >= 0) return GLES_VERSION_2_0;
199 if (major == 3 && minor >= 0) return GLES_VERSION_3_0;
200
201 ALOGW("Unrecognized OpenGL ES version: %d.%d", major, minor);
202 return GLES_VERSION_1_0;
203}
204
Mathias Agopian458197d2013-08-15 14:56:51 -0700205void RenderEngine::dump(String8& result) {
Peiyong Lin566a3b42018-01-09 18:22:43 -0800206 const GLExtensions& extensions = GLExtensions::getInstance();
Chia-I Wu767d7c92017-11-30 13:22:48 -0800207
208 result.appendFormat("EGL implementation : %s\n", extensions.getEGLVersion());
209 result.appendFormat("%s\n", extensions.getEGLExtensions());
210
Chia-I Wub027f802017-11-29 14:00:52 -0800211 result.appendFormat("GLES: %s, %s, %s\n", extensions.getVendor(), extensions.getRenderer(),
212 extensions.getVersion());
Chia-I Wu767d7c92017-11-30 13:22:48 -0800213 result.appendFormat("%s\n", extensions.getExtensions());
Mathias Agopian458197d2013-08-15 14:56:51 -0700214}
215
Chia-I Wub027f802017-11-29 14:00:52 -0800216static status_t selectConfigForAttribute(EGLDisplay dpy, EGLint const* attrs, EGLint attribute,
217 EGLint wanted, EGLConfig* outConfig) {
Jesse Hall05f8c702013-12-23 20:44:38 -0800218 EGLint numConfigs = -1, n = 0;
Peiyong Lin566a3b42018-01-09 18:22:43 -0800219 eglGetConfigs(dpy, nullptr, 0, &numConfigs);
Jesse Hall05f8c702013-12-23 20:44:38 -0800220 EGLConfig* const configs = new EGLConfig[numConfigs];
221 eglChooseConfig(dpy, attrs, configs, numConfigs, &n);
222
223 if (n) {
224 if (attribute != EGL_NONE) {
Chia-I Wub027f802017-11-29 14:00:52 -0800225 for (int i = 0; i < n; i++) {
Jesse Hall05f8c702013-12-23 20:44:38 -0800226 EGLint value = 0;
227 eglGetConfigAttrib(dpy, configs[i], attribute, &value);
228 if (wanted == value) {
229 *outConfig = configs[i];
Chia-I Wub027f802017-11-29 14:00:52 -0800230 delete[] configs;
Jesse Hall05f8c702013-12-23 20:44:38 -0800231 return NO_ERROR;
232 }
233 }
234 } else {
235 // just pick the first one
236 *outConfig = configs[0];
Chia-I Wub027f802017-11-29 14:00:52 -0800237 delete[] configs;
Jesse Hall05f8c702013-12-23 20:44:38 -0800238 return NO_ERROR;
239 }
240 }
Chia-I Wub027f802017-11-29 14:00:52 -0800241 delete[] configs;
Jesse Hall05f8c702013-12-23 20:44:38 -0800242 return NAME_NOT_FOUND;
243}
244
245class EGLAttributeVector {
246 struct Attribute;
247 class Adder;
248 friend class Adder;
249 KeyedVector<Attribute, EGLint> mList;
250 struct Attribute {
Chia-I Wub027f802017-11-29 14:00:52 -0800251 Attribute() : v(0){};
252 explicit Attribute(EGLint v) : v(v) {}
Jesse Hall05f8c702013-12-23 20:44:38 -0800253 EGLint v;
Chia-I Wub027f802017-11-29 14:00:52 -0800254 bool operator<(const Attribute& other) const {
Jesse Hall05f8c702013-12-23 20:44:38 -0800255 // this places EGL_NONE at the end
256 EGLint lhs(v);
257 EGLint rhs(other.v);
258 if (lhs == EGL_NONE) lhs = 0x7FFFFFFF;
259 if (rhs == EGL_NONE) rhs = 0x7FFFFFFF;
260 return lhs < rhs;
261 }
262 };
263 class Adder {
264 friend class EGLAttributeVector;
265 EGLAttributeVector& v;
266 EGLint attribute;
Chia-I Wub027f802017-11-29 14:00:52 -0800267 Adder(EGLAttributeVector& v, EGLint attribute) : v(v), attribute(attribute) {}
268
Jesse Hall05f8c702013-12-23 20:44:38 -0800269 public:
Chia-I Wub027f802017-11-29 14:00:52 -0800270 void operator=(EGLint value) {
Jesse Hall05f8c702013-12-23 20:44:38 -0800271 if (attribute != EGL_NONE) {
Chih-Hung Hsiehc4067912016-05-03 14:03:27 -0700272 v.mList.add(Attribute(attribute), value);
Jesse Hall05f8c702013-12-23 20:44:38 -0800273 }
274 }
Chia-I Wub027f802017-11-29 14:00:52 -0800275 operator EGLint() const { return v.mList[attribute]; }
Jesse Hall05f8c702013-12-23 20:44:38 -0800276 };
Chia-I Wub027f802017-11-29 14:00:52 -0800277
Jesse Hall05f8c702013-12-23 20:44:38 -0800278public:
Chia-I Wub027f802017-11-29 14:00:52 -0800279 EGLAttributeVector() { mList.add(Attribute(EGL_NONE), EGL_NONE); }
Jesse Hall05f8c702013-12-23 20:44:38 -0800280 void remove(EGLint attribute) {
281 if (attribute != EGL_NONE) {
Chih-Hung Hsiehc4067912016-05-03 14:03:27 -0700282 mList.removeItem(Attribute(attribute));
Jesse Hall05f8c702013-12-23 20:44:38 -0800283 }
284 }
Chia-I Wub027f802017-11-29 14:00:52 -0800285 Adder operator[](EGLint attribute) { return Adder(*this, attribute); }
286 EGLint operator[](EGLint attribute) const { return mList[attribute]; }
Jesse Hall05f8c702013-12-23 20:44:38 -0800287 // cast-operator to (EGLint const*)
Chia-I Wub027f802017-11-29 14:00:52 -0800288 operator EGLint const*() const { return &mList.keyAt(0).v; }
Jesse Hall05f8c702013-12-23 20:44:38 -0800289};
290
Chia-I Wub027f802017-11-29 14:00:52 -0800291static status_t selectEGLConfig(EGLDisplay display, EGLint format, EGLint renderableType,
292 EGLConfig* config) {
Jesse Hall05f8c702013-12-23 20:44:38 -0800293 // select our EGLConfig. It must support EGL_RECORDABLE_ANDROID if
294 // it is to be used with WIFI displays
295 status_t err;
296 EGLint wantedAttribute;
297 EGLint wantedAttributeValue;
298
299 EGLAttributeVector attribs;
300 if (renderableType) {
Chia-I Wub027f802017-11-29 14:00:52 -0800301 attribs[EGL_RENDERABLE_TYPE] = renderableType;
302 attribs[EGL_RECORDABLE_ANDROID] = EGL_TRUE;
303 attribs[EGL_SURFACE_TYPE] = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
Jesse Hall05f8c702013-12-23 20:44:38 -0800304 attribs[EGL_FRAMEBUFFER_TARGET_ANDROID] = EGL_TRUE;
Chia-I Wub027f802017-11-29 14:00:52 -0800305 attribs[EGL_RED_SIZE] = 8;
306 attribs[EGL_GREEN_SIZE] = 8;
307 attribs[EGL_BLUE_SIZE] = 8;
308 attribs[EGL_ALPHA_SIZE] = 8;
309 wantedAttribute = EGL_NONE;
310 wantedAttributeValue = EGL_NONE;
Jesse Hall05f8c702013-12-23 20:44:38 -0800311 } else {
312 // if no renderable type specified, fallback to a simplified query
Chia-I Wub027f802017-11-29 14:00:52 -0800313 wantedAttribute = EGL_NATIVE_VISUAL_ID;
314 wantedAttributeValue = format;
Jesse Hall05f8c702013-12-23 20:44:38 -0800315 }
316
Chia-I Wub027f802017-11-29 14:00:52 -0800317 err = selectConfigForAttribute(display, attribs, wantedAttribute, wantedAttributeValue, config);
Jesse Hall05f8c702013-12-23 20:44:38 -0800318 if (err == NO_ERROR) {
319 EGLint caveat;
320 if (eglGetConfigAttrib(display, *config, EGL_CONFIG_CAVEAT, &caveat))
321 ALOGW_IF(caveat == EGL_SLOW_CONFIG, "EGL_SLOW_CONFIG selected!");
322 }
323
324 return err;
325}
326
Chia-I Wub027f802017-11-29 14:00:52 -0800327EGLConfig RenderEngine::chooseEglConfig(EGLDisplay display, int format, bool logConfig) {
Jesse Hall05f8c702013-12-23 20:44:38 -0800328 status_t err;
329 EGLConfig config;
330
331 // First try to get an ES2 config
332 err = selectEGLConfig(display, format, EGL_OPENGL_ES2_BIT, &config);
333 if (err != NO_ERROR) {
334 // If ES2 fails, try ES1
335 err = selectEGLConfig(display, format, EGL_OPENGL_ES_BIT, &config);
336 if (err != NO_ERROR) {
337 // still didn't work, probably because we're on the emulator...
338 // try a simplified query
339 ALOGW("no suitable EGLConfig found, trying a simpler query");
340 err = selectEGLConfig(display, format, 0, &config);
341 if (err != NO_ERROR) {
342 // this EGL is too lame for android
343 LOG_ALWAYS_FATAL("no suitable EGLConfig found, giving up");
344 }
345 }
346 }
347
Steven Thomasd7f49c52017-07-26 18:48:28 -0700348 if (logConfig) {
349 // print some debugging info
Chia-I Wub027f802017-11-29 14:00:52 -0800350 EGLint r, g, b, a;
351 eglGetConfigAttrib(display, config, EGL_RED_SIZE, &r);
Steven Thomasd7f49c52017-07-26 18:48:28 -0700352 eglGetConfigAttrib(display, config, EGL_GREEN_SIZE, &g);
Chia-I Wub027f802017-11-29 14:00:52 -0800353 eglGetConfigAttrib(display, config, EGL_BLUE_SIZE, &b);
Steven Thomasd7f49c52017-07-26 18:48:28 -0700354 eglGetConfigAttrib(display, config, EGL_ALPHA_SIZE, &a);
355 ALOGI("EGL information:");
356 ALOGI("vendor : %s", eglQueryString(display, EGL_VENDOR));
357 ALOGI("version : %s", eglQueryString(display, EGL_VERSION));
358 ALOGI("extensions: %s", eglQueryString(display, EGL_EXTENSIONS));
Chia-I Wub027f802017-11-29 14:00:52 -0800359 ALOGI("Client API: %s", eglQueryString(display, EGL_CLIENT_APIS) ?: "Not Supported");
Steven Thomasd7f49c52017-07-26 18:48:28 -0700360 ALOGI("EGLSurface: %d-%d-%d-%d, config=%p", r, g, b, a, config);
361 }
Jesse Hall05f8c702013-12-23 20:44:38 -0800362
363 return config;
364}
365
Peiyong Lin833074a2018-08-28 11:53:54 -0700366} // namespace impl
367} // namespace renderengine
368} // namespace android