summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/MediaLayer.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2011-02-16 12:48:46 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-16 12:48:46 -0800
commit5ad675d34069bcdf6bcd983ae4941c0531216354 (patch)
treef04ba87adf01e537b817dff8e177e62bad0e495b /WebCore/platform/graphics/android/MediaLayer.cpp
parente9d5f570f22c46f9adaa4181c3fa1b715f15ccb3 (diff)
parent87a12aa24a87540251e0d2d0a223e761ceb31da2 (diff)
downloadexternal_webkit-5ad675d34069bcdf6bcd983ae4941c0531216354.zip
external_webkit-5ad675d34069bcdf6bcd983ae4941c0531216354.tar.gz
external_webkit-5ad675d34069bcdf6bcd983ae4941c0531216354.tar.bz2
Merge "Selectively enable and disable GL_BLEND for better performance."
Diffstat (limited to 'WebCore/platform/graphics/android/MediaLayer.cpp')
-rw-r--r--WebCore/platform/graphics/android/MediaLayer.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/WebCore/platform/graphics/android/MediaLayer.cpp b/WebCore/platform/graphics/android/MediaLayer.cpp
index 7a4c02d..ad4fc76 100644
--- a/WebCore/platform/graphics/android/MediaLayer.cpp
+++ b/WebCore/platform/graphics/android/MediaLayer.cpp
@@ -84,19 +84,26 @@ bool MediaLayer::drawGL(SkMatrix& matrix)
if (m_bufferedTexture) {
TextureInfo* textureInfo = m_bufferedTexture->consumerLock();
if (textureInfo) {
- // the layer's shader draws the content inverted so we must undo
- // that change in the transformation matrix
- TransformationMatrix m = drawTransform();
- if (!m_isContentInverted) {
- m.flipY();
- m.translate(0, -getSize().height());
- }
SkRect rect;
rect.set(0, 0, getSize().width(), getSize().height());
- TilesManager::instance()->shader()->drawLayerQuad(m, rect,
- textureInfo->m_textureId,
- 1.0f); //TODO fix this m_drawOpacity
+
+ if (textureInfo->m_width != 0 && textureInfo->m_height != 0) {
+ // the layer's shader draws the content inverted so we must undo
+ // that change in the transformation matrix
+ TransformationMatrix m = drawTransform();
+ if (!m_isContentInverted) {
+ m.flipY();
+ m.translate(0, -getSize().height());
+ }
+
+ bool forceBlending = textureInfo->m_internalFormat == GL_RGBA ||
+ textureInfo->m_internalFormat == GL_ALPHA;
+ TilesManager::instance()->shader()->drawLayerQuad(m, rect,
+ textureInfo->m_textureId,
+ 1.0f, forceBlending);
+ }
+
if (!rect.isEmpty())
needsInval = false;
}