summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBase.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:44:00 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:44:00 -0800
commita6938bab1f6fa76ae98ebbe44f4e534e05fa0993 (patch)
treebc5a1f806bd06db8abb197e80be9ead3644c0bcc /libs/surfaceflinger/LayerBase.cpp
parente41dd756db5184519f4dacbf4d95b333822605c7 (diff)
downloadframeworks_native-a6938bab1f6fa76ae98ebbe44f4e534e05fa0993.zip
frameworks_native-a6938bab1f6fa76ae98ebbe44f4e534e05fa0993.tar.gz
frameworks_native-a6938bab1f6fa76ae98ebbe44f4e534e05fa0993.tar.bz2
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'libs/surfaceflinger/LayerBase.cpp')
-rw-r--r--libs/surfaceflinger/LayerBase.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index bdefba3..9277a64 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -23,6 +23,9 @@
#include <utils/Errors.h>
#include <utils/Log.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+
#include "clz.h"
#include "LayerBase.h"
#include "LayerBlur.h"
@@ -111,6 +114,12 @@ void LayerBase::commitTransaction(bool skipSize) {
mDrawingState.h = h;
}
}
+void LayerBase::forceVisibilityTransaction() {
+ // this can be called without SurfaceFlinger.mStateLock, but if we
+ // can atomically increment the sequence number, it doesn't matter.
+ android_atomic_inc(&mCurrentState.sequence);
+ requestTransaction();
+}
bool LayerBase::requestTransaction() {
int32_t old = setTransactionFlags(eTransactionNeeded);
return ((old & eTransactionNeeded) == 0);
@@ -220,10 +229,15 @@ Point LayerBase::getPhysicalSize() const
return Point(front.w, front.h);
}
+Transform LayerBase::getDrawingStateTransform() const
+{
+ return drawingState().transform;
+}
+
void LayerBase::validateVisibility(const Transform& planeTransform)
{
const Layer::State& s(drawingState());
- const Transform tr(planeTransform * s.transform);
+ const Transform tr(planeTransform * getDrawingStateTransform());
const bool transformed = tr.transformed();
const Point size(getPhysicalSize());
@@ -350,6 +364,10 @@ void LayerBase::draw(const Region& inClip) const
return;
}
}
+
+ // reset GL state
+ glEnable(GL_SCISSOR_TEST);
+
onDraw(clip);
/*
@@ -391,6 +409,7 @@ void LayerBase::clearWithOpenGL(const Region& clip) const
Rect r;
Region::iterator iterator(clip);
if (iterator) {
+ glEnable(GL_SCISSOR_TEST);
glVertexPointer(2, GL_FIXED, 0, mVertices);
while (iterator.iterate(&r)) {
const GLint sy = fbHeight - (r.top + r.height());