diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/FontRenderer.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 7 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.h | 3 | ||||
-rw-r--r-- | libs/hwui/ProgramCache.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/ProgramCache.h | 2 | ||||
-rw-r--r-- | libs/hwui/Rect.h | 8 | ||||
-rw-r--r-- | libs/rs/RenderScript.h | 17 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 236 | ||||
-rw-r--r-- | libs/rs/rsContext.h | 8 | ||||
-rw-r--r-- | libs/rs/rsProgramStore.cpp | 19 | ||||
-rw-r--r-- | libs/storage/IMountService.cpp | 8 | ||||
-rw-r--r-- | libs/storage/IObbActionListener.cpp | 7 | ||||
-rw-r--r-- | libs/surfaceflinger_client/ISurfaceComposer.cpp | 15 | ||||
-rw-r--r-- | libs/ui/InputDispatcher.cpp | 16 |
14 files changed, 237 insertions, 117 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index 8389e56..1b21aee 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -482,9 +482,9 @@ void FontRenderer::initVertexArrayBuffers() { } glGenBuffers(1, &mIndexBufferID); - glBindBuffer(GL_ARRAY_BUFFER, mIndexBufferID); - glBufferData(GL_ARRAY_BUFFER, indexBufferSizeBytes, indexBufferData, GL_DYNAMIC_DRAW); - glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mIndexBufferID); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexBufferSizeBytes, indexBufferData, GL_STATIC_DRAW); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); free(indexBufferData); diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 92875b1..2876010 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -455,7 +455,7 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top, #endif // Clear the FBO - glScissor(0.0f, 0.0f, bounds.getWidth(), bounds.getHeight()); + glScissor(0.0f, 0.0f, bounds.getWidth() + 1.0f, bounds.getHeight() + 1.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); @@ -585,7 +585,10 @@ void OpenGLRenderer::setMatrix(SkMatrix* matrix) { } const float* OpenGLRenderer::getMatrix() const { - return &mSnapshot->transform->data[0]; + if (mSnapshot->fbo != 0) { + return &mSnapshot->transform->data[0]; + } + return &mIdentity.data[0]; } void OpenGLRenderer::getMatrix(SkMatrix* matrix) { diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index f8828e2..423614b 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -432,6 +432,9 @@ private: // Misc GLint mMaxTextureSize; + // Indentity matrix + const mat4 mIdentity; + friend class DisplayListRenderer; }; // class OpenGLRenderer diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index 1eac239..3cd85c8 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -417,7 +417,7 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti } // Optimization for common cases - if (!blendFramebuffer) { + if (!blendFramebuffer && description.colorOp == ProgramDescription::kColorNone) { bool fast = false; const bool noShader = !description.hasGradient && !description.hasBitmap; diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h index ec9851e..9cb13b3 100644 --- a/libs/hwui/ProgramCache.h +++ b/libs/hwui/ProgramCache.h @@ -135,7 +135,7 @@ struct ProgramDescription { GLenum bitmapWrapT; // Color operations - int colorOp; + ColorModifier colorOp; SkXfermode::Mode colorMode; // Framebuffer blending (requires Extensions.hasFramebufferFetch()) diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h index f03a602..c571ea1 100644 --- a/libs/hwui/Rect.h +++ b/libs/hwui/Rect.h @@ -149,10 +149,10 @@ struct Rect { } void snapToPixelBoundaries() { - left = floor(left); - top = floor(top); - right = ceil(right); - bottom = ceil(bottom); + left = floorf(left); + top = floorf(top); + right = ceilf(right); + bottom = ceilf(bottom); } void dump() const { diff --git a/libs/rs/RenderScript.h b/libs/rs/RenderScript.h index 66e27f3..da8edbe 100644 --- a/libs/rs/RenderScript.h +++ b/libs/rs/RenderScript.h @@ -55,12 +55,26 @@ enum RsDeviceParam { RS_DEVICE_PARAM_COUNT }; +typedef struct { + uint32_t colorMin; + uint32_t colorPref; + uint32_t alphaMin; + uint32_t alphaPref; + uint32_t depthMin; + uint32_t depthPref; + uint32_t stencilMin; + uint32_t stencilPref; + uint32_t samplesMin; + uint32_t samplesPref; + float samplesQ; +} RsSurfaceConfig; + RsDevice rsDeviceCreate(); void rsDeviceDestroy(RsDevice); void rsDeviceSetConfig(RsDevice, RsDeviceParam, int32_t value); RsContext rsContextCreate(RsDevice, uint32_t version); -RsContext rsContextCreateGL(RsDevice, uint32_t version, bool useDepth); +RsContext rsContextCreateGL(RsDevice, uint32_t version, RsSurfaceConfig sc); void rsContextDestroy(RsContext); uint32_t rsContextGetMessage(RsContext, void *data, size_t *receiveLen, size_t bufferLen, bool wait); @@ -270,6 +284,7 @@ typedef struct { } RsScriptCall; + #ifndef NO_RS_FUNCS #include "rsgApiFuncDecl.h" #endif diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 30add62..be8fb0e 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -18,6 +18,7 @@ #include "rsContext.h" #include "rsThreadIO.h" #include <ui/FramebufferNativeWindow.h> +#include <ui/PixelFormat.h> #include <ui/EGLUtils.h> #include <ui/egl/android_natives.h> @@ -56,8 +57,61 @@ static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) { } } -void Context::initEGL(bool useGL2) +void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) { + +#define X(VAL) {VAL, #VAL} + struct {EGLint attribute; const char* name;} names[] = { + X(EGL_BUFFER_SIZE), + X(EGL_ALPHA_SIZE), + X(EGL_BLUE_SIZE), + X(EGL_GREEN_SIZE), + X(EGL_RED_SIZE), + X(EGL_DEPTH_SIZE), + X(EGL_STENCIL_SIZE), + X(EGL_CONFIG_CAVEAT), + X(EGL_CONFIG_ID), + X(EGL_LEVEL), + X(EGL_MAX_PBUFFER_HEIGHT), + X(EGL_MAX_PBUFFER_PIXELS), + X(EGL_MAX_PBUFFER_WIDTH), + X(EGL_NATIVE_RENDERABLE), + X(EGL_NATIVE_VISUAL_ID), + X(EGL_NATIVE_VISUAL_TYPE), + X(EGL_SAMPLES), + X(EGL_SAMPLE_BUFFERS), + X(EGL_SURFACE_TYPE), + X(EGL_TRANSPARENT_TYPE), + X(EGL_TRANSPARENT_RED_VALUE), + X(EGL_TRANSPARENT_GREEN_VALUE), + X(EGL_TRANSPARENT_BLUE_VALUE), + X(EGL_BIND_TO_TEXTURE_RGB), + X(EGL_BIND_TO_TEXTURE_RGBA), + X(EGL_MIN_SWAP_INTERVAL), + X(EGL_MAX_SWAP_INTERVAL), + X(EGL_LUMINANCE_SIZE), + X(EGL_ALPHA_MASK_SIZE), + X(EGL_COLOR_BUFFER_TYPE), + X(EGL_RENDERABLE_TYPE), + X(EGL_CONFORMANT), + }; +#undef X + + for (size_t j = 0; j < sizeof(names) / sizeof(names[0]); j++) { + EGLint value = -1; + EGLint returnVal = eglGetConfigAttrib(dpy, config, names[j].attribute, &value); + EGLint error = eglGetError(); + if (returnVal && error == EGL_SUCCESS) { + LOGV(" %s: %d (0x%x)", names[j].name, value, value); + } + } +} + + +void Context::initGLThread() { + pthread_mutex_lock(&gInitMutex); + LOGV("initGLThread start %p", this); + mEGL.mNumConfigs = -1; EGLint configAttribs[128]; EGLint *configAttribsPtr = configAttribs; @@ -69,15 +123,13 @@ void Context::initEGL(bool useGL2) configAttribsPtr[1] = EGL_WINDOW_BIT; configAttribsPtr += 2; - if (useGL2) { - configAttribsPtr[0] = EGL_RENDERABLE_TYPE; - configAttribsPtr[1] = EGL_OPENGL_ES2_BIT; - configAttribsPtr += 2; - } + configAttribsPtr[0] = EGL_RENDERABLE_TYPE; + configAttribsPtr[1] = EGL_OPENGL_ES2_BIT; + configAttribsPtr += 2; - if (mUseDepth) { + if (mUserSurfaceConfig.depthMin > 0) { configAttribsPtr[0] = EGL_DEPTH_SIZE; - configAttribsPtr[1] = 16; + configAttribsPtr[1] = mUserSurfaceConfig.depthMin; configAttribsPtr += 2; } @@ -97,29 +149,94 @@ void Context::initEGL(bool useGL2) eglInitialize(mEGL.mDisplay, &mEGL.mMajorVersion, &mEGL.mMinorVersion); checkEglError("eglInitialize"); - status_t err = EGLUtils::selectConfigForNativeWindow(mEGL.mDisplay, configAttribs, mWndSurface, &mEGL.mConfig); +#if 1 + PixelFormat pf = PIXEL_FORMAT_RGBA_8888; + if (mUserSurfaceConfig.alphaMin == 0) { + pf = PIXEL_FORMAT_RGBX_8888; + } + + status_t err = EGLUtils::selectConfigForPixelFormat(mEGL.mDisplay, configAttribs, pf, &mEGL.mConfig); if (err) { LOGE("%p, couldn't find an EGLConfig matching the screen format\n", this); } - //eglChooseConfig(mEGL.mDisplay, configAttribs, &mEGL.mConfig, 1, &mEGL.mNumConfigs); - - - if (useGL2) { - mEGL.mContext = eglCreateContext(mEGL.mDisplay, mEGL.mConfig, EGL_NO_CONTEXT, context_attribs2); - } else { - mEGL.mContext = eglCreateContext(mEGL.mDisplay, mEGL.mConfig, EGL_NO_CONTEXT, NULL); + if (props.mLogVisual) { + printEGLConfiguration(mEGL.mDisplay, mEGL.mConfig); } +#else + eglChooseConfig(mEGL.mDisplay, configAttribs, &mEGL.mConfig, 1, &mEGL.mNumConfigs); +#endif + + mEGL.mContext = eglCreateContext(mEGL.mDisplay, mEGL.mConfig, EGL_NO_CONTEXT, context_attribs2); checkEglError("eglCreateContext"); if (mEGL.mContext == EGL_NO_CONTEXT) { LOGE("%p, eglCreateContext returned EGL_NO_CONTEXT", this); } gGLContextCount++; + + + EGLint pbuffer_attribs[] = { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE }; + mEGL.mSurfaceDefault = eglCreatePbufferSurface(mEGL.mDisplay, mEGL.mConfig, pbuffer_attribs); + checkEglError("eglCreatePbufferSurface"); + if (mEGL.mSurfaceDefault == EGL_NO_SURFACE) { + LOGE("eglCreatePbufferSurface returned EGL_NO_SURFACE"); + } + + EGLBoolean ret = eglMakeCurrent(mEGL.mDisplay, mEGL.mSurfaceDefault, mEGL.mSurfaceDefault, mEGL.mContext); + checkEglError("eglMakeCurrent", ret); + + mGL.mVersion = glGetString(GL_VERSION); + mGL.mVendor = glGetString(GL_VENDOR); + mGL.mRenderer = glGetString(GL_RENDERER); + mGL.mExtensions = glGetString(GL_EXTENSIONS); + + //LOGV("EGL Version %i %i", mEGL.mMajorVersion, mEGL.mMinorVersion); + LOGV("GL Version %s", mGL.mVersion); + //LOGV("GL Vendor %s", mGL.mVendor); + LOGV("GL Renderer %s", mGL.mRenderer); + //LOGV("GL Extensions %s", mGL.mExtensions); + + const char *verptr = NULL; + if (strlen((const char *)mGL.mVersion) > 9) { + if (!memcmp(mGL.mVersion, "OpenGL ES-CM", 12)) { + verptr = (const char *)mGL.mVersion + 12; + } + if (!memcmp(mGL.mVersion, "OpenGL ES ", 10)) { + verptr = (const char *)mGL.mVersion + 9; + } + } + + if (!verptr) { + LOGE("Error, OpenGL ES Lite not supported"); + } else { + sscanf(verptr, " %i.%i", &mGL.mMajorVersion, &mGL.mMinorVersion); + } + + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &mGL.mMaxVertexAttribs); + glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &mGL.mMaxVertexUniformVectors); + glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &mGL.mMaxVertexTextureUnits); + + glGetIntegerv(GL_MAX_VARYING_VECTORS, &mGL.mMaxVaryingVectors); + glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &mGL.mMaxTextureImageUnits); + + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &mGL.mMaxFragmentTextureImageUnits); + glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &mGL.mMaxFragmentUniformVectors); + + mGL.OES_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_OES_texture_npot"); + mGL.EXT_texture_max_aniso = 1.0f; + bool hasAniso = NULL != strstr((const char *)mGL.mExtensions, "GL_EXT_texture_filter_anisotropic"); + if(hasAniso) { + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &mGL.EXT_texture_max_aniso); + } + + LOGV("initGLThread end %p", this); + pthread_mutex_unlock(&gInitMutex); } void Context::deinitEGL() { LOGV("%p, deinitEGL", this); - setSurface(0, 0, NULL); + + eglMakeCurrent(mEGL.mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, mEGL.mContext); eglDestroyContext(mEGL.mDisplay, mEGL.mContext); checkEglError("eglDestroyContext"); @@ -312,6 +429,8 @@ void * Context::threadProc(void *vrsc) LOGE("pthread_setspecific %i", status); } + rsc->initGLThread(); + rsc->mScriptC.init(rsc); if (rsc->mIsGraphicsContext) { rsc->mStateRaster.init(rsc); @@ -460,7 +579,7 @@ void Context::setPriority(int32_t p) #endif } -Context::Context(Device *dev, bool isGraphics, bool useDepth) +Context::Context(Device *dev, const RsSurfaceConfig *sc) { pthread_mutex_lock(&gInitMutex); @@ -468,15 +587,19 @@ Context::Context(Device *dev, bool isGraphics, bool useDepth) mDev = dev; mRunning = false; mExit = false; - mUseDepth = useDepth; mPaused = false; mObjHead = NULL; mError = RS_ERROR_NONE; mErrorMsg = NULL; + if (sc) { + mUserSurfaceConfig = *sc; + } else { + memset(&mUserSurfaceConfig, 0, sizeof(mUserSurfaceConfig)); + } memset(&mEGL, 0, sizeof(mEGL)); memset(&mGL, 0, sizeof(mGL)); - mIsGraphicsContext = isGraphics; + mIsGraphicsContext = sc != NULL; int status; pthread_attr_t threadAttr; @@ -490,6 +613,7 @@ Context::Context(Device *dev, bool isGraphics, bool useDepth) } } gThreadTLSKeyCount++; + pthread_mutex_unlock(&gInitMutex); // Global init done at this point. @@ -534,8 +658,6 @@ Context::Context(Device *dev, bool isGraphics, bool useDepth) break; } } - - pthread_attr_destroy(&threadAttr); } @@ -568,28 +690,21 @@ void Context::setSurface(uint32_t w, uint32_t h, ANativeWindow *sur) EGLBoolean ret; if (mEGL.mSurface != NULL) { - ret = eglMakeCurrent(mEGL.mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + ret = eglMakeCurrent(mEGL.mDisplay, mEGL.mSurfaceDefault, mEGL.mSurfaceDefault, mEGL.mContext); checkEglError("eglMakeCurrent", ret); ret = eglDestroySurface(mEGL.mDisplay, mEGL.mSurface); checkEglError("eglDestroySurface", ret); mEGL.mSurface = NULL; - mWidth = 0; - mHeight = 0; + mWidth = 1; + mHeight = 1; } mWndSurface = sur; if (mWndSurface != NULL) { mWidth = w; mHeight = h; - bool first = false; - if (!mEGL.mContext) { - first = true; - pthread_mutex_lock(&gInitMutex); - initEGL(true); - pthread_mutex_unlock(&gInitMutex); - } mEGL.mSurface = eglCreateWindowSurface(mEGL.mDisplay, mEGL.mConfig, mWndSurface, NULL); checkEglError("eglCreateWindowSurface"); @@ -601,53 +716,6 @@ void Context::setSurface(uint32_t w, uint32_t h, ANativeWindow *sur) checkEglError("eglMakeCurrent", ret); mStateVertex.updateSize(this); - - if (first) { - mGL.mVersion = glGetString(GL_VERSION); - mGL.mVendor = glGetString(GL_VENDOR); - mGL.mRenderer = glGetString(GL_RENDERER); - mGL.mExtensions = glGetString(GL_EXTENSIONS); - - //LOGV("EGL Version %i %i", mEGL.mMajorVersion, mEGL.mMinorVersion); - LOGV("GL Version %s", mGL.mVersion); - //LOGV("GL Vendor %s", mGL.mVendor); - LOGV("GL Renderer %s", mGL.mRenderer); - //LOGV("GL Extensions %s", mGL.mExtensions); - - const char *verptr = NULL; - if (strlen((const char *)mGL.mVersion) > 9) { - if (!memcmp(mGL.mVersion, "OpenGL ES-CM", 12)) { - verptr = (const char *)mGL.mVersion + 12; - } - if (!memcmp(mGL.mVersion, "OpenGL ES ", 10)) { - verptr = (const char *)mGL.mVersion + 9; - } - } - - if (!verptr) { - LOGE("Error, OpenGL ES Lite not supported"); - } else { - sscanf(verptr, " %i.%i", &mGL.mMajorVersion, &mGL.mMinorVersion); - } - - glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &mGL.mMaxVertexAttribs); - glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &mGL.mMaxVertexUniformVectors); - glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &mGL.mMaxVertexTextureUnits); - - glGetIntegerv(GL_MAX_VARYING_VECTORS, &mGL.mMaxVaryingVectors); - glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &mGL.mMaxTextureImageUnits); - - glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &mGL.mMaxFragmentTextureImageUnits); - glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &mGL.mMaxFragmentUniformVectors); - - mGL.OES_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_OES_texture_npot"); - mGL.EXT_texture_max_aniso = 1.0f; - bool hasAniso = NULL != strstr((const char *)mGL.mExtensions, "GL_EXT_texture_filter_anisotropic"); - if(hasAniso) { - glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &mGL.EXT_texture_max_aniso); - } - } - } } @@ -829,7 +897,7 @@ void Context::dumpDebug() const LOGE(" GL Extensions: %s", mGL.mExtensions); LOGE(" GL int Versions %i %i", mGL.mMajorVersion, mGL.mMinorVersion); LOGE(" RS width %i, height %i", mWidth, mHeight); - LOGE(" RS running %i, exit %i, useDepth %i, paused %i", mRunning, mExit, mUseDepth, mPaused); + LOGE(" RS running %i, exit %i, paused %i", mRunning, mExit, mPaused); LOGE(" RS pThreadID %li, nativeThreadID %i", mThreadId, mNativeThreadId); LOGV("MAX Textures %i, %i %i", mGL.mMaxVertexTextureUnits, mGL.mMaxFragmentTextureImageUnits, mGL.mMaxTextureImageUnits); @@ -957,15 +1025,15 @@ RsContext rsContextCreate(RsDevice vdev, uint32_t version) { LOGV("rsContextCreate %p", vdev); Device * dev = static_cast<Device *>(vdev); - Context *rsc = new Context(dev, false, false); + Context *rsc = new Context(dev, NULL); return rsc; } -RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, bool useDepth) +RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, RsSurfaceConfig sc) { - LOGV("rsContextCreateGL %p, %i", vdev, useDepth); + LOGV("rsContextCreateGL %p", vdev); Device * dev = static_cast<Device *>(vdev); - Context *rsc = new Context(dev, true, useDepth); + Context *rsc = new Context(dev, &sc); LOGV("rsContextCreateGL ret %p ", rsc); return rsc; } diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h index 8a8b8a8..dbe2c79 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/rsContext.h @@ -69,7 +69,7 @@ namespace renderscript { class Context { public: - Context(Device *, bool isGraphics, bool useDepth); + Context(Device *, const RsSurfaceConfig *sc); ~Context(); static pthread_key_t gThreadTLSKey; @@ -82,6 +82,7 @@ public: Script * mScript; }; ScriptTLSStruct *mTlsStruct; + RsSurfaceConfig mUserSurfaceConfig; typedef void (*WorkerCallback_t)(void *usr, uint32_t idx); @@ -207,6 +208,7 @@ protected: EGLConfig mConfig; EGLContext mContext; EGLSurface mSurface; + EGLSurface mSurfaceDefault; EGLDisplay mDisplay; } mEGL; @@ -240,7 +242,6 @@ protected: bool mRunning; bool mExit; - bool mUseDepth; bool mPaused; RsError mError; const char *mErrorMsg; @@ -274,7 +275,8 @@ protected: private: Context(); - void initEGL(bool useGL2); + void initEGL(); + void initGLThread(); void deinitEGL(); uint32_t runRootScript(); diff --git a/libs/rs/rsProgramStore.cpp b/libs/rs/rsProgramStore.cpp index 3f90d7a..586a89f 100644 --- a/libs/rs/rsProgramStore.cpp +++ b/libs/rs/rsProgramStore.cpp @@ -76,14 +76,25 @@ void ProgramStore::setupGL2(const Context *rsc, ProgramStoreState *state) //LOGE("pfs %i, %i, %x", mDepthWriteEnable, mDepthTestEnable, mDepthFunc); - glDepthMask(mDepthWriteEnable); - if(mDepthTestEnable || mDepthWriteEnable) { - glEnable(GL_DEPTH_TEST); - glDepthFunc(mDepthFunc); + if (rsc->mUserSurfaceConfig.depthMin > 0) { + glDepthMask(mDepthWriteEnable); + if(mDepthTestEnable || mDepthWriteEnable) { + glEnable(GL_DEPTH_TEST); + glDepthFunc(mDepthFunc); + } else { + glDisable(GL_DEPTH_TEST); + } } else { + glDepthMask(false); glDisable(GL_DEPTH_TEST); } + if (rsc->mUserSurfaceConfig.stencilMin > 0) { + } else { + glStencilMask(0); + glDisable(GL_STENCIL_TEST); + } + if (mDitherEnable) { glEnable(GL_DITHER); } else { diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp index 17a961b..b5f9c47 100644 --- a/libs/storage/IMountService.cpp +++ b/libs/storage/IMountService.cpp @@ -431,13 +431,14 @@ public: } void mountObb(const String16& filename, const String16& key, - const sp<IObbActionListener>& token) + const sp<IObbActionListener>& token, int32_t nonce) { Parcel data, reply; data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(filename); data.writeString16(key); data.writeStrongBinder(token->asBinder()); + data.writeInt32(nonce); if (remote()->transact(TRANSACTION_mountObb, data, &reply) != NO_ERROR) { LOGD("mountObb could not contact remote\n"); return; @@ -449,12 +450,15 @@ public: } } - void unmountObb(const String16& filename, const bool force, const sp<IObbActionListener>& token) + void unmountObb(const String16& filename, const bool force, + const sp<IObbActionListener>& token, const int32_t nonce) { Parcel data, reply; data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeString16(filename); data.writeInt32(force ? 1 : 0); + data.writeStrongBinder(token->asBinder()); + data.writeInt32(nonce); if (remote()->transact(TRANSACTION_unmountObb, data, &reply) != NO_ERROR) { LOGD("unmountObb could not contact remote\n"); return; diff --git a/libs/storage/IObbActionListener.cpp b/libs/storage/IObbActionListener.cpp index 5bfece7..eaa211e 100644 --- a/libs/storage/IObbActionListener.cpp +++ b/libs/storage/IObbActionListener.cpp @@ -30,7 +30,7 @@ public: : BpInterface<IObbActionListener>(impl) { } - virtual void onObbResult(const String16& filename, const String16& status) { } + virtual void onObbResult(const String16& filename, const int32_t nonce, const int32_t state) { } }; IMPLEMENT_META_INTERFACE(ObbActionListener, "IObbActionListener"); @@ -44,8 +44,9 @@ status_t BnObbActionListener::onTransact( case TRANSACTION_onObbResult: { CHECK_INTERFACE(IObbActionListener, data, reply); String16 filename = data.readString16(); - String16 state = data.readString16(); - onObbResult(filename, state); + int32_t nonce = data.readInt32(); + int32_t state = data.readInt32(); + onObbResult(filename, nonce, state); reply->writeNoException(); return NO_ERROR; } break; diff --git a/libs/surfaceflinger_client/ISurfaceComposer.cpp b/libs/surfaceflinger_client/ISurfaceComposer.cpp index d676f5e..d72561f 100644 --- a/libs/surfaceflinger_client/ISurfaceComposer.cpp +++ b/libs/surfaceflinger_client/ISurfaceComposer.cpp @@ -142,6 +142,15 @@ public: return reply.readInt32(); } + virtual status_t turnElectronBeamOff(int32_t mode) + { + Parcel data, reply; + data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); + data.writeInt32(mode); + remote()->transact(BnSurfaceComposer::TURN_ELECTRON_BEAM_OFF, data, &reply); + return reply.readInt32(); + } + virtual void signal() const { Parcel data, reply; @@ -224,6 +233,12 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(f); reply->writeInt32(res); } break; + case TURN_ELECTRON_BEAM_OFF: { + CHECK_INTERFACE(ISurfaceComposer, data, reply); + int32_t mode = data.readInt32(); + status_t res = turnElectronBeamOff(mode); + reply->writeInt32(res); + } default: return BBinder::onTransact(code, data, reply, flags); } diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp index 52e488a..84c3db8 100644 --- a/libs/ui/InputDispatcher.cpp +++ b/libs/ui/InputDispatcher.cpp @@ -432,10 +432,9 @@ void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropR switch (dropReason) { case DROP_REASON_POLICY: #if DEBUG_INBOUND_EVENT_DETAILS - LOGD("Dropped event because policy requested that it not be delivered to the application."); + LOGD("Dropped event because policy consumed it."); #endif - reason = "inbound event was dropped because the policy requested that it not be " - "delivered to the application"; + reason = "inbound event was dropped because the policy consumed it"; break; case DROP_REASON_DISABLED: LOGI("Dropped event because input dispatch is disabled."); @@ -625,15 +624,13 @@ bool InputDispatcher::dispatchKeyLocked( if (*dropReason == DROP_REASON_NOT_DROPPED) { *dropReason = DROP_REASON_POLICY; } - resetTargetsLocked(); - setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_SUCCEEDED); - return true; } // Clean up if dropping the event. if (*dropReason != DROP_REASON_NOT_DROPPED) { resetTargetsLocked(); - setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED); + setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY + ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED); return true; } @@ -713,7 +710,8 @@ bool InputDispatcher::dispatchMotionLocked( // Clean up if dropping the event. if (*dropReason != DROP_REASON_NOT_DROPPED) { resetTargetsLocked(); - setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED); + setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY + ? INPUT_EVENT_INJECTION_SUCCEEDED : INPUT_EVENT_INJECTION_FAILED); return true; } @@ -3396,7 +3394,7 @@ void InputDispatcher::InputState::synthesizeCancelationEvents(nsecs_t currentTim } } - for (size_t i = 0; i < mMotionMementos.size(); i++) { + for (size_t i = 0; i < mMotionMementos.size(); ) { const MotionMemento& memento = mMotionMementos.itemAt(i); if (shouldCancelEvent(memento.source, options)) { outEvents.push(allocator->obtainMotionEntry(currentTime, |