diff options
author | Mathias Agopian <mathias@google.com> | 2013-07-25 19:24:31 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2013-07-25 19:24:31 -0700 |
commit | 5773d3f5b2694c647e010246dff99acc70131289 (patch) | |
tree | d872f3545b5bc566acbf77a39b72207afa6e7e9a /services | |
parent | 1fe854f6788f6fe9177fcca85185d13ba37d1911 (diff) | |
download | frameworks_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.cpp | 24 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 1 |
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; |