gltrace_eglapi.cpp revision 0469dd6d55fa331bfd7de9431da98b6340d82271
1/* 2 * Copyright 2011, 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#include <stdlib.h> 18#include <cutils/log.h> 19#include <cutils/properties.h> 20 21#include "hooks.h" 22#include "glestrace.h" 23 24#include "gltrace_context.h" 25#include "gltrace_egl.h" 26#include "gltrace_hooks.h" 27#include "gltrace_transport.h" 28 29namespace android { 30 31void GLTrace_eglMakeCurrent(const unsigned version, gl_hooks_t *hooks) { 32 gltrace::initContext(version, hooks); 33} 34 35void GLTrace_eglReleaseThread() { 36 gltrace::releaseContext(); 37} 38 39void GLTrace_eglCreateContext(int version, EGLContext c) { 40 // TODO 41} 42 43void GLTrace_start() { 44 char value[PROPERTY_VALUE_MAX]; 45 46 property_get("debug.egl.debug_port", value, "5039"); 47 const unsigned short port = (unsigned short)atoi(value); 48 49 gltrace::startServer(port); 50} 51 52void GLTrace_stop() { 53 gltrace::stopServer(); 54} 55 56gl_hooks_t *GLTrace_getGLHooks() { 57 return gltrace::getGLHooks(); 58} 59 60void GLTrace_eglSwapBuffers(void *dpy, void *draw) { 61 gltrace::GLTrace_eglSwapBuffers(dpy, draw); 62} 63 64} 65