summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 18:14:24 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 18:14:24 +0000
commitb322410675b8f505ef0820792a2494b4037d4c50 (patch)
tree6afec2b08a95b1969690c0bec813839a8c64d2c2
parent176c8f3187a3b956ad2ec58648e50e83762b88db (diff)
downloadchromium_src-b322410675b8f505ef0820792a2494b4037d4c50.zip
chromium_src-b322410675b8f505ef0820792a2494b4037d4c50.tar.gz
chromium_src-b322410675b8f505ef0820792a2494b4037d4c50.tar.bz2
Fixing a bug that <video> is not rendered if clipped/mirrored
Since we are not using the YUV->RGB code to perform fast flipping and mirroring. Use FastPaint to handle flipping and mirroring was wrong. There's no plan to support fast flipping and mirroring in the short future so fall back to SlowPaint for this case. Review URL: http://codereview.chromium.org/126093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18403 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/media/video_renderer_impl.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/webkit/glue/media/video_renderer_impl.cc b/webkit/glue/media/video_renderer_impl.cc
index 2b6720f..52a01af1 100644
--- a/webkit/glue/media/video_renderer_impl.cc
+++ b/webkit/glue/media/video_renderer_impl.cc
@@ -71,14 +71,23 @@ void VideoRendererImpl::Paint(skia::PlatformCanvas* canvas,
// CanFastPaint is a helper method to determine the conditions for fast
// painting. The conditions are:
-// 1. No skew in canvas matrix.
-// 2. Canvas has pixel format ARGB8888.
-// 3. Canvas is opaque.
+// 1. No skew in canvas matrix.
+// 2. No flipping nor mirroring.
+// 3. Canvas has pixel format ARGB8888.
+// 4. Canvas is opaque.
+// TODO(hclam): The fast paint method should support flipping and mirroring.
+// Disable the flipping and mirroring checks once we have it.
bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas,
const gfx::Rect& dest_rect) {
const SkMatrix& total_matrix = canvas->getTotalMatrix();
+ // Perform the following checks here:
+ // 1. Check for skewing factors of the transformation matrix. They should be
+ // zero.
+ // 2. Check for mirroring and flipping. Make sure they are greater than zero.
if (SkScalarNearlyZero(total_matrix.getSkewX()) &&
- SkScalarNearlyZero(total_matrix.getSkewY())) {
+ SkScalarNearlyZero(total_matrix.getSkewY()) &&
+ total_matrix.getScaleX() > 0 &&
+ total_matrix.getScaleY() > 0) {
// Get the properties of the SkDevice and the clip rect.
SkDevice* device = canvas->getDevice();