summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger
diff options
context:
space:
mode:
authorRebecca Schultz Zavin <rebecca@android.com>2009-09-01 23:06:45 -0700
committerRebecca Schultz Zavin <rebecca@android.com>2009-09-02 15:57:42 -0700
commit29aa74c546751ed04d17dc248a967eebaef63b21 (patch)
tree1be0d48a6b95cc436ad5d17fb93a193c69f3a7f8 /libs/surfaceflinger
parentd06abf0cafca969668f321b55b80d3901694761c (diff)
downloadframeworks_native-29aa74c546751ed04d17dc248a967eebaef63b21.zip
frameworks_native-29aa74c546751ed04d17dc248a967eebaef63b21.tar.gz
frameworks_native-29aa74c546751ed04d17dc248a967eebaef63b21.tar.bz2
Add colorkey to gl clear operation
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r--libs/surfaceflinger/LayerBase.cpp11
-rw-r--r--libs/surfaceflinger/LayerBase.h4
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp6
3 files changed, 17 insertions, 4 deletions
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index fd54e35..9ddf972 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -354,11 +354,13 @@ GLuint LayerBase::createTexture() const
return textureName;
}
-void LayerBase::clearWithOpenGL(const Region& clip) const
+void LayerBase::clearWithOpenGL(const Region& clip, GLclampx red,
+ GLclampx green, GLclampx blue,
+ GLclampx alpha) const
{
const DisplayHardware& hw(graphicPlane(0).displayHardware());
const uint32_t fbHeight = hw.getHeight();
- glColor4x(0,0,0,0);
+ glColor4x(red,green,blue,alpha);
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
glDisable(GL_DITHER);
@@ -377,6 +379,11 @@ void LayerBase::clearWithOpenGL(const Region& clip) const
}
}
+void LayerBase::clearWithOpenGL(const Region& clip) const
+{
+ clearWithOpenGL(clip,0,0,0,0);
+}
+
void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
{
const DisplayHardware& hw(graphicPlane(0).displayHardware());
diff --git a/libs/surfaceflinger/LayerBase.h b/libs/surfaceflinger/LayerBase.h
index 7791941..2168de0 100644
--- a/libs/surfaceflinger/LayerBase.h
+++ b/libs/surfaceflinger/LayerBase.h
@@ -251,7 +251,9 @@ protected:
uint32_t transform;
bool dirty;
};
-
+
+ void clearWithOpenGL(const Region& clip, GLclampx r, GLclampx g,
+ GLclampx b, GLclampx alpha) const;
void clearWithOpenGL(const Region& clip) const;
void drawWithOpenGL(const Region& clip, const Texture& texture) const;
void loadTexture(Texture* texture, GLint textureName,
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index bd6d472..8a55a3f 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -600,7 +600,11 @@ LayerBuffer::OverlaySource::~OverlaySource()
void LayerBuffer::OverlaySource::onDraw(const Region& clip) const
{
- mLayer.clearWithOpenGL(clip);
+ GLclampx color = 0x000018; //dark blue
+ GLclampx red = 0;
+ GLclampx green = 0;
+ GLclampx blue = 0x1818;
+ mLayer.clearWithOpenGL(clip, red, green, blue, 0);
}
void LayerBuffer::OverlaySource::onTransaction(uint32_t flags)