| Index: Source/core/html/HTMLVideoElement.cpp
|
| diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
|
| index 65ec218f8e1d5b28c0de930d09954a38ff915fbe..9e3d4d1cb23a8f8c1d02698538baf5fbf709e84b 100644
|
| --- a/Source/core/html/HTMLVideoElement.cpp
|
| +++ b/Source/core/html/HTMLVideoElement.cpp
|
| @@ -200,14 +200,17 @@ void HTMLVideoElement::updateDisplayState()
|
| setDisplayMode(Poster);
|
| }
|
|
|
| -void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& destRect) const
|
| +void HTMLVideoElement::paintCurrentFrame(SkCanvas* canvas, const IntRect& destRect, const SkPaint* paint) const
|
| {
|
| if (!webMediaPlayer())
|
| return;
|
|
|
| - WebCanvas* canvas = context->canvas();
|
| - SkXfermode::Mode mode = context->compositeOperation();
|
| - webMediaPlayer()->paint(canvas, destRect, context->getNormalizedAlpha(), mode);
|
| + SkXfermode::Mode mode;
|
| + if (!paint || !SkXfermode::AsMode(paint->getXfermode(), &mode))
|
| + mode = SkXfermode::kSrcOver_Mode;
|
| +
|
| + // TODO(junov, philipj): pass the whole SkPaint instead of only alpha and xfermode
|
| + webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF, mode);
|
| }
|
|
|
| bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* context, Platform3DObject texture, GLint level, GLenum internalFormat, GLenum type, bool premultiplyAlpha, bool flipY)
|
| @@ -308,7 +311,7 @@ PassRefPtr<Image> HTMLVideoElement::getSourceImageForCanvas(SourceImageMode mode
|
| return nullptr;
|
| }
|
|
|
| - paintCurrentFrameInContext(imageBuffer->context(), IntRect(IntPoint(0, 0), intrinsicSize));
|
| + paintCurrentFrame(imageBuffer->canvas(), IntRect(IntPoint(0, 0), intrinsicSize), nullptr);
|
|
|
| *status = (mode == CopySourceImageIfVolatile) ? NormalSourceImageStatus : ExternalSourceImageStatus;
|
| return imageBuffer->copyImage(mode == CopySourceImageIfVolatile ? CopyBackingStore : DontCopyBackingStore, Unscaled);
|
|
|