diff options
| author | Chris Craik <ccraik@google.com> | 2011-08-11 15:23:37 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-11 15:23:37 -0700 |
| commit | e070cc1fb2ad0c2fdc0e5bf26c3692f2a1a91731 (patch) | |
| tree | 9674d6f429f8a0b55e5b2d87410a4db3c8955386 /Source/WebCore | |
| parent | ac16d73fe1d8ecf3265c93157e386e725fbb5298 (diff) | |
| parent | f173c32abeabd5d55809be2efd150db5e56c8b5b (diff) | |
| download | external_webkit-e070cc1fb2ad0c2fdc0e5bf26c3692f2a1a91731.zip external_webkit-e070cc1fb2ad0c2fdc0e5bf26c3692f2a1a91731.tar.gz external_webkit-e070cc1fb2ad0c2fdc0e5bf26c3692f2a1a91731.tar.bz2 | |
Merge "Remove ANativeWindow call to avoid blocking call"
Diffstat (limited to 'Source/WebCore')
| -rw-r--r-- | Source/WebCore/platform/graphics/android/MediaTexture.cpp | 14 |
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) |
