diff options
28 files changed, 774 insertions, 705 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp index b63e97f..6880144 100644 --- a/camera/libcameraservice/CameraService.cpp +++ b/camera/libcameraservice/CameraService.cpp @@ -309,7 +309,7 @@ status_t CameraService::Client::connect(const sp<ICameraClient>& client) oldClient = mCameraClient; // did the client actually change? - if (client->asBinder() == mCameraClient->asBinder()) { + if ((mCameraClient != NULL) && (client->asBinder() == mCameraClient->asBinder())) { LOGD("Connect to the same client"); return NO_ERROR; } @@ -878,7 +878,10 @@ void CameraService::Client::handleShutter() mSurface->unregisterBuffers(); } - mCameraClient->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0); + sp<ICameraClient> c = mCameraClient; + if (c != NULL) { + c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0); + } mHardware->disableMsgType(CAMERA_MSG_SHUTTER); // It takes some time before yuvPicture callback to be called. @@ -932,31 +935,38 @@ void CameraService::Client::handlePreviewData(const sp<IMemory>& mem) } } - // Is the callback enabled or not? - if (!(mPreviewCallbackFlag & FRAME_CALLBACK_FLAG_ENABLE_MASK)) { + // local copy of the callback flags + int flags = mPreviewCallbackFlag; + + // is callback enabled? + if (!(flags & FRAME_CALLBACK_FLAG_ENABLE_MASK)) { // If the enable bit is off, the copy-out and one-shot bits are ignored LOGV("frame callback is diabled"); return; } - // Is the received frame copied out or not? - if (mPreviewCallbackFlag & FRAME_CALLBACK_FLAG_COPY_OUT_MASK) { - LOGV("frame is copied out"); - copyFrameAndPostCopiedFrame(heap, offset, size); - } else { - LOGV("frame is directly sent out without copying"); - mCameraClient->dataCallback(CAMERA_MSG_PREVIEW_FRAME, mem); - } + // hold a strong pointer to the client + sp<ICameraClient> c = mCameraClient; - // Is this is one-shot only? - if (mPreviewCallbackFlag & FRAME_CALLBACK_FLAG_ONE_SHOT_MASK) { - LOGV("One-shot only, thus clear the bits and disable frame callback"); + // clear callback flags if no client or one-shot mode + if ((c == NULL) || (mPreviewCallbackFlag & FRAME_CALLBACK_FLAG_ONE_SHOT_MASK)) { + LOGV("Disable preview callback"); mPreviewCallbackFlag &= ~(FRAME_CALLBACK_FLAG_ONE_SHOT_MASK | FRAME_CALLBACK_FLAG_COPY_OUT_MASK | FRAME_CALLBACK_FLAG_ENABLE_MASK); + // TODO: Shouldn't we use this API for non-overlay hardware as well? if (mUseOverlay) mHardware->disableMsgType(CAMERA_MSG_PREVIEW_FRAME); } + + // Is the received frame copied out or not? + if (flags & FRAME_CALLBACK_FLAG_COPY_OUT_MASK) { + LOGV("frame is copied"); + copyFrameAndPostCopiedFrame(c, heap, offset, size); + } else { + LOGV("frame is forwarded"); + c->dataCallback(CAMERA_MSG_PREVIEW_FRAME, mem); + } } // picture callback - postview image ready @@ -972,7 +982,10 @@ void CameraService::Client::handlePostview(const sp<IMemory>& mem) } #endif - mCameraClient->dataCallback(CAMERA_MSG_POSTVIEW_FRAME, mem); + sp<ICameraClient> c = mCameraClient; + if (c != NULL) { + c->dataCallback(CAMERA_MSG_POSTVIEW_FRAME, mem); + } mHardware->disableMsgType(CAMERA_MSG_POSTVIEW_FRAME); } @@ -997,7 +1010,10 @@ void CameraService::Client::handleRawPicture(const sp<IMemory>& mem) mSurface->postBuffer(offset); } - mCameraClient->dataCallback(CAMERA_MSG_RAW_IMAGE, mem); + sp<ICameraClient> c = mCameraClient; + if (c != NULL) { + c->dataCallback(CAMERA_MSG_RAW_IMAGE, mem); + } mHardware->disableMsgType(CAMERA_MSG_RAW_IMAGE); } @@ -1014,7 +1030,10 @@ void CameraService::Client::handleCompressedPicture(const sp<IMemory>& mem) } #endif - mCameraClient->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mem); + sp<ICameraClient> c = mCameraClient; + if (c != NULL) { + c->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mem); + } mHardware->disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE); } @@ -1032,7 +1051,10 @@ void CameraService::Client::notifyCallback(int32_t msgType, int32_t ext1, int32_ client->handleShutter(); break; default: - client->mCameraClient->notifyCallback(msgType, ext1, ext2); + sp<ICameraClient> c = client->mCameraClient; + if (c != NULL) { + c->notifyCallback(msgType, ext1, ext2); + } break; } @@ -1053,10 +1075,13 @@ void CameraService::Client::dataCallback(int32_t msgType, const sp<IMemory>& dat return; } + sp<ICameraClient> c = client->mCameraClient; if (dataPtr == NULL) { LOGE("Null data returned in data callback"); - client->mCameraClient->notifyCallback(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0); - client->mCameraClient->dataCallback(msgType, NULL); + if (c != NULL) { + c->notifyCallback(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0); + c->dataCallback(msgType, NULL); + } return; } @@ -1074,7 +1099,9 @@ void CameraService::Client::dataCallback(int32_t msgType, const sp<IMemory>& dat client->handleCompressedPicture(dataPtr); break; default: - client->mCameraClient->dataCallback(msgType, dataPtr); + if (c != NULL) { + c->dataCallback(msgType, dataPtr); + } break; } @@ -1095,15 +1122,20 @@ void CameraService::Client::dataCallbackTimestamp(nsecs_t timestamp, int32_t msg if (client == 0) { return; } + sp<ICameraClient> c = client->mCameraClient; if (dataPtr == NULL) { LOGE("Null data returned in data with timestamp callback"); - client->mCameraClient->notifyCallback(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0); - client->mCameraClient->dataCallbackTimestamp(0, msgType, NULL); + if (c != NULL) { + c->notifyCallback(CAMERA_MSG_ERROR, UNKNOWN_ERROR, 0); + c->dataCallbackTimestamp(0, msgType, NULL); + } return; } - client->mCameraClient->dataCallbackTimestamp(timestamp, msgType, dataPtr); + if (c != NULL) { + c->dataCallbackTimestamp(timestamp, msgType, dataPtr); + } #if DEBUG_CLIENT_REFERENCES if (client->getStrongCount() == 1) { @@ -1161,7 +1193,8 @@ status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t a return mHardware->sendCommand(cmd, arg1, arg2); } -void CameraService::Client::copyFrameAndPostCopiedFrame(sp<IMemoryHeap> heap, size_t offset, size_t size) +void CameraService::Client::copyFrameAndPostCopiedFrame(const sp<ICameraClient>& client, + const sp<IMemoryHeap>& heap, size_t offset, size_t size) { LOGV("copyFrameAndPostCopiedFrame"); // It is necessary to copy out of pmem before sending this to @@ -1186,7 +1219,7 @@ void CameraService::Client::copyFrameAndPostCopiedFrame(sp<IMemoryHeap> heap, si LOGE("failed to allocate space for frame callback"); return; } - mCameraClient->dataCallback(CAMERA_MSG_PREVIEW_FRAME, frame); + client->dataCallback(CAMERA_MSG_PREVIEW_FRAME, frame); } status_t CameraService::dump(int fd, const Vector<String16>& args) diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h index 2e3597f..2fcf839 100644 --- a/camera/libcameraservice/CameraService.h +++ b/camera/libcameraservice/CameraService.h @@ -23,10 +23,9 @@ #include <ui/CameraHardwareInterface.h> #include <ui/Camera.h> -class android::MemoryHeapBase; - namespace android { +class MemoryHeapBase; class MediaPlayer; // ---------------------------------------------------------------------------- @@ -151,7 +150,8 @@ private: void handleRawPicture(const sp<IMemory>&); void handleCompressedPicture(const sp<IMemory>&); - void copyFrameAndPostCopiedFrame(sp<IMemoryHeap> heap, size_t offset, size_t size); + void copyFrameAndPostCopiedFrame(const sp<ICameraClient>& client, + const sp<IMemoryHeap>& heap, size_t offset, size_t size); // camera operation mode enum camera_mode { diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl index 189335e..5ac543d 100644 --- a/core/java/android/os/IPowerManager.aidl +++ b/core/java/android/os/IPowerManager.aidl @@ -34,7 +34,4 @@ interface IPowerManager // sets the brightness of the backlights (screen, keyboard, button) 0-255 void setBacklightBrightness(int brightness); - - // enables or disables automatic brightness mode - void setAutoBrightness(boolean on); } diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 8c9581d..cb3dc16 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -1081,6 +1081,18 @@ public final class Settings { public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; /** + * SCREEN_BRIGHTNESS_MODE value for manual mode. + * @hide + */ + public static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0; + + /** + * SCREEN_BRIGHTNESS_MODE value for manual mode. + * @hide + */ + public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1; + + /** * Control whether the process CPU usage meter should be shown. */ public static final String SHOW_PROCESSES = "show_processes"; diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 4bc1a0e..eb09c66 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -2926,12 +2926,12 @@ public class WebView extends AbsoluteLayout animateScroll); if (mNativeClass == 0) return; - if (mShiftIsPressed) { + if (mShiftIsPressed && !animateZoom) { if (mTouchSelection) { nativeDrawSelectionRegion(canvas); } else { - nativeDrawSelection(canvas, mSelectX, mSelectY, - mExtendSelection); + nativeDrawSelection(canvas, mInvActualScale, getTitleHeight(), + mSelectX, mSelectY, mExtendSelection); } } else if (drawCursorRing) { if (mTouchMode == TOUCH_SHORTPRESS_START_MODE) { @@ -4065,6 +4065,9 @@ public class WebView extends AbsoluteLayout return true; } if (ev.getAction() == MotionEvent.ACTION_DOWN) { + if (mShiftIsPressed) { + return true; // discard press if copy in progress + } mTrackballDown = true; if (mNativeClass == 0) { return false; @@ -4093,6 +4096,7 @@ public class WebView extends AbsoluteLayout } else { mExtendSelection = true; } + return true; // discard press if copy in progress } if (DebugFlags.WEB_VIEW) { Log.v(LOGTAG, "onTrackballEvent up ev=" + ev @@ -5600,8 +5604,8 @@ public class WebView extends AbsoluteLayout private native void nativeDestroy(); private native void nativeDrawCursorRing(Canvas content); private native void nativeDrawMatches(Canvas canvas); - private native void nativeDrawSelection(Canvas content - , int x, int y, boolean extendSelection); + private native void nativeDrawSelection(Canvas content, float scale, + int offset, int x, int y, boolean extendSelection); private native void nativeDrawSelectionRegion(Canvas content); private native void nativeDumpDisplayTree(String urlOrNull); private native int nativeFindAll(String findLower, String findUpper); diff --git a/docs/html/guide/topics/ui/dialogs.jd b/docs/html/guide/topics/ui/dialogs.jd index c0c0b1b..4e4ca14 100644 --- a/docs/html/guide/topics/ui/dialogs.jd +++ b/docs/html/guide/topics/ui/dialogs.jd @@ -624,7 +624,7 @@ AlertDialog.Builder builder; AlertDialog alertDialog; Context mContext = getApplicationContext(); -LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER); +LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.custom_dialog, (ViewGroup) findViewById(R.id.layout_root)); diff --git a/graphics/java/android/renderscript/SimpleMesh.java b/graphics/java/android/renderscript/SimpleMesh.java index 0ad093e..3d10e3b 100644 --- a/graphics/java/android/renderscript/SimpleMesh.java +++ b/graphics/java/android/renderscript/SimpleMesh.java @@ -228,17 +228,17 @@ public class SimpleMesh extends BaseObj { mVtxData[mVtxCount++] = mB; mVtxData[mVtxCount++] = mA; } + if ((mFlags & TEXTURE_0) != 0) { + makeSpace(2); + mVtxData[mVtxCount++] = mS0; + mVtxData[mVtxCount++] = mT0; + } if ((mFlags & NORMAL) != 0) { makeSpace(3); mVtxData[mVtxCount++] = mNX; mVtxData[mVtxCount++] = mNY; mVtxData[mVtxCount++] = mNZ; } - if ((mFlags & TEXTURE_0) != 0) { - makeSpace(2); - mVtxData[mVtxCount++] = mS0; - mVtxData[mVtxCount++] = mT0; - } } public void addVertex(float x, float y) { diff --git a/include/private/ui/RegionHelper.h b/include/private/ui/RegionHelper.h index 926fddb..8d76533 100644 --- a/include/private/ui/RegionHelper.h +++ b/include/private/ui/RegionHelper.h @@ -86,7 +86,7 @@ public: rasterizer(current); } } - } while(!spannerInner.isDone()); + } while(!spannerInner.isDone()); } while(!spanner.isDone()); } @@ -220,18 +220,21 @@ private: } inline void prepare(int inside) { - SpannerBase::lhs_head = lhs.rects->left + lhs.dx; - SpannerBase::lhs_tail = lhs.rects->right + lhs.dx; - SpannerBase::rhs_head = rhs.rects->left + rhs.dx; - SpannerBase::rhs_tail = rhs.rects->right + rhs.dx; if (inside == SpannerBase::lhs_before_rhs) { + SpannerBase::lhs_head = lhs.rects->left + lhs.dx; + SpannerBase::lhs_tail = lhs.rects->right + lhs.dx; SpannerBase::rhs_head = max_value; SpannerBase::rhs_tail = max_value; } else if (inside == SpannerBase::lhs_after_rhs) { SpannerBase::lhs_head = max_value; SpannerBase::lhs_tail = max_value; + SpannerBase::rhs_head = rhs.rects->left + rhs.dx; + SpannerBase::rhs_tail = rhs.rects->right + rhs.dx; } else { - // use both spans + SpannerBase::lhs_head = lhs.rects->left + lhs.dx; + SpannerBase::lhs_tail = lhs.rects->right + lhs.dx; + SpannerBase::rhs_head = rhs.rects->left + rhs.dx; + SpannerBase::rhs_tail = rhs.rects->right + rhs.dx; } } diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 2b3d076..cc39dac 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -438,6 +438,7 @@ void Context::setVertex(ProgramVertex *pv) } else { mVertex.set(pv); } + mVertex->forceDirty(); } void Context::assignName(ObjectBase *obj, const char *name, uint32_t len) diff --git a/libs/rs/rsProgram.h b/libs/rs/rsProgram.h index 26b78dd..57c654f 100644 --- a/libs/rs/rsProgram.h +++ b/libs/rs/rsProgram.h @@ -44,6 +44,10 @@ protected: ObjectBaseRef<Allocation> mConstants; mutable bool mDirty; + + +public: + void forceDirty() {mDirty = true;} }; diff --git a/libs/ui/tests/region.cpp b/libs/ui/tests/region.cpp index 0deb2ba..ef15de9 100644 --- a/libs/ui/tests/region.cpp +++ b/libs/ui/tests/region.cpp @@ -25,9 +25,16 @@ using namespace android; int main() { + Region empty; Region reg0( Rect( 0, 0, 100, 100 ) ); Region reg1 = reg0; Region reg2, reg3; + + Region reg4 = empty | reg1; + Region reg5 = reg1 | empty; + + reg4.dump("reg4"); + reg5.dump("reg5"); reg0.dump("reg0"); reg1.dump("reg1"); diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index 7e7da1b..5d6ac26 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp @@ -128,7 +128,7 @@ const char* Loader::getTag(int dpy, int impl) return 0; } -void* Loader::open(EGLNativeDisplayType display, int impl, gl_hooks_t* hooks) +void* Loader::open(EGLNativeDisplayType display, int impl, egl_connection_t* cnx) { /* * TODO: if we don't find display/0, then use 0/0 @@ -144,22 +144,22 @@ void* Loader::open(EGLNativeDisplayType display, int impl, gl_hooks_t* hooks) char const* tag = getTag(index, impl); if (tag) { snprintf(path, PATH_MAX, format, "GLES", tag); - dso = load_driver(path, hooks, EGL | GLESv1_CM | GLESv2); + dso = load_driver(path, cnx, EGL | GLESv1_CM | GLESv2); if (dso) { hnd = new driver_t(dso); } else { // Always load EGL first snprintf(path, PATH_MAX, format, "EGL", tag); - dso = load_driver(path, hooks, EGL); + dso = load_driver(path, cnx, EGL); if (dso) { hnd = new driver_t(dso); // TODO: make this more automated snprintf(path, PATH_MAX, format, "GLESv1_CM", tag); - hnd->set( load_driver(path, hooks, GLESv1_CM), GLESv1_CM ); + hnd->set( load_driver(path, cnx, GLESv1_CM), GLESv1_CM ); snprintf(path, PATH_MAX, format, "GLESv2", tag); - hnd->set( load_driver(path, hooks, GLESv2), GLESv2 ); + hnd->set( load_driver(path, cnx, GLESv2), GLESv2 ); } } } @@ -223,7 +223,7 @@ void Loader::init_api(void* dso, } void *Loader::load_driver(const char* driver_absolute_path, - gl_hooks_t* hooks, uint32_t mask) + egl_connection_t* cnx, uint32_t mask) { if (access(driver_absolute_path, R_OK)) { // this happens often, we don't want to log an error @@ -245,7 +245,7 @@ void *Loader::load_driver(const char* driver_absolute_path, LOGE_IF(!getProcAddress, "can't find eglGetProcAddress() in %s", driver_absolute_path); - gl_hooks_t::egl_t* egl = &hooks->egl; + egl_t* egl = &cnx->egl; __eglMustCastToProperFunctionPointerType* curr = (__eglMustCastToProperFunctionPointerType*)egl; char const * const * api = egl_names; @@ -266,14 +266,16 @@ void *Loader::load_driver(const char* driver_absolute_path, } if (mask & GLESv1_CM) { - init_api(dso, gl_names, - (__eglMustCastToProperFunctionPointerType*)&hooks->gl, - getProcAddress); + init_api(dso, gl_names, + (__eglMustCastToProperFunctionPointerType*) + &cnx->hooks[GLESv1_INDEX]->gl, + getProcAddress); } if (mask & GLESv2) { - init_api(dso, gl2_names, - (__eglMustCastToProperFunctionPointerType*)&hooks->gl2, + init_api(dso, gl_names, + (__eglMustCastToProperFunctionPointerType*) + &cnx->hooks[GLESv2_INDEX]->gl, getProcAddress); } diff --git a/opengl/libs/EGL/Loader.h b/opengl/libs/EGL/Loader.h index 69f6dd5..8659b0b 100644 --- a/opengl/libs/EGL/Loader.h +++ b/opengl/libs/EGL/Loader.h @@ -32,7 +32,7 @@ namespace android { // ---------------------------------------------------------------------------- -struct gl_hooks_t; +struct egl_connection_t; class Loader : public Singleton<Loader> { @@ -69,12 +69,12 @@ class Loader : public Singleton<Loader> public: ~Loader(); - void* open(EGLNativeDisplayType display, int impl, gl_hooks_t* hooks); + void* open(EGLNativeDisplayType display, int impl, egl_connection_t* cnx); status_t close(void* driver); private: Loader(); - void *load_driver(const char* driver, gl_hooks_t* hooks, uint32_t mask); + void *load_driver(const char* driver, egl_connection_t* cnx, uint32_t mask); static __attribute__((noinline)) void init_api(void* dso, diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index d1ddcd3..3efb678 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -164,7 +164,7 @@ struct egl_display_t { }; uint32_t magic; - DisplayImpl disp[IMPL_NUM_DRIVERS_IMPLEMENTATIONS]; + DisplayImpl disp[IMPL_NUM_IMPLEMENTATIONS]; EGLint numTotalConfigs; volatile int32_t refs; @@ -195,8 +195,9 @@ struct egl_context_t : public egl_object_t typedef egl_object_t::LocalRef<egl_context_t, EGLContext> Ref; egl_context_t(EGLDisplay dpy, EGLContext context, - int impl, egl_connection_t const* cnx) - : dpy(dpy), context(context), read(0), draw(0), impl(impl), cnx(cnx) + int impl, egl_connection_t const* cnx, int version) + : dpy(dpy), context(context), read(0), draw(0), impl(impl), cnx(cnx), + version(version) { } EGLDisplay dpy; @@ -205,6 +206,7 @@ struct egl_context_t : public egl_object_t EGLSurface draw; int impl; egl_connection_t const* cnx; + int version; }; struct egl_image_t : public egl_object_t @@ -218,7 +220,7 @@ struct egl_image_t : public egl_object_t } EGLDisplay dpy; EGLConfig context; - EGLImageKHR images[IMPL_NUM_DRIVERS_IMPLEMENTATIONS]; + EGLImageKHR images[IMPL_NUM_IMPLEMENTATIONS]; }; typedef egl_surface_t::Ref SurfaceRef; @@ -236,14 +238,15 @@ struct tls_t // ---------------------------------------------------------------------------- -egl_connection_t gEGLImpl[IMPL_NUM_DRIVERS_IMPLEMENTATIONS]; +egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; static egl_display_t gDisplay[NUM_DISPLAYS]; static pthread_mutex_t gThreadLocalStorageKeyMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t gEGLThreadLocalStorageKey = -1; // ---------------------------------------------------------------------------- -EGLAPI gl_hooks_t gHooks[IMPL_NUM_IMPLEMENTATIONS]; +EGLAPI gl_hooks_t gHooks[2][IMPL_NUM_IMPLEMENTATIONS]; +EGLAPI gl_hooks_t gHooksNoContext; EGLAPI pthread_key_t gGLWrapperKey = -1; // ---------------------------------------------------------------------------- @@ -434,10 +437,10 @@ static void early_egl_init(void) #endif uint32_t addr = (uint32_t)((void*)gl_no_context); android_memset32( - (uint32_t*)(void*)&gHooks[IMPL_NO_CONTEXT], + (uint32_t*)(void*)&gHooksNoContext, addr, - sizeof(gHooks[IMPL_NO_CONTEXT])); - setGlThreadSpecific(&gHooks[IMPL_NO_CONTEXT]); + sizeof(gHooksNoContext)); + setGlThreadSpecific(&gHooksNoContext); } static pthread_once_t once_control = PTHREAD_ONCE_INIT; @@ -479,7 +482,7 @@ static egl_connection_t* validate_display_config( if (!dp) return setError(EGL_BAD_DISPLAY, (egl_connection_t*)NULL); impl = uintptr_t(config)>>24; - if (uint32_t(impl) >= IMPL_NUM_DRIVERS_IMPLEMENTATIONS) { + if (uint32_t(impl) >= IMPL_NUM_IMPLEMENTATIONS) { return setError(EGL_BAD_CONFIG, (egl_connection_t*)NULL); } index = uintptr_t(config) & 0xFFFFFF; @@ -559,10 +562,11 @@ EGLBoolean egl_init_drivers_locked() cnx = &gEGLImpl[IMPL_SOFTWARE]; if (cnx->dso == 0) { - cnx->hooks = &gHooks[IMPL_SOFTWARE]; - cnx->dso = loader.open(EGL_DEFAULT_DISPLAY, 0, cnx->hooks); + cnx->hooks[GLESv1_INDEX] = &gHooks[GLESv1_INDEX][IMPL_SOFTWARE]; + cnx->hooks[GLESv2_INDEX] = &gHooks[GLESv2_INDEX][IMPL_SOFTWARE]; + cnx->dso = loader.open(EGL_DEFAULT_DISPLAY, 0, cnx); if (cnx->dso) { - EGLDisplay dpy = cnx->hooks->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY); + EGLDisplay dpy = cnx->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY); LOGE_IF(dpy==EGL_NO_DISPLAY, "No EGLDisplay for software EGL!"); d->disp[IMPL_SOFTWARE].dpy = dpy; if (dpy == EGL_NO_DISPLAY) { @@ -577,10 +581,11 @@ EGLBoolean egl_init_drivers_locked() char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.hw", value, "1"); if (atoi(value) != 0) { - cnx->hooks = &gHooks[IMPL_HARDWARE]; - cnx->dso = loader.open(EGL_DEFAULT_DISPLAY, 1, cnx->hooks); + cnx->hooks[GLESv1_INDEX] = &gHooks[GLESv1_INDEX][IMPL_HARDWARE]; + cnx->hooks[GLESv2_INDEX] = &gHooks[GLESv2_INDEX][IMPL_HARDWARE]; + cnx->dso = loader.open(EGL_DEFAULT_DISPLAY, 1, cnx); if (cnx->dso) { - EGLDisplay dpy = cnx->hooks->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY); + EGLDisplay dpy = cnx->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY); LOGE_IF(dpy==EGL_NO_DISPLAY, "No EGLDisplay for hardware EGL!"); d->disp[IMPL_HARDWARE].dpy = dpy; if (dpy == EGL_NO_DISPLAY) { @@ -645,12 +650,12 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) return EGL_TRUE; } - setGlThreadSpecific(&gHooks[IMPL_NO_CONTEXT]); + setGlThreadSpecific(&gHooksNoContext); // initialize each EGL and // build our own extension string first, based on the extension we know // and the extension supported by our client implementation - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; cnx->major = -1; cnx->minor = -1; @@ -668,13 +673,13 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) */ if (i == IMPL_HARDWARE) { dp->disp[i].dpy = - cnx->hooks->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY); + cnx->egl.eglGetDisplay(EGL_DEFAULT_DISPLAY); } #endif EGLDisplay idpy = dp->disp[i].dpy; - if (cnx->hooks->egl.eglInitialize(idpy, &cnx->major, &cnx->minor)) { + if (cnx->egl.eglInitialize(idpy, &cnx->major, &cnx->minor)) { //LOGD("initialized %d dpy=%p, ver=%d.%d, cnx=%p", // i, idpy, cnx->major, cnx->minor, cnx); @@ -683,29 +688,29 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) // get the query-strings for this display for each implementation dp->disp[i].queryString.vendor = - cnx->hooks->egl.eglQueryString(idpy, EGL_VENDOR); + cnx->egl.eglQueryString(idpy, EGL_VENDOR); dp->disp[i].queryString.version = - cnx->hooks->egl.eglQueryString(idpy, EGL_VERSION); + cnx->egl.eglQueryString(idpy, EGL_VERSION); dp->disp[i].queryString.extensions = - cnx->hooks->egl.eglQueryString(idpy, EGL_EXTENSIONS); + cnx->egl.eglQueryString(idpy, EGL_EXTENSIONS); dp->disp[i].queryString.clientApi = - cnx->hooks->egl.eglQueryString(idpy, EGL_CLIENT_APIS); + cnx->egl.eglQueryString(idpy, EGL_CLIENT_APIS); } else { LOGW("%d: eglInitialize(%p) failed (%s)", i, idpy, - egl_strerror(cnx->hooks->egl.eglGetError())); + egl_strerror(cnx->egl.eglGetError())); } } EGLBoolean res = EGL_FALSE; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso && cnx->major>=0 && cnx->minor>=0) { EGLint n; - if (cnx->hooks->egl.eglGetConfigs(dp->disp[i].dpy, 0, 0, &n)) { + if (cnx->egl.eglGetConfigs(dp->disp[i].dpy, 0, 0, &n)) { dp->disp[i].config = (EGLConfig*)malloc(sizeof(EGLConfig)*n); if (dp->disp[i].config) { - if (cnx->hooks->egl.eglGetConfigs( + if (cnx->egl.eglGetConfigs( dp->disp[i].dpy, dp->disp[i].config, n, &dp->disp[i].numConfigs)) { @@ -742,12 +747,12 @@ EGLBoolean eglTerminate(EGLDisplay dpy) return EGL_TRUE; EGLBoolean res = EGL_FALSE; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso && dp->disp[i].state == egl_display_t::INITIALIZED) { - if (cnx->hooks->egl.eglTerminate(dp->disp[i].dpy) == EGL_FALSE) { + if (cnx->egl.eglTerminate(dp->disp[i].dpy) == EGL_FALSE) { LOGW("%d: eglTerminate(%p) failed (%s)", i, dp->disp[i].dpy, - egl_strerror(cnx->hooks->egl.eglGetError())); + egl_strerror(cnx->egl.eglGetError())); } // REVISIT: it's unclear what to do if eglTerminate() fails free(dp->disp[i].config); @@ -784,7 +789,7 @@ EGLBoolean eglGetConfigs( EGLDisplay dpy, return EGL_TRUE; } GLint n = 0; - for (int j=0 ; j<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; j++) { + for (int j=0 ; j<IMPL_NUM_IMPLEMENTATIONS ; j++) { for (int i=0 ; i<dp->disp[j].numConfigs && config_size ; i++) { *configs++ = MAKE_CONFIG(j, i); config_size--; @@ -841,7 +846,7 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { - cnx->hooks->egl.eglGetConfigAttrib( + cnx->egl.eglGetConfigAttrib( dp->disp[i].dpy, dp->disp[i].config[index], EGL_CONFIG_ID, &configId); @@ -851,12 +856,12 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, // At this point, the only configuration that can match is // dp->configs[i][index], however, we don't know if it would be // rejected because of the other attributes, so we do have to call - // cnx->hooks->egl.eglChooseConfig() -- but we don't have to loop + // cnx->egl.eglChooseConfig() -- but we don't have to loop // through all the EGLimpl[]. // We also know we can only get a single config back, and we know // which one. - res = cnx->hooks->egl.eglChooseConfig( + res = cnx->egl.eglChooseConfig( dp->disp[i].dpy, attrib_list, configs, config_size, &n); if (res && n>0) { // n has to be 0 or 1, by construction, and we already know @@ -872,10 +877,10 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, return res; } - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { - if (cnx->hooks->egl.eglChooseConfig( + if (cnx->egl.eglChooseConfig( dp->disp[i].dpy, attrib_list, configs, config_size, &n)) { if (configs) { // now we need to convert these client EGLConfig to our @@ -917,7 +922,7 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, *value = configToUniqueId(dp, i, index); return EGL_TRUE; } - return cnx->hooks->egl.eglGetConfigAttrib( + return cnx->egl.eglGetConfigAttrib( dp->disp[i].dpy, dp->disp[i].config[index], attribute, value); } @@ -933,7 +938,7 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, int i=0, index=0; egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); if (cnx) { - EGLSurface surface = cnx->hooks->egl.eglCreateWindowSurface( + EGLSurface surface = cnx->egl.eglCreateWindowSurface( dp->disp[i].dpy, dp->disp[i].config[index], window, attrib_list); if (surface != EGL_NO_SURFACE) { egl_surface_t* s = new egl_surface_t(dpy, surface, i, cnx); @@ -951,7 +956,7 @@ EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config, int i=0, index=0; egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); if (cnx) { - EGLSurface surface = cnx->hooks->egl.eglCreatePixmapSurface( + EGLSurface surface = cnx->egl.eglCreatePixmapSurface( dp->disp[i].dpy, dp->disp[i].config[index], pixmap, attrib_list); if (surface != EGL_NO_SURFACE) { egl_surface_t* s = new egl_surface_t(dpy, surface, i, cnx); @@ -968,7 +973,7 @@ EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, int i=0, index=0; egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); if (cnx) { - EGLSurface surface = cnx->hooks->egl.eglCreatePbufferSurface( + EGLSurface surface = cnx->egl.eglCreatePbufferSurface( dp->disp[i].dpy, dp->disp[i].config[index], attrib_list); if (surface != EGL_NO_SURFACE) { egl_surface_t* s = new egl_surface_t(dpy, surface, i, cnx); @@ -988,7 +993,7 @@ EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) egl_display_t const * const dp = get_display(dpy); egl_surface_t * const s = get_surface(surface); - EGLBoolean result = s->cnx->hooks->egl.eglDestroySurface( + EGLBoolean result = s->cnx->egl.eglDestroySurface( dp->disp[s->impl].dpy, s->surface); if (result == EGL_TRUE) { _s.terminate(); @@ -1007,7 +1012,7 @@ EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface surface, egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - return s->cnx->hooks->egl.eglQuerySurface( + return s->cnx->egl.eglQuerySurface( dp->disp[s->impl].dpy, s->surface, attribute, value); } @@ -1022,11 +1027,26 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, int i=0, index=0; egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); if (cnx) { - EGLContext context = cnx->hooks->egl.eglCreateContext( + EGLContext context = cnx->egl.eglCreateContext( dp->disp[i].dpy, dp->disp[i].config[index], share_list, attrib_list); if (context != EGL_NO_CONTEXT) { - egl_context_t* c = new egl_context_t(dpy, context, i, cnx); + // figure out if it's a GLESv1 or GLESv2 + int version = 0; + if (attrib_list) { + while (*attrib_list != EGL_NONE) { + GLint attr = *attrib_list++; + GLint value = *attrib_list++; + if (attr == EGL_CONTEXT_CLIENT_VERSION) { + if (value == 1) { + version = GLESv1_INDEX; + } else if (value == 2) { + version = GLESv2_INDEX; + } + } + }; + } + egl_context_t* c = new egl_context_t(dpy, context, i, cnx, version); return c; } } @@ -1042,7 +1062,7 @@ EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx) return EGL_FALSE; egl_display_t const * const dp = get_display(dpy); egl_context_t * const c = get_context(ctx); - EGLBoolean result = c->cnx->hooks->egl.eglDestroyContext( + EGLBoolean result = c->cnx->egl.eglDestroyContext( dp->disp[c->impl].dpy, c->context); if (result == EGL_TRUE) { _c.terminate(); @@ -1122,10 +1142,10 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, EGLBoolean result; if (c) { - result = c->cnx->hooks->egl.eglMakeCurrent( + result = c->cnx->egl.eglMakeCurrent( dp->disp[c->impl].dpy, impl_draw, impl_read, impl_ctx); } else { - result = cur_c->cnx->hooks->egl.eglMakeCurrent( + result = cur_c->cnx->egl.eglMakeCurrent( dp->disp[cur_c->impl].dpy, impl_draw, impl_read, impl_ctx); } @@ -1138,11 +1158,11 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, // cur_c has to be valid here (but could be terminated) if (ctx != EGL_NO_CONTEXT) { - setGlThreadSpecific(c->cnx->hooks); + setGlThreadSpecific(c->cnx->hooks[c->version]); setContext(ctx); _c.acquire(); } else { - setGlThreadSpecific(&gHooks[IMPL_NO_CONTEXT]); + setGlThreadSpecific(&gHooksNoContext); setContext(EGL_NO_CONTEXT); } _cur_c.release(); @@ -1171,7 +1191,7 @@ EGLBoolean eglQueryContext( EGLDisplay dpy, EGLContext ctx, egl_display_t const * const dp = get_display(dpy); egl_context_t * const c = get_context(ctx); - return c->cnx->hooks->egl.eglQueryContext( + return c->cnx->egl.eglQueryContext( dp->disp[c->impl].dpy, c->context, attribute, value); } @@ -1231,7 +1251,7 @@ EGLBoolean eglWaitGL(void) egl_connection_t* const cnx = &gEGLImpl[c->impl]; if (!cnx->dso) return setError(EGL_BAD_CONTEXT, EGL_FALSE); - res = cnx->hooks->egl.eglWaitGL(); + res = cnx->egl.eglWaitGL(); } return res; } @@ -1251,7 +1271,7 @@ EGLBoolean eglWaitNative(EGLint engine) egl_connection_t* const cnx = &gEGLImpl[c->impl]; if (!cnx->dso) return setError(EGL_BAD_CONTEXT, EGL_FALSE); - res = cnx->hooks->egl.eglWaitNative(engine); + res = cnx->egl.eglWaitNative(engine); } return res; } @@ -1259,11 +1279,11 @@ EGLBoolean eglWaitNative(EGLint engine) EGLint eglGetError(void) { EGLint result = EGL_SUCCESS; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { EGLint err = EGL_SUCCESS; egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) - err = cnx->hooks->egl.eglGetError(); + err = cnx->egl.eglGetError(); if (err!=EGL_SUCCESS && result==EGL_SUCCESS) result = err; } @@ -1294,11 +1314,11 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname) addr = 0; int slot = -1; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { - if (cnx->hooks->egl.eglGetProcAddress) { - addr = cnx->hooks->egl.eglGetProcAddress(procname); + if (cnx->egl.eglGetProcAddress) { + addr = cnx->egl.eglGetProcAddress(procname); if (addr) { if (slot == -1) { slot = 0; // XXX: find free slot @@ -1307,7 +1327,7 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname) break; } } - cnx->hooks->ext.extensions[slot] = addr; + //cnx->hooks->ext.extensions[slot] = addr; } } } @@ -1347,7 +1367,7 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) return EGL_FALSE; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(draw); - return s->cnx->hooks->egl.eglSwapBuffers(dp->disp[s->impl].dpy, s->surface); + return s->cnx->egl.eglSwapBuffers(dp->disp[s->impl].dpy, s->surface); } EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface, @@ -1360,7 +1380,7 @@ EGLBoolean eglCopyBuffers( EGLDisplay dpy, EGLSurface surface, return EGL_FALSE; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - return s->cnx->hooks->egl.eglCopyBuffers( + return s->cnx->egl.eglCopyBuffers( dp->disp[s->impl].dpy, s->surface, target); } @@ -1395,8 +1415,8 @@ EGLBoolean eglSurfaceAttrib( return EGL_FALSE; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - if (s->cnx->hooks->egl.eglSurfaceAttrib) { - return s->cnx->hooks->egl.eglSurfaceAttrib( + if (s->cnx->egl.eglSurfaceAttrib) { + return s->cnx->egl.eglSurfaceAttrib( dp->disp[s->impl].dpy, s->surface, attribute, value); } return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1412,8 +1432,8 @@ EGLBoolean eglBindTexImage( return EGL_FALSE; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - if (s->cnx->hooks->egl.eglBindTexImage) { - return s->cnx->hooks->egl.eglBindTexImage( + if (s->cnx->egl.eglBindTexImage) { + return s->cnx->egl.eglBindTexImage( dp->disp[s->impl].dpy, s->surface, buffer); } return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1429,8 +1449,8 @@ EGLBoolean eglReleaseTexImage( return EGL_FALSE; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - if (s->cnx->hooks->egl.eglReleaseTexImage) { - return s->cnx->hooks->egl.eglReleaseTexImage( + if (s->cnx->egl.eglReleaseTexImage) { + return s->cnx->egl.eglReleaseTexImage( dp->disp[s->impl].dpy, s->surface, buffer); } return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1442,11 +1462,11 @@ EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) if (!dp) return setError(EGL_BAD_DISPLAY, EGL_FALSE); EGLBoolean res = EGL_TRUE; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { - if (cnx->hooks->egl.eglSwapInterval) { - if (cnx->hooks->egl.eglSwapInterval( + if (cnx->egl.eglSwapInterval) { + if (cnx->egl.eglSwapInterval( dp->disp[i].dpy, interval) == EGL_FALSE) { res = EGL_FALSE; } @@ -1475,10 +1495,10 @@ EGLBoolean eglWaitClient(void) egl_connection_t* const cnx = &gEGLImpl[c->impl]; if (!cnx->dso) return setError(EGL_BAD_CONTEXT, EGL_FALSE); - if (cnx->hooks->egl.eglWaitClient) { - res = cnx->hooks->egl.eglWaitClient(); + if (cnx->egl.eglWaitClient) { + res = cnx->egl.eglWaitClient(); } else { - res = cnx->hooks->egl.eglWaitGL(); + res = cnx->egl.eglWaitGL(); } } return res; @@ -1492,11 +1512,11 @@ EGLBoolean eglBindAPI(EGLenum api) // bind this API on all EGLs EGLBoolean res = EGL_TRUE; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { - if (cnx->hooks->egl.eglBindAPI) { - if (cnx->hooks->egl.eglBindAPI(api) == EGL_FALSE) { + if (cnx->egl.eglBindAPI) { + if (cnx->egl.eglBindAPI(api) == EGL_FALSE) { res = EGL_FALSE; } } @@ -1511,13 +1531,13 @@ EGLenum eglQueryAPI(void) return setError(EGL_BAD_PARAMETER, EGL_FALSE); } - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { - if (cnx->hooks->egl.eglQueryAPI) { + if (cnx->egl.eglQueryAPI) { // the first one we find is okay, because they all // should be the same - return cnx->hooks->egl.eglQueryAPI(); + return cnx->egl.eglQueryAPI(); } } } @@ -1527,11 +1547,11 @@ EGLenum eglQueryAPI(void) EGLBoolean eglReleaseThread(void) { - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { - if (cnx->hooks->egl.eglReleaseThread) { - cnx->hooks->egl.eglReleaseThread(); + if (cnx->egl.eglReleaseThread) { + cnx->egl.eglReleaseThread(); } } } @@ -1547,8 +1567,8 @@ EGLSurface eglCreatePbufferFromClientBuffer( int i=0, index=0; egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); if (!cnx) return EGL_FALSE; - if (cnx->hooks->egl.eglCreatePbufferFromClientBuffer) { - return cnx->hooks->egl.eglCreatePbufferFromClientBuffer( + if (cnx->egl.eglCreatePbufferFromClientBuffer) { + return cnx->egl.eglCreatePbufferFromClientBuffer( dp->disp[i].dpy, buftype, buffer, dp->disp[i].config[index], attrib_list); } @@ -1571,8 +1591,8 @@ EGLBoolean eglLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface, egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - if (s->cnx->hooks->egl.eglLockSurfaceKHR) { - return s->cnx->hooks->egl.eglLockSurfaceKHR( + if (s->cnx->egl.eglLockSurfaceKHR) { + return s->cnx->egl.eglLockSurfaceKHR( dp->disp[s->impl].dpy, s->surface, attrib_list); } return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1589,8 +1609,8 @@ EGLBoolean eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface) egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - if (s->cnx->hooks->egl.eglUnlockSurfaceKHR) { - return s->cnx->hooks->egl.eglUnlockSurfaceKHR( + if (s->cnx->egl.eglUnlockSurfaceKHR) { + return s->cnx->egl.eglUnlockSurfaceKHR( dp->disp[s->impl].dpy, s->surface); } return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1607,7 +1627,7 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, egl_display_t const * const dp = get_display(dpy); egl_context_t * const c = get_context(ctx); // since we have an EGLContext, we know which implementation to use - EGLImageKHR image = c->cnx->hooks->egl.eglCreateImageKHR( + EGLImageKHR image = c->cnx->egl.eglCreateImageKHR( dp->disp[c->impl].dpy, c->context, target, buffer, attrib_list); if (image == EGL_NO_IMAGE_KHR) return image; @@ -1624,14 +1644,14 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, // since we don't have a way to know which implementation to call, // we're calling all of them - EGLImageKHR implImages[IMPL_NUM_DRIVERS_IMPLEMENTATIONS]; + EGLImageKHR implImages[IMPL_NUM_IMPLEMENTATIONS]; bool success = false; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; implImages[i] = EGL_NO_IMAGE_KHR; if (cnx->dso) { - if (cnx->hooks->egl.eglCreateImageKHR) { - implImages[i] = cnx->hooks->egl.eglCreateImageKHR( + if (cnx->egl.eglCreateImageKHR) { + implImages[i] = cnx->egl.eglCreateImageKHR( dp->disp[i].dpy, ctx, target, buffer, attrib_list); if (implImages[i] != EGL_NO_IMAGE_KHR) { success = true; @@ -1660,12 +1680,12 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) egl_image_t* image = get_image(img); bool success = false; - for (int i=0 ; i<IMPL_NUM_DRIVERS_IMPLEMENTATIONS ; i++) { + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (image->images[i] != EGL_NO_IMAGE_KHR) { if (cnx->dso) { - if (cnx->hooks->egl.eglCreateImageKHR) { - if (cnx->hooks->egl.eglDestroyImageKHR( + if (cnx->egl.eglCreateImageKHR) { + if (cnx->egl.eglDestroyImageKHR( dp->disp[i].dpy, image->images[i])) { success = true; } @@ -1696,8 +1716,8 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, return EGL_FALSE; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(draw); - if (s->cnx->hooks->egl.eglSetSwapRectangleANDROID) { - return s->cnx->hooks->egl.eglSetSwapRectangleANDROID( + if (s->cnx->egl.eglSetSwapRectangleANDROID) { + return s->cnx->egl.eglSetSwapRectangleANDROID( dp->disp[s->impl].dpy, s->surface, left, top, width, height); } return setError(EGL_BAD_DISPLAY, NULL); @@ -1712,8 +1732,8 @@ EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) return 0; egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(draw); - if (s->cnx->hooks->egl.eglGetRenderBufferANDROID) { - return s->cnx->hooks->egl.eglGetRenderBufferANDROID( + if (s->cnx->egl.eglGetRenderBufferANDROID) { + return s->cnx->egl.eglGetRenderBufferANDROID( dp->disp[s->impl].dpy, s->surface); } return setError(EGL_BAD_DISPLAY, (EGLClientBuffer*)0); diff --git a/opengl/libs/EGL/hooks.cpp b/opengl/libs/EGL/hooks.cpp index 2246366..72ad6b3 100644 --- a/opengl/libs/EGL/hooks.cpp +++ b/opengl/libs/EGL/hooks.cpp @@ -41,14 +41,7 @@ void gl_unimplemented() { #define EGL_ENTRY(_r, _api, ...) #_api, char const * const gl_names[] = { - #include "GLES_CM/gl_entries.in" - #include "GLES_CM/glext_entries.in" - NULL -}; - -char const * const gl2_names[] = { - #include "GLES2/gl2_entries.in" - #include "GLES2/gl2ext_entries.in" + #include "entries.in" NULL }; diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp index e5358c3..4c0ba88 100644 --- a/opengl/libs/GLES2/gl2.cpp +++ b/opengl/libs/GLES2/gl2.cpp @@ -53,7 +53,7 @@ using namespace android; "bx lr \n" \ : \ : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ - [api] "J"(__builtin_offsetof(gl_hooks_t, gl2._api)) \ + [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \ : \ ); @@ -66,11 +66,11 @@ using namespace android; #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ - gl_hooks_t::gl2_t const * const _c = &getGlThreadSpecific()->gl2; \ + gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ _c->_api(__VA_ARGS__) #define CALL_GL_API_RETURN(_api, ...) \ - gl_hooks_t::gl2_t const * const _c = &getGlThreadSpecific()->gl2; \ + gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ return _c->_api(__VA_ARGS__) #endif diff --git a/opengl/libs/GLES2/gl2_entries.in b/opengl/libs/GLES2/gl2_entries.in deleted file mode 100644 index 6a41b94..0000000 --- a/opengl/libs/GLES2/gl2_entries.in +++ /dev/null @@ -1,142 +0,0 @@ -GL_ENTRY(void, glActiveTexture, GLenum texture) -GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader) -GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const char* name) -GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer) -GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer) -GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer) -GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture) -GL_ENTRY(void, glBlendColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -GL_ENTRY(void, glBlendEquation, GLenum mode ) -GL_ENTRY(void, glBlendEquationSeparate, GLenum modeRGB, GLenum modeAlpha) -GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor) -GL_ENTRY(void, glBlendFuncSeparate, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) -GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const void* data, GLenum usage) -GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const void* data) -GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target) -GL_ENTRY(void, glClear, GLbitfield mask) -GL_ENTRY(void, glClearColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -GL_ENTRY(void, glClearDepthf, GLclampf depth) -GL_ENTRY(void, glClearStencil, GLint s) -GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) -GL_ENTRY(void, glCompileShader, GLuint shader) -GL_ENTRY(void, glCompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) -GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) -GL_ENTRY(void, glCopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) -GL_ENTRY(void, glCopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) -GL_ENTRY(GLuint, glCreateProgram, void) -GL_ENTRY(GLuint, glCreateShader, GLenum type) -GL_ENTRY(void, glCullFace, GLenum mode) -GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint* buffers) -GL_ENTRY(void, glDeleteFramebuffers, GLsizei n, const GLuint* framebuffers) -GL_ENTRY(void, glDeleteProgram, GLuint program) -GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers) -GL_ENTRY(void, glDeleteShader, GLuint shader) -GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint* textures) -GL_ENTRY(void, glDepthFunc, GLenum func) -GL_ENTRY(void, glDepthMask, GLboolean flag) -GL_ENTRY(void, glDepthRangef, GLclampf zNear, GLclampf zFar) -GL_ENTRY(void, glDetachShader, GLuint program, GLuint shader) -GL_ENTRY(void, glDisable, GLenum cap) -GL_ENTRY(void, glDisableVertexAttribArray, GLuint index) -GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count) -GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const void* indices) -GL_ENTRY(void, glEnable, GLenum cap) -GL_ENTRY(void, glEnableVertexAttribArray, GLuint index) -GL_ENTRY(void, glFinish, void) -GL_ENTRY(void, glFlush, void) -GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) -GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -GL_ENTRY(void, glFrontFace, GLenum mode) -GL_ENTRY(void, glGenBuffers, GLsizei n, GLuint* buffers) -GL_ENTRY(void, glGenerateMipmap, GLenum target) -GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint* framebuffers) -GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers) -GL_ENTRY(void, glGenTextures, GLsizei n, GLuint* textures) -GL_ENTRY(void, glGetActiveAttrib, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) -GL_ENTRY(void, glGetActiveUniform, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) -GL_ENTRY(void, glGetAttachedShaders, GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) -GL_ENTRY(int, glGetAttribLocation, GLuint program, const char* name) -GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean* params) -GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint* params) -GL_ENTRY(GLenum, glGetError, void) -GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat* params) -GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint* params) -GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint* params) -GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params) -GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) -GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params) -GL_ENTRY(void, glGetShaderiv, GLuint shader, GLenum pname, GLint* params) -GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) -GL_ENTRY(void, glGetShaderPrecisionFormat, GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) -GL_ENTRY(void, glGetShaderSource, GLuint shader, GLsizei bufsize, GLsizei* length, char* source) -GL_ENTRY(const GLubyte*, glGetString, GLenum name) -GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat* params) -GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint* params) -GL_ENTRY(void, glGetUniformfv, GLuint program, GLint location, GLfloat* params) -GL_ENTRY(void, glGetUniformiv, GLuint program, GLint location, GLint* params) -GL_ENTRY(int, glGetUniformLocation, GLuint program, const char* name) -GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params) -GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params) -GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, void** pointer) -GL_ENTRY(void, glHint, GLenum target, GLenum mode) -GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer) -GL_ENTRY(GLboolean, glIsEnabled, GLenum cap) -GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer) -GL_ENTRY(GLboolean, glIsProgram, GLuint program) -GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer) -GL_ENTRY(GLboolean, glIsShader, GLuint shader) -GL_ENTRY(GLboolean, glIsTexture, GLuint texture) -GL_ENTRY(void, glLineWidth, GLfloat width) -GL_ENTRY(void, glLinkProgram, GLuint program) -GL_ENTRY(void, glPixelStorei, GLenum pname, GLint param) -GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units) -GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) -GL_ENTRY(void, glReleaseShaderCompiler, void) -GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) -GL_ENTRY(void, glSampleCoverage, GLclampf value, GLboolean invert) -GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height) -GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) -GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const char** string, const GLint* length) -GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask) -GL_ENTRY(void, glStencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask) -GL_ENTRY(void, glStencilMask, GLuint mask) -GL_ENTRY(void, glStencilMaskSeparate, GLenum face, GLuint mask) -GL_ENTRY(void, glStencilOp, GLenum fail, GLenum zfail, GLenum zpass) -GL_ENTRY(void, glStencilOpSeparate, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) -GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) -GL_ENTRY(void, glTexParameterf, GLenum target, GLenum pname, GLfloat param) -GL_ENTRY(void, glTexParameterfv, GLenum target, GLenum pname, const GLfloat* params) -GL_ENTRY(void, glTexParameteri, GLenum target, GLenum pname, GLint param) -GL_ENTRY(void, glTexParameteriv, GLenum target, GLenum pname, const GLint* params) -GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) -GL_ENTRY(void, glUniform1f, GLint location, GLfloat x) -GL_ENTRY(void, glUniform1fv, GLint location, GLsizei count, const GLfloat* v) -GL_ENTRY(void, glUniform1i, GLint location, GLint x) -GL_ENTRY(void, glUniform1iv, GLint location, GLsizei count, const GLint* v) -GL_ENTRY(void, glUniform2f, GLint location, GLfloat x, GLfloat y) -GL_ENTRY(void, glUniform2fv, GLint location, GLsizei count, const GLfloat* v) -GL_ENTRY(void, glUniform2i, GLint location, GLint x, GLint y) -GL_ENTRY(void, glUniform2iv, GLint location, GLsizei count, const GLint* v) -GL_ENTRY(void, glUniform3f, GLint location, GLfloat x, GLfloat y, GLfloat z) -GL_ENTRY(void, glUniform3fv, GLint location, GLsizei count, const GLfloat* v) -GL_ENTRY(void, glUniform3i, GLint location, GLint x, GLint y, GLint z) -GL_ENTRY(void, glUniform3iv, GLint location, GLsizei count, const GLint* v) -GL_ENTRY(void, glUniform4f, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -GL_ENTRY(void, glUniform4fv, GLint location, GLsizei count, const GLfloat* v) -GL_ENTRY(void, glUniform4i, GLint location, GLint x, GLint y, GLint z, GLint w) -GL_ENTRY(void, glUniform4iv, GLint location, GLsizei count, const GLint* v) -GL_ENTRY(void, glUniformMatrix2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) -GL_ENTRY(void, glUniformMatrix3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) -GL_ENTRY(void, glUniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) -GL_ENTRY(void, glUseProgram, GLuint program) -GL_ENTRY(void, glValidateProgram, GLuint program) -GL_ENTRY(void, glVertexAttrib1f, GLuint indx, GLfloat x) -GL_ENTRY(void, glVertexAttrib1fv, GLuint indx, const GLfloat* values) -GL_ENTRY(void, glVertexAttrib2f, GLuint indx, GLfloat x, GLfloat y) -GL_ENTRY(void, glVertexAttrib2fv, GLuint indx, const GLfloat* values) -GL_ENTRY(void, glVertexAttrib3f, GLuint indx, GLfloat x, GLfloat y, GLfloat z) -GL_ENTRY(void, glVertexAttrib3fv, GLuint indx, const GLfloat* values) -GL_ENTRY(void, glVertexAttrib4f, GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) -GL_ENTRY(void, glVertexAttrib4fv, GLuint indx, const GLfloat* values) -GL_ENTRY(void, glVertexAttribPointer, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) -GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height) diff --git a/opengl/libs/GLES2/gl2ext_entries.in b/opengl/libs/GLES2/gl2ext_entries.in deleted file mode 100644 index e608f5d..0000000 --- a/opengl/libs/GLES2/gl2ext_entries.in +++ /dev/null @@ -1,35 +0,0 @@ -GL_ENTRY(void, glEGLImageTargetTexture2DOES, GLenum target, GLeglImageOES image) -GL_ENTRY(void, glEGLImageTargetRenderbufferStorageOES, GLenum target, GLeglImageOES image) -GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) -GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const void *binary, GLint length) -GL_ENTRY(void*, glMapBufferOES, GLenum target, GLenum access) -GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target) -GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, void** params) -GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) -GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) -GL_ENTRY(void, glCopyTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) -GL_ENTRY(void, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) -GL_ENTRY(void, glCompressedTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) -GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) -GL_ENTRY(void, glGetPerfMonitorGroupsAMD, GLint *numGroups, GLsizei groupsSize, GLuint *groups) -GL_ENTRY(void, glGetPerfMonitorCountersAMD, GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) -GL_ENTRY(void, glGetPerfMonitorGroupStringAMD, GLuint group, GLsizei bufSize, GLsizei *length, char *groupString) -GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString) -GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, void *data) -GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors) -GL_ENTRY(void, glDeletePerfMonitorsAMD, GLsizei n, GLuint *monitors) -GL_ENTRY(void, glSelectPerfMonitorCountersAMD, GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) -GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor) -GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor) -GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) -GL_ENTRY(void, glDeleteFencesNV, GLsizei n, const GLuint *fences) -GL_ENTRY(void, glGenFencesNV, GLsizei n, GLuint *fences) -GL_ENTRY(GLboolean, glIsFenceNV, GLuint fence) -GL_ENTRY(GLboolean, glTestFenceNV, GLuint fence) -GL_ENTRY(void, glGetFenceivNV, GLuint fence, GLenum pname, GLint *params) -GL_ENTRY(void, glFinishFenceNV, GLuint fence) -GL_ENTRY(void, glSetFenceNV, GLuint fence, GLenum condition) -GL_ENTRY(void, glGetDriverControlsQCOM, GLint *num, GLsizei size, GLuint *driverControls) -GL_ENTRY(void, glGetDriverControlStringQCOM, GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString) -GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl) -GL_ENTRY(void, glDisableDriverControlQCOM, GLuint driverControl) diff --git a/opengl/libs/GLES_CM/gl_entries.in b/opengl/libs/GLES_CM/gl_entries.in deleted file mode 100644 index d7cc5da..0000000 --- a/opengl/libs/GLES_CM/gl_entries.in +++ /dev/null @@ -1,145 +0,0 @@ -GL_ENTRY(void, glAlphaFunc, GLenum func, GLclampf ref) -GL_ENTRY(void, glClearColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -GL_ENTRY(void, glClearDepthf, GLclampf depth) -GL_ENTRY(void, glClipPlanef, GLenum plane, const GLfloat *equation) -GL_ENTRY(void, glColor4f, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -GL_ENTRY(void, glDepthRangef, GLclampf zNear, GLclampf zFar) -GL_ENTRY(void, glFogf, GLenum pname, GLfloat param) -GL_ENTRY(void, glFogfv, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glFrustumf, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) -GL_ENTRY(void, glGetClipPlanef, GLenum pname, GLfloat eqn[4]) -GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *params) -GL_ENTRY(void, glGetLightfv, GLenum light, GLenum pname, GLfloat *params) -GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params) -GL_ENTRY(void, glGetTexEnvfv, GLenum env, GLenum pname, GLfloat *params) -GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat *params) -GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param) -GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glLightf, GLenum light, GLenum pname, GLfloat param) -GL_ENTRY(void, glLightfv, GLenum light, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glLineWidth, GLfloat width) -GL_ENTRY(void, glLoadMatrixf, const GLfloat *m) -GL_ENTRY(void, glMaterialf, GLenum face, GLenum pname, GLfloat param) -GL_ENTRY(void, glMaterialfv, GLenum face, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glMultMatrixf, const GLfloat *m) -GL_ENTRY(void, glMultiTexCoord4f, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) -GL_ENTRY(void, glNormal3f, GLfloat nx, GLfloat ny, GLfloat nz) -GL_ENTRY(void, glOrthof, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) -GL_ENTRY(void, glPointParameterf, GLenum pname, GLfloat param) -GL_ENTRY(void, glPointParameterfv, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glPointSize, GLfloat size) -GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units) -GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -GL_ENTRY(void, glScalef, GLfloat x, GLfloat y, GLfloat z) -GL_ENTRY(void, glTexEnvf, GLenum target, GLenum pname, GLfloat param) -GL_ENTRY(void, glTexEnvfv, GLenum target, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glTexParameterf, GLenum target, GLenum pname, GLfloat param) -GL_ENTRY(void, glTexParameterfv, GLenum target, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z) -GL_ENTRY(void, glActiveTexture, GLenum texture) -GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref) -GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer) -GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture) -GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor) -GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) -GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) -GL_ENTRY(void, glClear, GLbitfield mask) -GL_ENTRY(void, glClearColorx, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) -GL_ENTRY(void, glClearDepthx, GLclampx depth) -GL_ENTRY(void, glClearStencil, GLint s) -GL_ENTRY(void, glClientActiveTexture, GLenum texture) -GL_ENTRY(void, glClipPlanex, GLenum plane, const GLfixed *equation) -GL_ENTRY(void, glColor4ub, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) -GL_ENTRY(void, glColor4x, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) -GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) -GL_ENTRY(void, glColorPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -GL_ENTRY(void, glCompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) -GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) -GL_ENTRY(void, glCopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) -GL_ENTRY(void, glCopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) -GL_ENTRY(void, glCullFace, GLenum mode) -GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers) -GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint *textures) -GL_ENTRY(void, glDepthFunc, GLenum func) -GL_ENTRY(void, glDepthMask, GLboolean flag) -GL_ENTRY(void, glDepthRangex, GLclampx zNear, GLclampx zFar) -GL_ENTRY(void, glDisable, GLenum cap) -GL_ENTRY(void, glDisableClientState, GLenum array) -GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count) -GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) -GL_ENTRY(void, glEnable, GLenum cap) -GL_ENTRY(void, glEnableClientState, GLenum array) -GL_ENTRY(void, glFinish, void) -GL_ENTRY(void, glFlush, void) -GL_ENTRY(void, glFogx, GLenum pname, GLfixed param) -GL_ENTRY(void, glFogxv, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glFrontFace, GLenum mode) -GL_ENTRY(void, glFrustumx, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) -GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean *params) -GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint *params) -GL_ENTRY(void, glGetClipPlanex, GLenum pname, GLfixed eqn[4]) -GL_ENTRY(void, glGenBuffers, GLsizei n, GLuint *buffers) -GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures) -GL_ENTRY(GLenum, glGetError, void) -GL_ENTRY(void, glGetFixedv, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *params) -GL_ENTRY(void, glGetLightxv, GLenum light, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetPointerv, GLenum pname, void **params) -GL_ENTRY(const GLubyte *, glGetString, GLenum name) -GL_ENTRY(void, glGetTexEnviv, GLenum env, GLenum pname, GLint *params) -GL_ENTRY(void, glGetTexEnvxv, GLenum env, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint *params) -GL_ENTRY(void, glGetTexParameterxv, GLenum target, GLenum pname, GLfixed *params) -GL_ENTRY(void, glHint, GLenum target, GLenum mode) -GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer) -GL_ENTRY(GLboolean, glIsEnabled, GLenum cap) -GL_ENTRY(GLboolean, glIsTexture, GLuint texture) -GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param) -GL_ENTRY(void, glLightModelxv, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glLightx, GLenum light, GLenum pname, GLfixed param) -GL_ENTRY(void, glLightxv, GLenum light, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glLineWidthx, GLfixed width) -GL_ENTRY(void, glLoadIdentity, void) -GL_ENTRY(void, glLoadMatrixx, const GLfixed *m) -GL_ENTRY(void, glLogicOp, GLenum opcode) -GL_ENTRY(void, glMaterialx, GLenum face, GLenum pname, GLfixed param) -GL_ENTRY(void, glMaterialxv, GLenum face, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glMatrixMode, GLenum mode) -GL_ENTRY(void, glMultMatrixx, const GLfixed *m) -GL_ENTRY(void, glMultiTexCoord4x, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) -GL_ENTRY(void, glNormal3x, GLfixed nx, GLfixed ny, GLfixed nz) -GL_ENTRY(void, glNormalPointer, GLenum type, GLsizei stride, const GLvoid *pointer) -GL_ENTRY(void, glOrthox, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) -GL_ENTRY(void, glPixelStorei, GLenum pname, GLint param) -GL_ENTRY(void, glPointParameterx, GLenum pname, GLfixed param) -GL_ENTRY(void, glPointParameterxv, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glPointSizex, GLfixed size) -GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units) -GL_ENTRY(void, glPopMatrix, void) -GL_ENTRY(void, glPushMatrix, void) -GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) -GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) -GL_ENTRY(void, glSampleCoverage, GLclampf value, GLboolean invert) -GL_ENTRY(void, glSampleCoveragex, GLclampx value, GLboolean invert) -GL_ENTRY(void, glScalex, GLfixed x, GLfixed y, GLfixed z) -GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height) -GL_ENTRY(void, glShadeModel, GLenum mode) -GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask) -GL_ENTRY(void, glStencilMask, GLuint mask) -GL_ENTRY(void, glStencilOp, GLenum fail, GLenum zfail, GLenum zpass) -GL_ENTRY(void, glTexCoordPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -GL_ENTRY(void, glTexEnvi, GLenum target, GLenum pname, GLint param) -GL_ENTRY(void, glTexEnvx, GLenum target, GLenum pname, GLfixed param) -GL_ENTRY(void, glTexEnviv, GLenum target, GLenum pname, const GLint *params) -GL_ENTRY(void, glTexEnvxv, GLenum target, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) -GL_ENTRY(void, glTexParameteri, GLenum target, GLenum pname, GLint param) -GL_ENTRY(void, glTexParameterx, GLenum target, GLenum pname, GLfixed param) -GL_ENTRY(void, glTexParameteriv, GLenum target, GLenum pname, const GLint *params) -GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) -GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z) -GL_ENTRY(void, glVertexPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height) -GL_ENTRY(void, glPointSizePointerOES, GLenum type, GLsizei stride, const GLvoid *pointer) diff --git a/opengl/libs/GLES_CM/glext_entries.in b/opengl/libs/GLES_CM/glext_entries.in deleted file mode 100644 index dd09c71..0000000 --- a/opengl/libs/GLES_CM/glext_entries.in +++ /dev/null @@ -1,90 +0,0 @@ -GL_ENTRY(void, glBlendEquationSeparateOES, GLenum modeRGB, GLenum modeAlpha) -GL_ENTRY(void, glBlendFuncSeparateOES, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) -GL_ENTRY(void, glBlendEquationOES, GLenum mode) -GL_ENTRY(void, glDrawTexsOES, GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) -GL_ENTRY(void, glDrawTexiOES, GLint x, GLint y, GLint z, GLint width, GLint height) -GL_ENTRY(void, glDrawTexxOES, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) -GL_ENTRY(void, glDrawTexsvOES, const GLshort *coords) -GL_ENTRY(void, glDrawTexivOES, const GLint *coords) -GL_ENTRY(void, glDrawTexxvOES, const GLfixed *coords) -GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) -GL_ENTRY(void, glDrawTexfvOES, const GLfloat *coords) -GL_ENTRY(void, glEGLImageTargetTexture2DOES, GLenum target, GLeglImageOES image) -GL_ENTRY(void, glEGLImageTargetRenderbufferStorageOES, GLenum target, GLeglImageOES image) -GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref) -GL_ENTRY(void, glClearColorxOES, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) -GL_ENTRY(void, glClearDepthxOES, GLclampx depth) -GL_ENTRY(void, glClipPlanexOES, GLenum plane, const GLfixed *equation) -GL_ENTRY(void, glColor4xOES, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) -GL_ENTRY(void, glDepthRangexOES, GLclampx zNear, GLclampx zFar) -GL_ENTRY(void, glFogxOES, GLenum pname, GLfixed param) -GL_ENTRY(void, glFogxvOES, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glFrustumxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) -GL_ENTRY(void, glGetClipPlanexOES, GLenum pname, GLfixed eqn[4]) -GL_ENTRY(void, glGetFixedvOES, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetLightxvOES, GLenum light, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetTexEnvxvOES, GLenum env, GLenum pname, GLfixed *params) -GL_ENTRY(void, glGetTexParameterxvOES, GLenum target, GLenum pname, GLfixed *params) -GL_ENTRY(void, glLightModelxOES, GLenum pname, GLfixed param) -GL_ENTRY(void, glLightModelxvOES, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glLightxOES, GLenum light, GLenum pname, GLfixed param) -GL_ENTRY(void, glLightxvOES, GLenum light, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glLineWidthxOES, GLfixed width) -GL_ENTRY(void, glLoadMatrixxOES, const GLfixed *m) -GL_ENTRY(void, glMaterialxOES, GLenum face, GLenum pname, GLfixed param) -GL_ENTRY(void, glMaterialxvOES, GLenum face, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glMultMatrixxOES, const GLfixed *m) -GL_ENTRY(void, glMultiTexCoord4xOES, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) -GL_ENTRY(void, glNormal3xOES, GLfixed nx, GLfixed ny, GLfixed nz) -GL_ENTRY(void, glOrthoxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) -GL_ENTRY(void, glPointParameterxOES, GLenum pname, GLfixed param) -GL_ENTRY(void, glPointParameterxvOES, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glPointSizexOES, GLfixed size) -GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units) -GL_ENTRY(void, glRotatexOES, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) -GL_ENTRY(void, glSampleCoveragexOES, GLclampx value, GLboolean invert) -GL_ENTRY(void, glScalexOES, GLfixed x, GLfixed y, GLfixed z) -GL_ENTRY(void, glTexEnvxOES, GLenum target, GLenum pname, GLfixed param) -GL_ENTRY(void, glTexEnvxvOES, GLenum target, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param) -GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z) -GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer) -GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer) -GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers) -GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers) -GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) -GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params) -GL_ENTRY(GLboolean, glIsFramebufferOES, GLuint framebuffer) -GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer) -GL_ENTRY(void, glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers) -GL_ENTRY(void, glGenFramebuffersOES, GLsizei n, GLuint* framebuffers) -GL_ENTRY(GLenum, glCheckFramebufferStatusOES, GLenum target) -GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) -GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) -GL_ENTRY(void, glGetFramebufferAttachmentParameterivOES, GLenum target, GLenum attachment, GLenum pname, GLint* params) -GL_ENTRY(void, glGenerateMipmapOES, GLenum target) -GL_ENTRY(void*, glMapBufferOES, GLenum target, GLenum access) -GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target) -GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, void** params) -GL_ENTRY(void, glCurrentPaletteMatrixOES, GLuint matrixpaletteindex) -GL_ENTRY(void, glLoadPaletteFromModelViewMatrixOES, void) -GL_ENTRY(void, glMatrixIndexPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -GL_ENTRY(void, glWeightPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) -GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16]) -GL_ENTRY(void, glDepthRangefOES, GLclampf zNear, GLclampf zFar) -GL_ENTRY(void, glFrustumfOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) -GL_ENTRY(void, glOrthofOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) -GL_ENTRY(void, glClipPlanefOES, GLenum plane, const GLfloat *equation) -GL_ENTRY(void, glGetClipPlanefOES, GLenum pname, GLfloat eqn[4]) -GL_ENTRY(void, glClearDepthfOES, GLclampf depth) -GL_ENTRY(void, glTexGenfOES, GLenum coord, GLenum pname, GLfloat param) -GL_ENTRY(void, glTexGenfvOES, GLenum coord, GLenum pname, const GLfloat *params) -GL_ENTRY(void, glTexGeniOES, GLenum coord, GLenum pname, GLint param) -GL_ENTRY(void, glTexGenivOES, GLenum coord, GLenum pname, const GLint *params) -GL_ENTRY(void, glTexGenxOES, GLenum coord, GLenum pname, GLfixed param) -GL_ENTRY(void, glTexGenxvOES, GLenum coord, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glGetTexGenfvOES, GLenum coord, GLenum pname, GLfloat *params) -GL_ENTRY(void, glGetTexGenivOES, GLenum coord, GLenum pname, GLint *params) -GL_ENTRY(void, glGetTexGenxvOES, GLenum coord, GLenum pname, GLfixed *params) diff --git a/opengl/libs/egl_impl.h b/opengl/libs/egl_impl.h index ac286cb..1fba209f7 100644 --- a/opengl/libs/egl_impl.h +++ b/opengl/libs/egl_impl.h @@ -23,18 +23,19 @@ #include <EGL/eglext.h> #include <EGL/eglplatform.h> +#include "hooks.h" + // ---------------------------------------------------------------------------- namespace android { // ---------------------------------------------------------------------------- -struct gl_hooks_t; - struct egl_connection_t { void * dso; - gl_hooks_t * hooks; + gl_hooks_t * hooks[2]; EGLint major; EGLint minor; + egl_t egl; }; EGLAPI EGLImageKHR egl_get_image_for_current_context(EGLImageKHR image); diff --git a/opengl/libs/entries.in b/opengl/libs/entries.in new file mode 100644 index 0000000..bbe3e23 --- /dev/null +++ b/opengl/libs/entries.in @@ -0,0 +1,349 @@ +GL_ENTRY(void, glActiveTexture, GLenum texture) +GL_ENTRY(void, glAlphaFunc, GLenum func, GLclampf ref) +GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref) +GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref) +GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader) +GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor) +GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const char* name) +GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer) +GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer) +GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer) +GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer) +GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer) +GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture) +GL_ENTRY(void, glBlendColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) +GL_ENTRY(void, glBlendEquation, GLenum mode ) +GL_ENTRY(void, glBlendEquationOES, GLenum mode) +GL_ENTRY(void, glBlendEquationSeparate, GLenum modeRGB, GLenum modeAlpha) +GL_ENTRY(void, glBlendEquationSeparateOES, GLenum modeRGB, GLenum modeAlpha) +GL_ENTRY(void, glBlendFunc, GLenum sfactor, GLenum dfactor) +GL_ENTRY(void, glBlendFuncSeparate, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) +GL_ENTRY(void, glBlendFuncSeparateOES, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) +GL_ENTRY(void, glBufferData, GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage) +GL_ENTRY(void, glBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data) +GL_ENTRY(GLenum, glCheckFramebufferStatus, GLenum target) +GL_ENTRY(GLenum, glCheckFramebufferStatusOES, GLenum target) +GL_ENTRY(void, glClear, GLbitfield mask) +GL_ENTRY(void, glClearColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) +GL_ENTRY(void, glClearColorx, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) +GL_ENTRY(void, glClearColorxOES, GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) +GL_ENTRY(void, glClearDepthf, GLclampf depth) +GL_ENTRY(void, glClearDepthfOES, GLclampf depth) +GL_ENTRY(void, glClearDepthx, GLclampx depth) +GL_ENTRY(void, glClearDepthxOES, GLclampx depth) +GL_ENTRY(void, glClearStencil, GLint s) +GL_ENTRY(void, glClientActiveTexture, GLenum texture) +GL_ENTRY(void, glClipPlanef, GLenum plane, const GLfloat *equation) +GL_ENTRY(void, glClipPlanefOES, GLenum plane, const GLfloat *equation) +GL_ENTRY(void, glClipPlanex, GLenum plane, const GLfixed *equation) +GL_ENTRY(void, glClipPlanexOES, GLenum plane, const GLfixed *equation) +GL_ENTRY(void, glColor4f, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) +GL_ENTRY(void, glColor4ub, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) +GL_ENTRY(void, glColor4x, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) +GL_ENTRY(void, glColor4xOES, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) +GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) +GL_ENTRY(void, glColorPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) +GL_ENTRY(void, glCompileShader, GLuint shader) +GL_ENTRY(void, glCompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) +GL_ENTRY(void, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) +GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) +GL_ENTRY(void, glCompressedTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) +GL_ENTRY(void, glCopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) +GL_ENTRY(void, glCopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) +GL_ENTRY(void, glCopyTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) +GL_ENTRY(GLuint, glCreateProgram, void) +GL_ENTRY(GLuint, glCreateShader, GLenum type) +GL_ENTRY(void, glCullFace, GLenum mode) +GL_ENTRY(void, glCurrentPaletteMatrixOES, GLuint matrixpaletteindex) +GL_ENTRY(void, glDeleteBuffers, GLsizei n, const GLuint *buffers) +GL_ENTRY(void, glDeleteFencesNV, GLsizei n, const GLuint *fences) +GL_ENTRY(void, glDeleteFramebuffers, GLsizei n, const GLuint* framebuffers) +GL_ENTRY(void, glDeleteFramebuffersOES, GLsizei n, const GLuint* framebuffers) +GL_ENTRY(void, glDeletePerfMonitorsAMD, GLsizei n, GLuint *monitors) +GL_ENTRY(void, glDeleteProgram, GLuint program) +GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers) +GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers) +GL_ENTRY(void, glDeleteShader, GLuint shader) +GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint *textures) +GL_ENTRY(void, glDepthFunc, GLenum func) +GL_ENTRY(void, glDepthMask, GLboolean flag) +GL_ENTRY(void, glDepthRangef, GLclampf zNear, GLclampf zFar) +GL_ENTRY(void, glDepthRangefOES, GLclampf zNear, GLclampf zFar) +GL_ENTRY(void, glDepthRangex, GLclampx zNear, GLclampx zFar) +GL_ENTRY(void, glDepthRangexOES, GLclampx zNear, GLclampx zFar) +GL_ENTRY(void, glDetachShader, GLuint program, GLuint shader) +GL_ENTRY(void, glDisable, GLenum cap) +GL_ENTRY(void, glDisableClientState, GLenum array) +GL_ENTRY(void, glDisableDriverControlQCOM, GLuint driverControl) +GL_ENTRY(void, glDisableVertexAttribArray, GLuint index) +GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count) +GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) +GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) +GL_ENTRY(void, glDrawTexfvOES, const GLfloat *coords) +GL_ENTRY(void, glDrawTexiOES, GLint x, GLint y, GLint z, GLint width, GLint height) +GL_ENTRY(void, glDrawTexivOES, const GLint *coords) +GL_ENTRY(void, glDrawTexsOES, GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) +GL_ENTRY(void, glDrawTexsvOES, const GLshort *coords) +GL_ENTRY(void, glDrawTexxOES, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) +GL_ENTRY(void, glDrawTexxvOES, const GLfixed *coords) +GL_ENTRY(void, glEGLImageTargetRenderbufferStorageOES, GLenum target, GLeglImageOES image) +GL_ENTRY(void, glEGLImageTargetTexture2DOES, GLenum target, GLeglImageOES image) +GL_ENTRY(void, glEnable, GLenum cap) +GL_ENTRY(void, glEnableClientState, GLenum array) +GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl) +GL_ENTRY(void, glEnableVertexAttribArray, GLuint index) +GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor) +GL_ENTRY(void, glFinish, void) +GL_ENTRY(void, glFinishFenceNV, GLuint fence) +GL_ENTRY(void, glFlush, void) +GL_ENTRY(void, glFogf, GLenum pname, GLfloat param) +GL_ENTRY(void, glFogfv, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glFogx, GLenum pname, GLfixed param) +GL_ENTRY(void, glFogxOES, GLenum pname, GLfixed param) +GL_ENTRY(void, glFogxv, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glFogxvOES, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) +GL_ENTRY(void, glFrontFace, GLenum mode) +GL_ENTRY(void, glFrustumf, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) +GL_ENTRY(void, glFrustumfOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) +GL_ENTRY(void, glFrustumx, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) +GL_ENTRY(void, glFrustumxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) +GL_ENTRY(void, glGenBuffers, GLsizei n, GLuint *buffers) +GL_ENTRY(void, glGenFencesNV, GLsizei n, GLuint *fences) +GL_ENTRY(void, glGenFramebuffers, GLsizei n, GLuint* framebuffers) +GL_ENTRY(void, glGenFramebuffersOES, GLsizei n, GLuint* framebuffers) +GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors) +GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers) +GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers) +GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures) +GL_ENTRY(void, glGenerateMipmap, GLenum target) +GL_ENTRY(void, glGenerateMipmapOES, GLenum target) +GL_ENTRY(void, glGetActiveAttrib, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) +GL_ENTRY(void, glGetActiveUniform, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) +GL_ENTRY(void, glGetAttachedShaders, GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) +GL_ENTRY(int, glGetAttribLocation, GLuint program, const char* name) +GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean *params) +GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint *params) +GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, void** params) +GL_ENTRY(void, glGetClipPlanef, GLenum pname, GLfloat eqn[4]) +GL_ENTRY(void, glGetClipPlanefOES, GLenum pname, GLfloat eqn[4]) +GL_ENTRY(void, glGetClipPlanex, GLenum pname, GLfixed eqn[4]) +GL_ENTRY(void, glGetClipPlanexOES, GLenum pname, GLfixed eqn[4]) +GL_ENTRY(void, glGetDriverControlStringQCOM, GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString) +GL_ENTRY(void, glGetDriverControlsQCOM, GLint *num, GLsizei size, GLuint *driverControls) +GL_ENTRY(GLenum, glGetError, void) +GL_ENTRY(void, glGetFenceivNV, GLuint fence, GLenum pname, GLint *params) +GL_ENTRY(void, glGetFixedv, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetFixedvOES, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetFloatv, GLenum pname, GLfloat *params) +GL_ENTRY(void, glGetFramebufferAttachmentParameteriv, GLenum target, GLenum attachment, GLenum pname, GLint* params) +GL_ENTRY(void, glGetFramebufferAttachmentParameterivOES, GLenum target, GLenum attachment, GLenum pname, GLint* params) +GL_ENTRY(void, glGetIntegerv, GLenum pname, GLint *params) +GL_ENTRY(void, glGetLightfv, GLenum light, GLenum pname, GLfloat *params) +GL_ENTRY(void, glGetLightxv, GLenum light, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetLightxvOES, GLenum light, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params) +GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) +GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, void *data) +GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString) +GL_ENTRY(void, glGetPerfMonitorCountersAMD, GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) +GL_ENTRY(void, glGetPerfMonitorGroupStringAMD, GLuint group, GLsizei bufSize, GLsizei *length, char *groupString) +GL_ENTRY(void, glGetPerfMonitorGroupsAMD, GLint *numGroups, GLsizei groupsSize, GLuint *groups) +GL_ENTRY(void, glGetPointerv, GLenum pname, void **params) +GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) +GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) +GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params) +GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params) +GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params) +GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) +GL_ENTRY(void, glGetShaderPrecisionFormat, GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) +GL_ENTRY(void, glGetShaderSource, GLuint shader, GLsizei bufsize, GLsizei* length, char* source) +GL_ENTRY(void, glGetShaderiv, GLuint shader, GLenum pname, GLint* params) +GL_ENTRY(const GLubyte *, glGetString, GLenum name) +GL_ENTRY(void, glGetTexEnvfv, GLenum env, GLenum pname, GLfloat *params) +GL_ENTRY(void, glGetTexEnviv, GLenum env, GLenum pname, GLint *params) +GL_ENTRY(void, glGetTexEnvxv, GLenum env, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetTexEnvxvOES, GLenum env, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetTexGenfvOES, GLenum coord, GLenum pname, GLfloat *params) +GL_ENTRY(void, glGetTexGenivOES, GLenum coord, GLenum pname, GLint *params) +GL_ENTRY(void, glGetTexGenxvOES, GLenum coord, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat *params) +GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint *params) +GL_ENTRY(void, glGetTexParameterxv, GLenum target, GLenum pname, GLfixed *params) +GL_ENTRY(void, glGetTexParameterxvOES, GLenum target, GLenum pname, GLfixed *params) +GL_ENTRY(int, glGetUniformLocation, GLuint program, const char* name) +GL_ENTRY(void, glGetUniformfv, GLuint program, GLint location, GLfloat* params) +GL_ENTRY(void, glGetUniformiv, GLuint program, GLint location, GLint* params) +GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, void** pointer) +GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params) +GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params) +GL_ENTRY(void, glHint, GLenum target, GLenum mode) +GL_ENTRY(GLboolean, glIsBuffer, GLuint buffer) +GL_ENTRY(GLboolean, glIsEnabled, GLenum cap) +GL_ENTRY(GLboolean, glIsFenceNV, GLuint fence) +GL_ENTRY(GLboolean, glIsFramebuffer, GLuint framebuffer) +GL_ENTRY(GLboolean, glIsFramebufferOES, GLuint framebuffer) +GL_ENTRY(GLboolean, glIsProgram, GLuint program) +GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer) +GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer) +GL_ENTRY(GLboolean, glIsShader, GLuint shader) +GL_ENTRY(GLboolean, glIsTexture, GLuint texture) +GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param) +GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param) +GL_ENTRY(void, glLightModelxOES, GLenum pname, GLfixed param) +GL_ENTRY(void, glLightModelxv, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glLightModelxvOES, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glLightf, GLenum light, GLenum pname, GLfloat param) +GL_ENTRY(void, glLightfv, GLenum light, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glLightx, GLenum light, GLenum pname, GLfixed param) +GL_ENTRY(void, glLightxOES, GLenum light, GLenum pname, GLfixed param) +GL_ENTRY(void, glLightxv, GLenum light, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glLightxvOES, GLenum light, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glLineWidth, GLfloat width) +GL_ENTRY(void, glLineWidthx, GLfixed width) +GL_ENTRY(void, glLineWidthxOES, GLfixed width) +GL_ENTRY(void, glLinkProgram, GLuint program) +GL_ENTRY(void, glLoadIdentity, void) +GL_ENTRY(void, glLoadMatrixf, const GLfloat *m) +GL_ENTRY(void, glLoadMatrixx, const GLfixed *m) +GL_ENTRY(void, glLoadMatrixxOES, const GLfixed *m) +GL_ENTRY(void, glLoadPaletteFromModelViewMatrixOES, void) +GL_ENTRY(void, glLogicOp, GLenum opcode) +GL_ENTRY(void*, glMapBufferOES, GLenum target, GLenum access) +GL_ENTRY(void, glMaterialf, GLenum face, GLenum pname, GLfloat param) +GL_ENTRY(void, glMaterialfv, GLenum face, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glMaterialx, GLenum face, GLenum pname, GLfixed param) +GL_ENTRY(void, glMaterialxOES, GLenum face, GLenum pname, GLfixed param) +GL_ENTRY(void, glMaterialxv, GLenum face, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glMaterialxvOES, GLenum face, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glMatrixIndexPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) +GL_ENTRY(void, glMatrixMode, GLenum mode) +GL_ENTRY(void, glMultMatrixf, const GLfloat *m) +GL_ENTRY(void, glMultMatrixx, const GLfixed *m) +GL_ENTRY(void, glMultMatrixxOES, const GLfixed *m) +GL_ENTRY(void, glMultiTexCoord4f, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) +GL_ENTRY(void, glMultiTexCoord4x, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) +GL_ENTRY(void, glMultiTexCoord4xOES, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) +GL_ENTRY(void, glNormal3f, GLfloat nx, GLfloat ny, GLfloat nz) +GL_ENTRY(void, glNormal3x, GLfixed nx, GLfixed ny, GLfixed nz) +GL_ENTRY(void, glNormal3xOES, GLfixed nx, GLfixed ny, GLfixed nz) +GL_ENTRY(void, glNormalPointer, GLenum type, GLsizei stride, const GLvoid *pointer) +GL_ENTRY(void, glOrthof, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) +GL_ENTRY(void, glOrthofOES, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) +GL_ENTRY(void, glOrthox, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) +GL_ENTRY(void, glOrthoxOES, GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) +GL_ENTRY(void, glPixelStorei, GLenum pname, GLint param) +GL_ENTRY(void, glPointParameterf, GLenum pname, GLfloat param) +GL_ENTRY(void, glPointParameterfv, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glPointParameterx, GLenum pname, GLfixed param) +GL_ENTRY(void, glPointParameterxOES, GLenum pname, GLfixed param) +GL_ENTRY(void, glPointParameterxv, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glPointParameterxvOES, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glPointSize, GLfloat size) +GL_ENTRY(void, glPointSizePointerOES, GLenum type, GLsizei stride, const GLvoid *pointer) +GL_ENTRY(void, glPointSizex, GLfixed size) +GL_ENTRY(void, glPointSizexOES, GLfixed size) +GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units) +GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units) +GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units) +GL_ENTRY(void, glPopMatrix, void) +GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const void *binary, GLint length) +GL_ENTRY(void, glPushMatrix, void) +GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16]) +GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) +GL_ENTRY(void, glReleaseShaderCompiler, void) +GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) +GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) +GL_ENTRY(void, glRotatexOES, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) +GL_ENTRY(void, glSampleCoverage, GLclampf value, GLboolean invert) +GL_ENTRY(void, glSampleCoveragex, GLclampx value, GLboolean invert) +GL_ENTRY(void, glSampleCoveragexOES, GLclampx value, GLboolean invert) +GL_ENTRY(void, glScalef, GLfloat x, GLfloat y, GLfloat z) +GL_ENTRY(void, glScalex, GLfixed x, GLfixed y, GLfixed z) +GL_ENTRY(void, glScalexOES, GLfixed x, GLfixed y, GLfixed z) +GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height) +GL_ENTRY(void, glSelectPerfMonitorCountersAMD, GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) +GL_ENTRY(void, glSetFenceNV, GLuint fence, GLenum condition) +GL_ENTRY(void, glShadeModel, GLenum mode) +GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) +GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const char** string, const GLint* length) +GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask) +GL_ENTRY(void, glStencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask) +GL_ENTRY(void, glStencilMask, GLuint mask) +GL_ENTRY(void, glStencilMaskSeparate, GLenum face, GLuint mask) +GL_ENTRY(void, glStencilOp, GLenum fail, GLenum zfail, GLenum zpass) +GL_ENTRY(void, glStencilOpSeparate, GLenum face, GLenum fail, GLenum zfail, GLenum zpass) +GL_ENTRY(GLboolean, glTestFenceNV, GLuint fence) +GL_ENTRY(void, glTexCoordPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) +GL_ENTRY(void, glTexEnvf, GLenum target, GLenum pname, GLfloat param) +GL_ENTRY(void, glTexEnvfv, GLenum target, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glTexEnvi, GLenum target, GLenum pname, GLint param) +GL_ENTRY(void, glTexEnviv, GLenum target, GLenum pname, const GLint *params) +GL_ENTRY(void, glTexEnvx, GLenum target, GLenum pname, GLfixed param) +GL_ENTRY(void, glTexEnvxOES, GLenum target, GLenum pname, GLfixed param) +GL_ENTRY(void, glTexEnvxv, GLenum target, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glTexEnvxvOES, GLenum target, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glTexGenfOES, GLenum coord, GLenum pname, GLfloat param) +GL_ENTRY(void, glTexGenfvOES, GLenum coord, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glTexGeniOES, GLenum coord, GLenum pname, GLint param) +GL_ENTRY(void, glTexGenivOES, GLenum coord, GLenum pname, const GLint *params) +GL_ENTRY(void, glTexGenxOES, GLenum coord, GLenum pname, GLfixed param) +GL_ENTRY(void, glTexGenxvOES, GLenum coord, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) +GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) +GL_ENTRY(void, glTexParameterf, GLenum target, GLenum pname, GLfloat param) +GL_ENTRY(void, glTexParameterfv, GLenum target, GLenum pname, const GLfloat *params) +GL_ENTRY(void, glTexParameteri, GLenum target, GLenum pname, GLint param) +GL_ENTRY(void, glTexParameteriv, GLenum target, GLenum pname, const GLint *params) +GL_ENTRY(void, glTexParameterx, GLenum target, GLenum pname, GLfixed param) +GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param) +GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params) +GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) +GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) +GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z) +GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z) +GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z) +GL_ENTRY(void, glUniform1f, GLint location, GLfloat x) +GL_ENTRY(void, glUniform1fv, GLint location, GLsizei count, const GLfloat* v) +GL_ENTRY(void, glUniform1i, GLint location, GLint x) +GL_ENTRY(void, glUniform1iv, GLint location, GLsizei count, const GLint* v) +GL_ENTRY(void, glUniform2f, GLint location, GLfloat x, GLfloat y) +GL_ENTRY(void, glUniform2fv, GLint location, GLsizei count, const GLfloat* v) +GL_ENTRY(void, glUniform2i, GLint location, GLint x, GLint y) +GL_ENTRY(void, glUniform2iv, GLint location, GLsizei count, const GLint* v) +GL_ENTRY(void, glUniform3f, GLint location, GLfloat x, GLfloat y, GLfloat z) +GL_ENTRY(void, glUniform3fv, GLint location, GLsizei count, const GLfloat* v) +GL_ENTRY(void, glUniform3i, GLint location, GLint x, GLint y, GLint z) +GL_ENTRY(void, glUniform3iv, GLint location, GLsizei count, const GLint* v) +GL_ENTRY(void, glUniform4f, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +GL_ENTRY(void, glUniform4fv, GLint location, GLsizei count, const GLfloat* v) +GL_ENTRY(void, glUniform4i, GLint location, GLint x, GLint y, GLint z, GLint w) +GL_ENTRY(void, glUniform4iv, GLint location, GLsizei count, const GLint* v) +GL_ENTRY(void, glUniformMatrix2fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) +GL_ENTRY(void, glUniformMatrix3fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) +GL_ENTRY(void, glUniformMatrix4fv, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) +GL_ENTRY(GLboolean, glUnmapBufferOES, GLenum target) +GL_ENTRY(void, glUseProgram, GLuint program) +GL_ENTRY(void, glValidateProgram, GLuint program) +GL_ENTRY(void, glVertexAttrib1f, GLuint indx, GLfloat x) +GL_ENTRY(void, glVertexAttrib1fv, GLuint indx, const GLfloat* values) +GL_ENTRY(void, glVertexAttrib2f, GLuint indx, GLfloat x, GLfloat y) +GL_ENTRY(void, glVertexAttrib2fv, GLuint indx, const GLfloat* values) +GL_ENTRY(void, glVertexAttrib3f, GLuint indx, GLfloat x, GLfloat y, GLfloat z) +GL_ENTRY(void, glVertexAttrib3fv, GLuint indx, const GLfloat* values) +GL_ENTRY(void, glVertexAttrib4f, GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +GL_ENTRY(void, glVertexAttrib4fv, GLuint indx, const GLfloat* values) +GL_ENTRY(void, glVertexAttribPointer, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) +GL_ENTRY(void, glVertexPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) +GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height) +GL_ENTRY(void, glWeightPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) diff --git a/opengl/libs/hooks.h b/opengl/libs/hooks.h index 8c0357e..f47f093 100644 --- a/opengl/libs/hooks.h +++ b/opengl/libs/hooks.h @@ -60,11 +60,14 @@ const unsigned int NUM_DISPLAYS = 1; enum { IMPL_HARDWARE = 0, IMPL_SOFTWARE, - IMPL_NUM_DRIVERS_IMPLEMENTATIONS, - IMPL_NO_CONTEXT = IMPL_NUM_DRIVERS_IMPLEMENTATIONS, IMPL_NUM_IMPLEMENTATIONS }; +enum { + GLESv1_INDEX = 0, + GLESv2_INDEX = 1, +}; + // ---------------------------------------------------------------------------- // GL / EGL hooks @@ -74,18 +77,14 @@ enum { #define GL_ENTRY(_r, _api, ...) _r (*_api)(__VA_ARGS__); #define EGL_ENTRY(_r, _api, ...) _r (*_api)(__VA_ARGS__); +struct egl_t { + #include "EGL/egl_entries.in" +}; + struct gl_hooks_t { struct gl_t { - #include "GLES_CM/gl_entries.in" - #include "GLES_CM/glext_entries.in" + #include "entries.in" } gl; - struct gl2_t { - #include "GLES2/gl2_entries.in" - #include "GLES2/gl2ext_entries.in" - } gl2; - struct egl_t { - #include "EGL/egl_entries.in" - } egl; struct gl_ext_t { void (*extensions[MAX_NUMBER_OF_GL_EXTENSIONS])(void); } ext; @@ -96,12 +95,12 @@ struct gl_hooks_t { // ---------------------------------------------------------------------------- -extern gl_hooks_t gHooks[IMPL_NUM_IMPLEMENTATIONS]; +extern gl_hooks_t gHooks[2][IMPL_NUM_IMPLEMENTATIONS]; +extern gl_hooks_t gHooksNoContext; extern pthread_key_t gGLWrapperKey; extern "C" void gl_unimplemented(); extern char const * const gl_names[]; -extern char const * const gl2_names[]; extern char const * const egl_names[]; // ---------------------------------------------------------------------------- @@ -125,7 +124,7 @@ static gl_hooks_t const* getGlThreadSpecific() { gl_hooks_t const * volatile * tls_hooks = get_tls_hooks(); gl_hooks_t const* hooks = tls_hooks[TLS_SLOT_OPENGL_API]; if (hooks) return hooks; - return &gHooks[IMPL_NO_CONTEXT]; + return &gHooksNoContext; } #else @@ -137,7 +136,7 @@ static inline void setGlThreadSpecific(gl_hooks_t const *value) { static gl_hooks_t const* getGlThreadSpecific() { gl_hooks_t const* hooks = static_cast<gl_hooks_t*>(pthread_getspecific(gGLWrapperKey)); if (hooks) return hooks; - return &gHooks[IMPL_NO_CONTEXT]; + return &gHooksNoContext; } #endif diff --git a/opengl/libs/tools/genfiles b/opengl/libs/tools/genfiles index 4f8eda4..120cb4b 100755 --- a/opengl/libs/tools/genfiles +++ b/opengl/libs/tools/genfiles @@ -14,14 +14,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -./glapigen ../../include/GLES/gl.h > ../GLES_CM/gl_api.in -./glentrygen ../../include/GLES/gl.h > ../GLES_CM/gl_entries.in +./glapigen ../../include/GLES/gl.h > ../GLES_CM/gl_api.in +./glapigen ../../include/GLES/glext.h > ../GLES_CM/glext_api.in +./glapigen ../../include/GLES2/gl2.h > ../GLES2/gl2_api.in +./glapigen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_api.in -./glapigen ../../include/GLES/glext.h > ../GLES_CM/glext_api.in -./glentrygen ../../include/GLES/glext.h > ../GLES_CM/glext_entries.in +./glentrygen ../../include/GLES/gl.h > /tmp/gl_entries.in +./glentrygen ../../include/GLES/glext.h > /tmp/glext_entries.in +./glentrygen ../../include/GLES2/gl2.h > /tmp/gl2_entries.in +./glentrygen ../../include/GLES2/gl2ext.h > /tmp/gl2ext_entries.in -./glapigen ../../include/GLES2/gl2.h > ../GLES2/gl2_api.in -./glentrygen ../../include/GLES2/gl2.h > ../GLES2/gl2_entries.in - -./glapigen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_api.in -./glentrygen ../../include/GLES2/gl2ext.h > ../GLES2/gl2ext_entries.in +cat /tmp/gl_entries.in \ + /tmp/glext_entries.in \ + /tmp/gl2_entries.in \ + /tmp/gl2ext_entries.in \ + | sort -t, -k2 \ + | awk -F, '!_[$2]++' \ + > ../entries.in diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java index 3b91a38..153a5ea 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java @@ -45,7 +45,6 @@ public class SettingsHelper { private boolean mSilent; private boolean mVibrate; - private boolean mHasAutoBrightness; public SettingsHelper(Context context) { mContext = context; @@ -54,9 +53,6 @@ public class SettingsHelper { mContentService = ContentResolver.getContentService(); mPowerManager = IPowerManager.Stub.asInterface( ServiceManager.getService("power")); - - mHasAutoBrightness = context.getResources().getBoolean( - com.android.internal.R.bool.config_automatic_brightness_available); } /** @@ -71,18 +67,6 @@ public class SettingsHelper { public boolean restoreValue(String name, String value) { if (Settings.System.SCREEN_BRIGHTNESS.equals(name)) { setBrightness(Integer.parseInt(value)); - } else if (Settings.System.SCREEN_BRIGHTNESS_MODE.equals(name)) { - if (mHasAutoBrightness) { - // When setting auto-brightness, must reset the brightness afterwards - try { - int curBrightness = Settings.System.getInt(mContext.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS); - setAutoBrightness(Integer.parseInt(value) != 0); - setBrightness(curBrightness); - } catch (Settings.SettingNotFoundException e) { - // no brightness setting at all? weird. skip this then. - } - } } else if (Settings.System.SOUND_EFFECTS_ENABLED.equals(name)) { setSoundEffects(Integer.parseInt(value) == 1); } else if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name)) { @@ -92,16 +76,6 @@ public class SettingsHelper { return true; } - private void setAutoBrightness(boolean value) { - if (mPowerManager != null) { - try { - mPowerManager.setAutoBrightness(value); - } catch (RemoteException e) { - // unable to reach the power manager; skip - } - } - } - private void setGpsLocation(String value) { final String GPS = LocationManager.GPS_PROVIDER; boolean enabled = diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 6289d4f..66e7ecd 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -872,6 +872,10 @@ class PackageManagerService extends IPackageManager.Stub { } PackageInfo generatePackageInfo(PackageParser.Package p, int flags) { + if ((flags & PackageManager.GET_UNINSTALLED_PACKAGES) != 0) { + // The package has been uninstalled but has retained data and resources. + return PackageParser.generatePackageInfo(p, null, flags); + } final PackageSetting ps = (PackageSetting)p.mExtras; if (ps == null) { return null; diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index e1bea37..99e008c 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -53,6 +53,7 @@ import android.view.WindowManagerPolicy; import static android.provider.Settings.System.DIM_SCREEN; import static android.provider.Settings.System.SCREEN_BRIGHTNESS; import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE; +import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC; import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT; import static android.provider.Settings.System.STAY_ON_WHILE_PLUGGED_IN; @@ -64,7 +65,7 @@ import java.util.Observable; import java.util.Observer; class PowerManagerService extends IPowerManager.Stub - implements LocalPowerManager, Watchdog.Monitor, SensorEventListener { + implements LocalPowerManager, Watchdog.Monitor { private static final String TAG = "PowerManagerService"; static final String PARTIAL_NAME = "PowerManagerService"; @@ -189,6 +190,9 @@ class PowerManagerService extends IPowerManager.Stub private BatteryService mBatteryService; private SensorManager mSensorManager; private Sensor mProximitySensor; + private Sensor mLightSensor; + private boolean mLightSensorEnabled; + private float mLightSensorValue = -1; private boolean mDimScreen = true; private long mNextTimeout; private volatile int mPokey = 0; @@ -199,6 +203,8 @@ class PowerManagerService extends IPowerManager.Stub private long mScreenOnStartTime; private boolean mPreventScreenOn; private int mScreenBrightnessOverride = -1; + private boolean mHasHardwareAutoBrightness; + private boolean mAutoBrightessEnabled; // Used when logging number and duration of touch-down cycles private long mTotalTouchDownTime; @@ -207,6 +213,7 @@ class PowerManagerService extends IPowerManager.Stub // could be either static or controllable at runtime private static final boolean mSpew = false; + private static final boolean mDebugLightSensor = false; /* static PrintStream mLog; @@ -344,6 +351,9 @@ class PowerManagerService extends IPowerManager.Stub // DIM_SCREEN //mDimScreen = getInt(DIM_SCREEN) != 0; + // SCREEN_BRIGHTNESS_MODE + setScreenBrightnessMode(getInt(SCREEN_BRIGHTNESS_MODE)); + // recalculate everything setScreenOffTimeoutsLocked(); } @@ -415,12 +425,17 @@ class PowerManagerService extends IPowerManager.Stub mScreenOffIntent = new Intent(Intent.ACTION_SCREEN_OFF); mScreenOffIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); - ContentResolver resolver = mContext.getContentResolver(); + mHasHardwareAutoBrightness = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_hardware_automatic_brightness_available); + + ContentResolver resolver = mContext.getContentResolver(); Cursor settingsCursor = resolver.query(Settings.System.CONTENT_URI, null, "(" + Settings.System.NAME + "=?) or (" + Settings.System.NAME + "=?) or (" + + Settings.System.NAME + "=?) or (" + Settings.System.NAME + "=?)", - new String[]{STAY_ON_WHILE_PLUGGED_IN, SCREEN_OFF_TIMEOUT, DIM_SCREEN}, + new String[]{STAY_ON_WHILE_PLUGGED_IN, SCREEN_OFF_TIMEOUT, DIM_SCREEN, + SCREEN_BRIGHTNESS_MODE}, null); mSettings = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, mHandler); SettingsObserver settingsObserver = new SettingsObserver(); @@ -444,10 +459,6 @@ class PowerManagerService extends IPowerManager.Stub // turn everything on setPowerState(ALL_BRIGHT); - // set auto brightness mode to user setting - boolean brightnessMode = Settings.System.getInt(resolver, SCREEN_BRIGHTNESS_MODE, 1) != 0; - mHardware.setAutoBrightness_UNCHECKED(brightnessMode); - synchronized (mHandlerThread) { mInitComplete = true; mHandlerThread.notifyAll(); @@ -1164,7 +1175,7 @@ class PowerManagerService extends IPowerManager.Stub // Finally, set the flag that prevents the screen from turning on. // (Below, in setPowerState(), we'll check mPreventScreenOn and - // we *won't* call Power.setScreenState(true) if it's set.) + // we *won't* call setScreenStateLocked(true) if it's set.) mPreventScreenOn = true; } else { // (Re)enable the screen. @@ -1182,9 +1193,9 @@ class PowerManagerService extends IPowerManager.Stub Log.d(TAG, "preventScreenOn: turning on after a prior preventScreenOn(true)!"); } - int err = Power.setScreenState(true); + int err = setScreenStateLocked(true); if (err != 0) { - Log.w(TAG, "preventScreenOn: error from Power.setScreenState(): " + err); + Log.w(TAG, "preventScreenOn: error from setScreenStateLocked(): " + err); } } @@ -1239,6 +1250,14 @@ class PowerManagerService extends IPowerManager.Stub } }; + private int setScreenStateLocked(boolean on) { + int err = Power.setScreenState(on); + if (err == 0) { + enableLightSensor(on && mAutoBrightessEnabled); + } + return err; + } + private void setPowerState(int state) { setPowerState(state, false, false); @@ -1327,7 +1346,7 @@ class PowerManagerService extends IPowerManager.Stub reallyTurnScreenOn = false; } if (reallyTurnScreenOn) { - err = Power.setScreenState(true); + err = setScreenStateLocked(true); long identity = Binder.clearCallingIdentity(); try { mBatteryStats.noteScreenBrightness( @@ -1339,7 +1358,7 @@ class PowerManagerService extends IPowerManager.Stub Binder.restoreCallingIdentity(identity); } } else { - Power.setScreenState(false); + setScreenStateLocked(false); // But continue as if we really did turn the screen on... err = 0; } @@ -1384,7 +1403,7 @@ class PowerManagerService extends IPowerManager.Stub EventLog.writeEvent(LOG_POWER_SCREEN_STATE, 0, becauseOfUser ? 1 : 0, mTotalTouchDownTime, mTouchCycles); mLastTouchDown = 0; - int err = Power.setScreenState(false); + int err = setScreenStateLocked(false); if (mScreenOnStartTime != 0) { mScreenOnTime += SystemClock.elapsedRealtime() - mScreenOnStartTime; mScreenOnStartTime = 0; @@ -1802,6 +1821,14 @@ class PowerManagerService extends IPowerManager.Stub } } + private void lightSensorChangedLocked(float value) { + if (mDebugLightSensor) { + Log.d(TAG, "lightSensorChangedLocked " + value); + } + mLightSensorValue = value; + // more to do here + } + /** * The user requested that we go to sleep (probably with the power button). * This overrides all wake locks that are held. @@ -1885,6 +1912,18 @@ class PowerManagerService extends IPowerManager.Stub } } + private void setScreenBrightnessMode(int mode) { + mAutoBrightessEnabled = (mode == SCREEN_BRIGHTNESS_MODE_AUTOMATIC); + + if (mHasHardwareAutoBrightness) { + // When setting auto-brightness, must reset the brightness afterwards + mHardware.setAutoBrightness_UNCHECKED(mAutoBrightessEnabled); + setBacklightBrightness((int)mScreenBrightness.curValue); + } else { + enableLightSensor(screenIsOn() && mAutoBrightessEnabled); + } + } + /** Sets the screen off timeouts: * mKeylightDelay * mDimDelay @@ -2031,6 +2070,14 @@ class PowerManagerService extends IPowerManager.Stub } void systemReady() { + mSensorManager = new SensorManager(mHandlerThread.getLooper()); + mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); + // don't bother with the light sensor if auto brightness is handled in hardware + if (!mHasHardwareAutoBrightness) { + mLightSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); + enableLightSensor(mAutoBrightessEnabled); + } + synchronized (mLocks) { Log.d(TAG, "system ready!"); mDoneBooting = true; @@ -2058,8 +2105,6 @@ class PowerManagerService extends IPowerManager.Stub | PowerManager.FULL_WAKE_LOCK | PowerManager.SCREEN_DIM_WAKE_LOCK; - // call getSensorManager() to make sure mProximitySensor is initialized - getSensorManager(); if (mProximitySensor != null) { result |= PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK; } @@ -2098,31 +2143,19 @@ class PowerManagerService extends IPowerManager.Stub } } - public void setAutoBrightness(boolean on) { - mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null); - mHardware.setAutoBrightness_UNCHECKED(on); - } - - private SensorManager getSensorManager() { - if (mSensorManager == null) { - mSensorManager = new SensorManager(mHandlerThread.getLooper()); - mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); - } - return mSensorManager; - } - private void enableProximityLockLocked() { if (mSpew) { Log.d(TAG, "enableProximityLockLocked"); } - mSensorManager.registerListener(this, mProximitySensor, SensorManager.SENSOR_DELAY_NORMAL); + mSensorManager.registerListener(mProximityListener, mProximitySensor, + SensorManager.SENSOR_DELAY_NORMAL); } private void disableProximityLockLocked() { if (mSpew) { Log.d(TAG, "disableProximityLockLocked"); } - mSensorManager.unregisterListener(this); + mSensorManager.unregisterListener(mProximityListener); synchronized (mLocks) { if (mProximitySensorActive) { mProximitySensorActive = false; @@ -2131,32 +2164,65 @@ class PowerManagerService extends IPowerManager.Stub } } - public void onSensorChanged(SensorEvent event) { - long milliseconds = event.timestamp / 1000000; - synchronized (mLocks) { - float distance = event.values[0]; - // compare against getMaximumRange to support sensors that only return 0 or 1 - if (distance >= 0.0 && distance < PROXIMITY_THRESHOLD && - distance < mProximitySensor.getMaximumRange()) { - if (mSpew) { - Log.d(TAG, "onSensorChanged: proximity active, distance: " + distance); - } - goToSleepLocked(milliseconds); - mProximitySensorActive = true; + private void enableLightSensor(boolean enable) { + if (mDebugLightSensor) { + Log.d(TAG, "enableLightSensor " + enable); + } + if (mSensorManager != null && mLightSensorEnabled != enable) { + mLightSensorEnabled = enable; + if (enable) { + mSensorManager.registerListener(mLightListener, mLightSensor, + SensorManager.SENSOR_DELAY_NORMAL); } else { - // proximity sensor negative events trigger as user activity. - // temporarily set mUserActivityAllowed to true so this will work - // even when the keyguard is on. - if (mSpew) { - Log.d(TAG, "onSensorChanged: proximity inactive, distance: " + distance); - } - mProximitySensorActive = false; - forceUserActivityLocked(); + mSensorManager.unregisterListener(mLightListener); } } } - public void onAccuracyChanged(Sensor sensor, int accuracy) { - // ignore - } + SensorEventListener mProximityListener = new SensorEventListener() { + public void onSensorChanged(SensorEvent event) { + long milliseconds = event.timestamp / 1000000; + synchronized (mLocks) { + float distance = event.values[0]; + // compare against getMaximumRange to support sensors that only return 0 or 1 + if (distance >= 0.0 && distance < PROXIMITY_THRESHOLD && + distance < mProximitySensor.getMaximumRange()) { + if (mSpew) { + Log.d(TAG, "onSensorChanged: proximity active, distance: " + distance); + } + goToSleepLocked(milliseconds); + mProximitySensorActive = true; + } else { + // proximity sensor negative events trigger as user activity. + // temporarily set mUserActivityAllowed to true so this will work + // even when the keyguard is on. + if (mSpew) { + Log.d(TAG, "onSensorChanged: proximity inactive, distance: " + distance); + } + mProximitySensorActive = false; + forceUserActivityLocked(); + } + } + } + + public void onAccuracyChanged(Sensor sensor, int accuracy) { + // ignore + } + }; + + SensorEventListener mLightListener = new SensorEventListener() { + public void onSensorChanged(SensorEvent event) { + synchronized (mLocks) { + int value = (int)event.values[0]; + if (mDebugLightSensor) { + Log.d(TAG, "onSensorChanged: light value: " + value); + } + lightSensorChangedLocked(value); + } + } + + public void onAccuracyChanged(Sensor sensor, int accuracy) { + // ignore + } + }; } diff --git a/services/java/com/android/server/status/StatusBarService.java b/services/java/com/android/server/status/StatusBarService.java index fe761ea..59e9832 100644 --- a/services/java/com/android/server/status/StatusBarService.java +++ b/services/java/com/android/server/status/StatusBarService.java @@ -140,7 +140,7 @@ public class StatusBarService extends IStatusBar.Stub boolean down = event.getAction() == KeyEvent.ACTION_DOWN; switch (event.getKeyCode()) { case KeyEvent.KEYCODE_BACK: - if (down) { + if (!down) { StatusBarService.this.deactivate(); } return true; @@ -973,15 +973,24 @@ public class StatusBarService extends IStatusBar.Stub } void animateCollapse() { - if (SPEW) Log.d(TAG, "Animate collapse: expanded=" + mExpanded - + " expanded visible=" + mExpandedVisible); + if (SPEW) { + Log.d(TAG, "animateCollapse(): mExpanded=" + mExpanded + + " mExpandedVisible=" + mExpandedVisible + + " mAnimating=" + mAnimating + + " mAnimVel=" + mAnimVel); + } if (!mExpandedVisible) { return; } - prepareTracking(mDisplay.getHeight()-1); - performFling(mDisplay.getHeight()-1, -2000.0f, true); + if (mAnimating) { + return; + } + + int y = mDisplay.getHeight()-1; + prepareTracking(y); + performFling(y, -2000.0f, true); } void performExpand() { @@ -1096,7 +1105,7 @@ public class StatusBarService extends IStatusBar.Stub mTracking = true; mVelocityTracker = VelocityTracker.obtain(); boolean opening = !mExpanded; - if (!mExpanded) { + if (opening) { mAnimAccel = 2000.0f; mAnimVel = 200; mAnimY = mStatusBarView.getHeight(); @@ -1111,16 +1120,13 @@ public class StatusBarService extends IStatusBar.Stub mAnimating = true; mHandler.sendMessageAtTime(mHandler.obtainMessage(MSG_ANIMATE_REVEAL), mCurAnimationTime); + makeExpandedVisible(); } else { // it's open, close it? if (mAnimating) { mAnimating = false; mHandler.removeMessages(MSG_ANIMATE); } - } - if (opening) { - makeExpandedVisible(); - } else { updateExpandedViewPos(y + mViewDelta); } } @@ -1547,7 +1553,7 @@ public class StatusBarService extends IStatusBar.Stub void updateExpandedViewPos(int expandedPosition) { if (SPEW) { - Log.d(TAG, "updateExpandedViewPos before pos=" + expandedPosition + Log.d(TAG, "updateExpandedViewPos before expandedPosition=" + expandedPosition + " mTrackingParams.y=" + mTrackingParams.y + " mTrackingPosition=" + mTrackingPosition); } |