summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/MediaTexture.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2011-08-09 17:22:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-09 17:22:20 -0700
commit92ca5508d5114ba07de5fa64b9f34571bff00831 (patch)
tree2778fe7c0fc7681837987fecf11990413d70f6ee /Source/WebCore/platform/graphics/android/MediaTexture.cpp
parent88b039f5f5e322b0fa10336696acc919e2cb08b9 (diff)
parentaa809ca82529a9d546f50918830d075daea08a91 (diff)
downloadexternal_webkit-92ca5508d5114ba07de5fa64b9f34571bff00831.zip
external_webkit-92ca5508d5114ba07de5fa64b9f34571bff00831.tar.gz
external_webkit-92ca5508d5114ba07de5fa64b9f34571bff00831.tar.bz2
Merge "Remove ANativeWindow call to avoid blocking call"
Diffstat (limited to 'Source/WebCore/platform/graphics/android/MediaTexture.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/MediaTexture.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/android/MediaTexture.cpp b/Source/WebCore/platform/graphics/android/MediaTexture.cpp
index 3fecfb5..b9c640d 100644
--- a/Source/WebCore/platform/graphics/android/MediaTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/MediaTexture.cpp
@@ -104,10 +104,19 @@ 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)