Chromium Code Reviews| Index: Source/core/html/HTMLVideoElement.cpp |
| diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp |
| index ee23553a4c9e500c63f12224ca042cba5c80a069..6c15032860e2484bf3ed3a71ea8888e9ad8c44f8 100644 |
| --- a/Source/core/html/HTMLVideoElement.cpp |
| +++ b/Source/core/html/HTMLVideoElement.cpp |
| @@ -205,14 +205,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 |
|
Stephen White
2015/05/27 15:46:02
Please add a reference in the comment to the video
Justin Novosad
2015/05/27 20:08:16
Acknowledged.
|
| + 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) |
| @@ -313,7 +316,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); |