summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/android')
-rw-r--r--WebCore/platform/graphics/android/MediaLayer.cpp10
-rw-r--r--WebCore/platform/graphics/android/MediaLayer.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/MediaLayer.cpp b/WebCore/platform/graphics/android/MediaLayer.cpp
index 9c370a5..e4ccbdb 100644
--- a/WebCore/platform/graphics/android/MediaLayer.cpp
+++ b/WebCore/platform/graphics/android/MediaLayer.cpp
@@ -46,6 +46,7 @@ MediaLayer::MediaLayer() : LayerAndroid(false)
m_bufferedTexture = new MediaTexture(EGL_NO_CONTEXT);
m_bufferedTexture->incStrong(this);
m_currentTextureInfo = 0;
+ m_isContentInverted = false;
XLOG("Creating Media Layer %p", this);
}
@@ -54,6 +55,7 @@ MediaLayer::MediaLayer(const MediaLayer& layer) : LayerAndroid(layer)
m_bufferedTexture = layer.getTexture();
m_bufferedTexture->incStrong(this);
m_currentTextureInfo = 0;
+ m_isContentInverted = layer.m_isContentInverted;
XLOG("Creating Media Layer Copy %p -> %p", &layer, this);
}
@@ -71,6 +73,14 @@ bool MediaLayer::drawGL(SkMatrix& matrix)
SkRect rect;
rect.set(0, 0, getSize().width(), getSize().height());
TransformationMatrix m = drawTransform();
+
+ // the layer's shader draws the content inverted so we must undo
+ // that change in the transformation matrix
+ if (!m_isContentInverted) {
+ m.flipY();
+ m.translate(0, -getSize().height());
+ }
+
TilesManager::instance()->shader()->drawLayerQuad(m, rect,
textureInfo->m_textureId,
1.0f); //TODO fix this m_drawOpacity
diff --git a/WebCore/platform/graphics/android/MediaLayer.h b/WebCore/platform/graphics/android/MediaLayer.h
index eb56440..1944512 100644
--- a/WebCore/platform/graphics/android/MediaLayer.h
+++ b/WebCore/platform/graphics/android/MediaLayer.h
@@ -54,6 +54,7 @@ public:
void setCurrentTextureInfo(TextureInfo* info) { m_currentTextureInfo = info; }
TextureInfo* getCurrentTextureInfo() const { return m_currentTextureInfo; }
+ void invertContents(bool invertContent) { m_isContentInverted = invertContent; }
private:
@@ -62,6 +63,7 @@ private:
TextureInfo* m_currentTextureInfo;
+ bool m_isContentInverted;
};
} // namespace WebCore