summaryrefslogtreecommitdiffstats
path: root/webkit/glue/media
diff options
context:
space:
mode:
authorpranavk@chromium.org <pranavk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 20:23:56 +0000
committerpranavk@chromium.org <pranavk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 20:23:56 +0000
commitfa54524d2c3291d0c1228f42878e6ce455d37039 (patch)
tree680d95644f9dcc7833d93a830f32fcc585ddd927 /webkit/glue/media
parentf6681e1fe9a938ab799daaef6a320e6ac4f1acb2 (diff)
downloadchromium_src-fa54524d2c3291d0c1228f42878e6ce455d37039.zip
chromium_src-fa54524d2c3291d0c1228f42878e6ce455d37039.tar.gz
chromium_src-fa54524d2c3291d0c1228f42878e6ce455d37039.tar.bz2
Calling slow video renderer in case opacity is not 1.0.
BUG=41057 TEST=load page http://ddstreet.org/chrome-video-opacity-bug/ and see that the video is translucent. Review URL: http://codereview.chromium.org/2848034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/media')
-rw-r--r--webkit/glue/media/video_renderer_impl.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/webkit/glue/media/video_renderer_impl.cc b/webkit/glue/media/video_renderer_impl.cc
index d1a4fdc..1ba51f2 100644
--- a/webkit/glue/media/video_renderer_impl.cc
+++ b/webkit/glue/media/video_renderer_impl.cc
@@ -95,6 +95,24 @@ void VideoRendererImpl::Paint(skia::PlatformCanvas* canvas,
// Disable the flipping and mirroring checks once we have it.
bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas,
const gfx::Rect& dest_rect) {
+ // Fast paint does not handle opacity value other than 1.0. Hence use slow
+ // paint if opacity is not 1.0. Since alpha = opacity * 0xFF, we check that
+ // alpha != 0xFF.
+ //
+ // Additonal notes: If opacity = 0.0, the chrome dispaly engine does not try
+ // to render the video. So, this method is never called. However, if the
+ // opacity = 0.0001, alpha is again 0, but the display engine tries to render
+ // the video. If we use Fast paint, the video shows up with opacity = 1.0.
+ // Hence we use slow paint also in the case where alpha = 0. It would be ideal
+ // if rendering was never called even for cases where alpha is 0. Created
+ // bug 48090 for this.
+ SkCanvas::LayerIter layer_iter(canvas, true);
+ SkColor sk_color = layer_iter.paint().getColor();
+ SkAlpha sk_alpha = SkColorGetA(sk_color);
+ if (sk_alpha != 0xFF) {
+ return false;
+ }
+
const SkMatrix& total_matrix = canvas->getTotalMatrix();
// Perform the following checks here:
// 1. Check for skewing factors of the transformation matrix. They should be
@@ -124,6 +142,7 @@ bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas,
return true;
}
}
+
return false;
}