diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/media/video_renderer_impl.cc | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/webkit/glue/media/video_renderer_impl.cc b/webkit/glue/media/video_renderer_impl.cc index 9148baf..8660920 100644 --- a/webkit/glue/media/video_renderer_impl.cc +++ b/webkit/glue/media/video_renderer_impl.cc @@ -94,11 +94,8 @@ void VideoRendererImpl::Paint(skia::PlatformCanvas* canvas, // 2. No flipping nor mirroring. // 3. Canvas has pixel format ARGB8888. // 4. Canvas is opaque. -// 5. No image scaling required. // TODO(hclam): The fast paint method should support flipping and mirroring. // Disable the flipping and mirroring checks once we have it. -// TODO(sergeyu): Implement bilinear scaling in ScaleYUVToRGB32 (libswscale?) -// and use it for scaling in FastPaint(). bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect) { const SkMatrix& total_matrix = canvas->getTotalMatrix(); @@ -109,9 +106,7 @@ bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas, if (SkScalarNearlyZero(total_matrix.getSkewX()) && SkScalarNearlyZero(total_matrix.getSkewY()) && total_matrix.getScaleX() > 0 && - total_matrix.getScaleY() > 0 && - dest_rect.width() == video_size_.width() && - dest_rect.height() == video_size_.height()) { + total_matrix.getScaleY() > 0) { // Get the properties of the SkDevice and the clip rect. SkDevice* device = canvas->getDevice(); @@ -266,18 +261,21 @@ void VideoRendererImpl::FastPaint(media::VideoFrame* video_frame, bitmap.lockPixels(); // TODO(hclam): do rotation and mirroring here. - // TODO(sergeyu): implement bilinear scaling in ScaleYUVToRGB32 - // and use it here. - media::ConvertYUVToRGB32(frame_clip_y, - frame_clip_u, - frame_clip_v, - dest_rect_pointer, - frame_clip_width, - frame_clip_height, - video_frame->stride(media::VideoFrame::kYPlane), - video_frame->stride(media::VideoFrame::kUPlane), - bitmap.rowBytes(), - yuv_type); + // TODO(fbarchard): switch filtering based on performance. + media::ScaleYUVToRGB32(frame_clip_y, + frame_clip_u, + frame_clip_v, + dest_rect_pointer, + frame_clip_width, + frame_clip_height, + local_dest_irect.width(), + local_dest_irect.height(), + video_frame->stride(media::VideoFrame::kYPlane), + video_frame->stride(media::VideoFrame::kUPlane), + bitmap.rowBytes(), + yuv_type, + media::ROTATE_0, + media::FILTER_BILINEAR); bitmap.unlockPixels(); } } |