summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index dc562f1..1842949 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -104,7 +104,8 @@ SurfaceFlinger::SurfaceFlinger()
mLastSwapBufferTime(0),
mDebugInTransaction(0),
mLastTransactionTime(0),
- mBootFinished(false)
+ mBootFinished(false),
+ mUseDithering(0)
{
ALOGI("SurfaceFlinger is starting");
@@ -122,8 +123,13 @@ SurfaceFlinger::SurfaceFlinger()
mDebugDDMS = 0;
}
}
+
+ property_get("persist.sys.use_dithering", value, "1");
+ mUseDithering = atoi(value);
+
ALOGI_IF(mDebugRegion, "showupdates enabled");
ALOGI_IF(mDebugDDMS, "DDMS debugging enabled");
+ ALOGI_IF(mUseDithering, "use dithering");
#ifdef SAMSUNG_HDMI_SUPPORT
ALOGD(">>> Run service");
@@ -429,7 +435,11 @@ void SurfaceFlinger::initializeGL(EGLDisplay display) {
glPixelStorei(GL_PACK_ALIGNMENT, 4);
glEnableClientState(GL_VERTEX_ARRAY);
glShadeModel(GL_FLAT);
- glDisable(GL_DITHER);
+ if (mUseDithering == 2) {
+ glEnable(GL_DITHER);
+ } else {
+ glDisable(GL_DITHER);
+ }
glDisable(GL_CULL_FACE);
struct pack565 {
@@ -467,6 +477,9 @@ void SurfaceFlinger::initializeGL(EGLDisplay display) {
ALOGI("extensions: %s", extensions.getExtension());
ALOGI("GL_MAX_TEXTURE_SIZE = %d", mMaxTextureSize);
ALOGI("GL_MAX_VIEWPORT_DIMS = %d x %d", mMaxViewportDims[0], mMaxViewportDims[1]);
+
+ // XXX Assume bit depth for red is equal to minimum depth of all colors
+ mMinColorDepth = r;
}
status_t SurfaceFlinger::readyToRun()
@@ -564,6 +577,10 @@ uint32_t SurfaceFlinger::getMaxTextureSize() const {
return mMaxTextureSize;
}
+uint32_t SurfaceFlinger::getMinColorDepth() const {
+ return mMinColorDepth;
+}
+
uint32_t SurfaceFlinger::getMaxViewportDims() const {
return mMaxViewportDims[0] < mMaxViewportDims[1] ?
mMaxViewportDims[0] : mMaxViewportDims[1];