Index: cc/video_layer_impl.cc |
diff --git a/cc/video_layer_impl.cc b/cc/video_layer_impl.cc |
index 9930a0c4eac8bd4b7e0dac633d74d82951699d99..6d671adf97e699c22e36e53ced004895a3422e1d 100644 |
--- a/cc/video_layer_impl.cc |
+++ b/cc/video_layer_impl.cc |
@@ -204,9 +204,9 @@ void VideoLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad |
gfx::Size codedSize = m_frame->coded_size(); |
// pixels for macroblocked formats. |
- const float texWidthScale = |
+ float texWidthScale = |
static_cast<float>(visibleRect.width()) / codedSize.width(); |
- const float texHeightScale = |
+ float texHeightScale = |
Ami GONE FROM CHROMIUM
2012/11/15 18:15:36
Undo these changes?
sheu
2012/11/15 19:46:38
They're applicable for the rest of the paths, so I
Ami GONE FROM CHROMIUM
2012/11/15 20:39:09
My point was that all you changed was dropping the
sheu
2012/11/15 22:20:53
Ah right, no-op change. Fixed.
|
static_cast<float>(visibleRect.height()) / codedSize.height(); |
switch (m_format) { |
@@ -215,7 +215,11 @@ void VideoLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad |
const FramePlane& yPlane = m_framePlanes[media::VideoFrame::kYPlane]; |
const FramePlane& uPlane = m_framePlanes[media::VideoFrame::kUPlane]; |
const FramePlane& vPlane = m_framePlanes[media::VideoFrame::kVPlane]; |
- gfx::SizeF texScale(texWidthScale, texHeightScale); |
+ // YUV software decoder uses CPU-allocated textures that have extra |
+ // padding past what coded_size_ reflects. |
Ami GONE FROM CHROMIUM
2012/11/15 18:15:36
I don't see how this CL changes things; how is yPl
sheu
2012/11/15 19:46:38
See video_frame.cc, where we do some extra alignme
Ami GONE FROM CHROMIUM
2012/11/15 20:39:09
I somehow missed the thunk below in videoFrameDime
|
+ gfx::SizeF texScale( |
+ static_cast<float>(visibleRect.width()) / yPlane.size.width(), |
Ami GONE FROM CHROMIUM
2012/11/15 20:39:09
What is this supposed to be scaling from/to?
My a
sheu
2012/11/15 22:20:53
We're not scaling to <video> dimensions -- that's
|
+ static_cast<float>(visibleRect.height()) / yPlane.size.height()); |
scoped_ptr<YUVVideoDrawQuad> yuvVideoQuad = YUVVideoDrawQuad::create( |
sharedQuadState, quadRect, texScale, yPlane, uPlane, vPlane); |
quadSink.append(yuvVideoQuad.PassAs<DrawQuad>(), appendQuadsData); |
@@ -287,18 +291,12 @@ void VideoLayerImpl::didDraw(ResourceProvider* resourceProvider) |
} |
static gfx::Size videoFrameDimension(media::VideoFrame* frame, int plane) { |
- gfx::Size dimensions = frame->coded_size(); |
+ gfx::Size dimensions = gfx::Size(frame->stride(plane), |
+ frame->coded_size().height()); |
switch (frame->format()) { |
case media::VideoFrame::YV12: |
- if (plane != media::VideoFrame::kYPlane) { |
- dimensions.set_width(dimensions.width() / 2); |
+ if (plane != media::VideoFrame::kYPlane) |
dimensions.set_height(dimensions.height() / 2); |
- } |
- break; |
- case media::VideoFrame::YV16: |
- if (plane != media::VideoFrame::kYPlane) { |
- dimensions.set_width(dimensions.width() / 2); |
- } |
break; |
default: |
break; |