Slog.w(TAG, "Unable to allocate freeze surface", e);
}
- if (false) {
+ if (true) {
try {
int size = mOriginalWidth > mOriginalHeight ? mOriginalWidth : mOriginalHeight;
mBlackSurface = new Surface(session, 0, "BlackSurface",
if (s == 0) {
s = createSurface();
mClientSurface = s;
+ mClientSurfaceBinder = s->asBinder();
}
return s;
}
+wp<IBinder> LayerBaseClient::getSurfaceBinder() const {
+ return mClientSurfaceBinder;
+}
+
sp<LayerBaseClient::Surface> LayerBaseClient::createSurface() const
{
return new Surface(mFlinger, mIdentity,
virtual ~LayerBaseClient();
sp<Surface> getSurface();
+ wp<IBinder> getSurfaceBinder() const;
virtual sp<Surface> createSurface() const;
virtual sp<LayerBaseClient> getLayerBaseClient() const {
return const_cast<LayerBaseClient*>(this); }
private:
mutable Mutex mLock;
mutable wp<Surface> mClientSurface;
+ wp<IBinder> mClientSurfaceBinder;
const wp<Client> mClientRef;
// only read
const uint32_t mIdentity;
const GLfloat alpha = s.alpha/255.0f;
const uint32_t fbHeight = hw.getHeight();
glDisable(GL_DITHER);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+
+ if (s.alpha == 0xFF) {
+ glDisable(GL_BLEND);
+ } else {
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ }
+
glColor4f(0, 0, 0, alpha);
#if defined(GL_OES_EGL_image_external)
{
sp<LayerBaseClient> lbc(layerBase->getLayerBaseClient());
if (lbc != 0) {
- mLayerMap.removeItem( lbc->getSurface()->asBinder() );
+ mLayerMap.removeItem( lbc->getSurfaceBinder() );
}
ssize_t index = mCurrentState.layersSortedByZ.remove(layerBase);
if (index >= 0) {