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

Unified Diff: chrome/renderer/media/video_renderer_impl.cc

Issue 42647: Fix a bug in VideoRendererImpl in scaling (Closed)
Patch Set: Created 11 years, 9 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: chrome/renderer/media/video_renderer_impl.cc
diff --git a/chrome/renderer/media/video_renderer_impl.cc b/chrome/renderer/media/video_renderer_impl.cc
index ac7a841e66784a8121968842bc7b1105b9c71170..542959f16083024de540fd466002ceba74a33bb8 100644
--- a/chrome/renderer/media/video_renderer_impl.cc
+++ b/chrome/renderer/media/video_renderer_impl.cc
@@ -42,9 +42,10 @@ void VideoRendererImpl::Paint(skia::PlatformCanvas* canvas,
static_cast<SkScalar>(dest_rect.y()));
if (dest_rect.width() != video_size_.width() ||
dest_rect.height() != video_size_.height()) {
- matrix.preScale(
- static_cast<SkScalar>(dest_rect.width() / video_size_.width()),
- static_cast<SkScalar>(dest_rect.height() / video_size_.height()));
+ matrix.preScale(SkIntToScalar(dest_rect.width()) /
+ SkIntToScalar(video_size_.width()),
+ SkIntToScalar(dest_rect.height()) /
+ SkIntToScalar(video_size_.height()));
}
canvas->drawBitmapMatrix(bitmap_, matrix, NULL);
}
« 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