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

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

Issue 7932005: Reland r101418: Fix aspect ratio and clarify video frame dimensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | « webkit/glue/media/video_renderer_impl.h ('k') | webkit/glue/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/media/video_renderer_impl.cc
diff --git a/webkit/glue/media/video_renderer_impl.cc b/webkit/glue/media/video_renderer_impl.cc
index 70dbe7a9aa0b26d4aad47973849720d8e4f92d5b..4532935fe769556bbda873796e4773a777363619 100644
--- a/webkit/glue/media/video_renderer_impl.cc
+++ b/webkit/glue/media/video_renderer_impl.cc
@@ -21,9 +21,9 @@ VideoRendererImpl::VideoRendererImpl(bool pts_logging)
VideoRendererImpl::~VideoRendererImpl() {}
bool VideoRendererImpl::OnInitialize(media::VideoDecoder* decoder) {
- video_size_.SetSize(decoder->width(), decoder->height());
+ natural_size_ = decoder->natural_size();
bitmap_.setConfig(SkBitmap::kARGB_8888_Config,
- decoder->width(), decoder->height());
+ natural_size_.width(), natural_size_.height());
bitmap_.allocPixels();
bitmap_.eraseRGB(0x00, 0x00, 0x00);
bitmap_.setIsVolatile(true);
@@ -162,12 +162,12 @@ void VideoRendererImpl::SlowPaint(media::VideoFrame* video_frame,
SkMatrix matrix;
matrix.setTranslate(static_cast<SkScalar>(dest_rect.x()),
static_cast<SkScalar>(dest_rect.y()));
- if (dest_rect.width() != video_size_.width() ||
- dest_rect.height() != video_size_.height()) {
+ if (dest_rect.width() != natural_size_.width() ||
+ dest_rect.height() != natural_size_.height()) {
matrix.preScale(SkIntToScalar(dest_rect.width()) /
- SkIntToScalar(video_size_.width()),
+ SkIntToScalar(natural_size_.width()),
SkIntToScalar(dest_rect.height()) /
- SkIntToScalar(video_size_.height()));
+ SkIntToScalar(natural_size_.height()));
}
SkPaint paint;
paint.setFlags(SkPaint::kFilterBitmap_Flag);
« no previous file with comments | « webkit/glue/media/video_renderer_impl.h ('k') | webkit/glue/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698