summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-08-11 14:06:51 -0700
committerChris Craik <ccraik@google.com>2011-08-11 14:06:51 -0700
commitf173c32abeabd5d55809be2efd150db5e56c8b5b (patch)
treec2dc48e0edda8364991673e80cf5963fa525ddb2 /Source/WebCore
parent4930744a9233f8d2518ca0ed96956a5b603c7b15 (diff)
downloadexternal_webkit-f173c32abeabd5d55809be2efd150db5e56c8b5b.zip
external_webkit-f173c32abeabd5d55809be2efd150db5e56c8b5b.tar.gz
external_webkit-f173c32abeabd5d55809be2efd150db5e56c8b5b.tar.bz2
Remove ANativeWindow call to avoid blocking call
bug:5114637 Determine alpha blending through surface texture instead of ANativeWindow call. Should no longer break the gpl build... Change-Id: Iacc733c29413f0302304b78f378a003d690199f0
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/MediaTexture.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.cpp b/Source/WebCore/platform/graphics/android/MediaTexture.cpp
index 3fecfb5..96d136a 100644
--- a/Source/WebCore/platform/graphics/android/MediaTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/MediaTexture.cpp
@@ -104,10 +104,20 @@ void MediaTexture::drawContent(const TransformationMatrix& matrix)
m_surfaceTexture->updateTexImage();
- bool forceBlending = ANativeWindow_getFormat(m_surfaceTextureClient.get()) == WINDOW_FORMAT_RGB_565;
+ sp<GraphicBuffer> buf = m_surfaceTexture->getCurrentBuffer();
+
+ PixelFormat f = buf->getPixelFormat();
+ // only attempt to use alpha blending if alpha channel exists
+ bool forceAlphaBlending = !(
+ PIXEL_FORMAT_RGBX_8888 == f ||
+ PIXEL_FORMAT_RGB_888 == f ||
+ PIXEL_FORMAT_RGB_565 == f ||
+ PIXEL_FORMAT_RGB_332 == f);
+
TilesManager::instance()->shader()->drawLayerQuad(matrix, m_dimensions,
m_textureId, 1.0f,
- forceBlending, GL_TEXTURE_EXTERNAL_OES);
+ forceAlphaBlending,
+ GL_TEXTURE_EXTERNAL_OES);
}
void MediaTexture::drawVideo(const TransformationMatrix& matrix, const SkRect& parentBounds)