Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: webkit/glue/media/video_renderer_impl.cc

Issue 126093: Fixing a bug that <video> is not rendered if clipped/mirrored... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/media/video_renderer_impl.cc
===================================================================
--- webkit/glue/media/video_renderer_impl.cc (revision 18335)
+++ webkit/glue/media/video_renderer_impl.cc (working copy)
@@ -71,14 +71,23 @@
// 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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698