summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-07-25 19:24:31 -0700
committerMathias Agopian <mathias@google.com>2013-07-25 19:24:31 -0700
commit5773d3f5b2694c647e010246dff99acc70131289 (patch)
treed872f3545b5bc566acbf77a39b72207afa6e7e9a /services
parent1fe854f6788f6fe9177fcca85185d13ba37d1911 (diff)
downloadframeworks_native-5773d3f5b2694c647e010246dff99acc70131289.zip
frameworks_native-5773d3f5b2694c647e010246dff99acc70131289.tar.gz
frameworks_native-5773d3f5b2694c647e010246dff99acc70131289.tar.bz2
get rid of PixelFormatInfo and simplify things
Change-Id: I025a362cc12d5b9b794fac14be500e25aab65396
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/Layer.cpp24
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp1
2 files changed, 10 insertions, 15 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 7f2ce2b..1a25abe 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -176,14 +176,6 @@ const String8& Layer::getName() const {
status_t Layer::setBuffers( uint32_t w, uint32_t h,
PixelFormat format, uint32_t flags)
{
- // this surfaces pixel format
- PixelFormatInfo info;
- status_t err = getPixelFormatInfo(format, &info);
- if (err) {
- ALOGE("unsupported pixelformat %d", format);
- return err;
- }
-
uint32_t const maxSurfaceDims = min(
mFlinger->getMaxTextureSize(), mFlinger->getMaxViewportDims());
@@ -583,15 +575,19 @@ bool Layer::getFiltering() const {
// hardware.h, instead of using hard-coded values here.
#define HARDWARE_IS_DEVICE_FORMAT(f) ((f) >= 0x100 && (f) <= 0x1FF)
-bool Layer::getOpacityForFormat(uint32_t format)
-{
+bool Layer::getOpacityForFormat(uint32_t format) {
if (HARDWARE_IS_DEVICE_FORMAT(format)) {
return true;
}
- PixelFormatInfo info;
- status_t err = getPixelFormatInfo(PixelFormat(format), &info);
- // in case of error (unknown format), we assume no blending
- return (err || info.h_alpha <= info.l_alpha);
+ switch (format) {
+ case HAL_PIXEL_FORMAT_RGBA_8888:
+ case HAL_PIXEL_FORMAT_BGRA_8888:
+ case HAL_PIXEL_FORMAT_RGBA_5551:
+ case HAL_PIXEL_FORMAT_RGBA_4444:
+ return true;
+ }
+ // in all other case, we have no blending (also for unknown formats)
+ return false;
}
// ----------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index cbdcd12..850bb21 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -566,7 +566,6 @@ status_t SurfaceFlinger::getDisplayInfo(const sp<IBinder>& display, DisplayInfo*
// TODO: this needs to go away (currently needed only by webkit)
sp<const DisplayDevice> hw(getDefaultDisplayDevice());
info->orientation = hw->getOrientation();
- getPixelFormatInfo(hw->getFormat(), &info->pixelFormatInfo);
} else {
// TODO: where should this value come from?
static const int TV_DENSITY = 213;