summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBuffer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-06-24 21:22:43 -0700
committerMathias Agopian <mathias@google.com>2010-06-24 21:28:59 -0700
commit01e4483b29d849fcbaa53dcdbad58201b13a6588 (patch)
tree05ab785ac2b7063745f82319e3623e90d0beeebd /libs/surfaceflinger/LayerBuffer.cpp
parent9a4a1d71042fd600f83f1130e18e80983428db21 (diff)
downloadframeworks_native-01e4483b29d849fcbaa53dcdbad58201b13a6588.zip
frameworks_native-01e4483b29d849fcbaa53dcdbad58201b13a6588.tar.gz
frameworks_native-01e4483b29d849fcbaa53dcdbad58201b13a6588.tar.bz2
fix [2793164] Spam 2x/second with TOT master in SurfaceFlinger
Make sure to not use GL_TEXTURE_EXTERNAL when it's not supported by the GL. The error was harmless, but annoying. Change-Id: I571a9a9b05d35da51420950a6a6e95629067efd0
Diffstat (limited to 'libs/surfaceflinger/LayerBuffer.cpp')
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 732a4ec..5f83636 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -315,8 +315,7 @@ void LayerBuffer::Source::unregisterBuffers() {
LayerBuffer::BufferSource::BufferSource(LayerBuffer& layer,
const ISurface::BufferHeap& buffers)
- : Source(layer), mStatus(NO_ERROR), mBufferSize(0),
- mTextureManager(layer.mFlags)
+ : Source(layer), mStatus(NO_ERROR), mBufferSize(0)
{
if (buffers.heap == NULL) {
// this is allowed, but in this case, it is illegal to receive
@@ -374,11 +373,11 @@ LayerBuffer::BufferSource::~BufferSource()
if (mTexture.name != -1U) {
// GL textures can only be destroyed from the GL thread
- mLayer.mFlinger->mEventQueue.postMessage(
- new MessageDestroyTexture(mLayer.mFlinger.get(), mTexture.name) );
+ getFlinger()->mEventQueue.postMessage(
+ new MessageDestroyTexture(getFlinger(), mTexture.name) );
}
if (mTexture.image != EGL_NO_IMAGE_KHR) {
- EGLDisplay dpy(mLayer.mFlinger->graphicPlane(0).getEGLDisplay());
+ EGLDisplay dpy(getFlinger()->graphicPlane(0).getEGLDisplay());
eglDestroyImageKHR(dpy, mTexture.image);
}
}
@@ -444,7 +443,7 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
const Rect transformedBounds(mLayer.getTransformedBounds());
#if defined(EGL_ANDROID_image_native_buffer)
- if (mLayer.mFlags & DisplayHardware::DIRECT_TEXTURE) {
+ if (GLExtensions::getInstance().haveDirectTexture()) {
err = INVALID_OPERATION;
if (ourBuffer->supportsCopybit()) {
copybit_device_t* copybit = mLayer.mBlitEngine;
@@ -549,7 +548,7 @@ status_t LayerBuffer::BufferSource::initTempBuffer() const
dst.crop.r = w;
dst.crop.b = h;
- EGLDisplay dpy(mLayer.mFlinger->graphicPlane(0).getEGLDisplay());
+ EGLDisplay dpy(getFlinger()->graphicPlane(0).getEGLDisplay());
err = mTextureManager.initEglImage(&mTexture, dpy, buffer);
}
@@ -559,7 +558,7 @@ status_t LayerBuffer::BufferSource::initTempBuffer() const
void LayerBuffer::BufferSource::clearTempBufferImage() const
{
// delete the image
- EGLDisplay dpy(mLayer.mFlinger->graphicPlane(0).getEGLDisplay());
+ EGLDisplay dpy(getFlinger()->graphicPlane(0).getEGLDisplay());
eglDestroyImageKHR(dpy, mTexture.image);
// and the associated texture (recreate a name)
@@ -576,7 +575,7 @@ LayerBuffer::OverlaySource::OverlaySource(LayerBuffer& layer,
: Source(layer), mVisibilityChanged(false),
mOverlay(0), mOverlayHandle(0), mOverlayDevice(0), mOrientation(orientation)
{
- overlay_control_device_t* overlay_dev = mLayer.mFlinger->getOverlayEngine();
+ overlay_control_device_t* overlay_dev = getFlinger()->getOverlayEngine();
if (overlay_dev == NULL) {
// overlays not supported
return;
@@ -607,7 +606,7 @@ LayerBuffer::OverlaySource::OverlaySource(LayerBuffer& layer,
*overlayRef = new OverlayRef(mOverlayHandle, channel,
mWidth, mHeight, mFormat, mWidthStride, mHeightStride);
- mLayer.mFlinger->signalEvent();
+ getFlinger()->signalEvent();
}
LayerBuffer::OverlaySource::~OverlaySource()