/* ** ** Copyright 2006, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ #define LOG_TAG "fillrate" #include #include #include #include #include #include #include using namespace android; int main(int argc, char** argv) { EGLint configAttribs[] = { EGL_DEPTH_SIZE, 0, EGL_NONE }; EGLint numConfigs = -1, n=0; EGLint majorVersion; EGLint minorVersion; EGLConfig config; EGLContext context; EGLSurface surface; EGLint w, h; EGLDisplay dpy; dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, &majorVersion, &minorVersion); // Get all the "potential match" configs... eglGetConfigs(dpy, NULL, 0, &numConfigs); EGLConfig* const configs = (EGLConfig*)malloc(sizeof(EGLConfig)*numConfigs); eglChooseConfig(dpy, configAttribs, configs, numConfigs, &n); config = configs[0]; if (n > 1) { // if there is more than one candidate, go through the list // and pick one that matches our framebuffer format int fbSzA = 0; // should not hardcode int fbSzR = 5; // should not hardcode int fbSzG = 6; // should not hardcode int fbSzB = 5; // should not hardcode int i; for (i=0 ; i=1 ; c--) { int j=0; for (int c=1 ; c<32 ; c++) { glClear(GL_COLOR_BUFFER_BIT); nsecs_t now = systemTime(); for (int i=0 ; i