Chromium Code Reviews| Index: remoting/client/rectangle_update_decoder.cc |
| diff --git a/remoting/client/rectangle_update_decoder.cc b/remoting/client/rectangle_update_decoder.cc |
| index ffc95f07725602f5885782e10f3fc51847c2d48d..a360728f786e7acb5d284b93f8395bafb431c000 100644 |
| --- a/remoting/client/rectangle_update_decoder.cc |
| +++ b/remoting/client/rectangle_update_decoder.cc |
| @@ -30,6 +30,7 @@ RectangleUpdateDecoder::RectangleUpdateDecoder( |
| : task_runner_(task_runner), |
| consumer_(consumer), |
| source_size_(SkISize::Make(0, 0)), |
| + source_dpi_(SkIPoint::Make(0, 0)), |
| view_size_(SkISize::Make(0, 0)), |
| clip_area_(SkIRect::MakeEmpty()), |
| paint_scheduled_(false) { |
| @@ -75,6 +76,21 @@ void RectangleUpdateDecoder::DecodePacket(scoped_ptr<VideoPacket> packet, |
| } |
| } |
| + // If the source DPI has changed, store it. 96 is the default DPI as defined |
| + // in video.proto. |
| + SkIPoint source_dpi(SkIPoint::Make(packet->format().x_dpi(), |
| + packet->format().y_dpi())); |
| + if (source_dpi.x() == 0) { |
| + source_dpi.setX(96); |
|
Wez
2012/07/19 01:00:42
See comment elsewhere re faking the DPI here.
Jamie
2012/07/19 23:00:06
Done.
|
| + } |
| + if (source_dpi.y() == 0) { |
| + source_dpi.setY(96); |
| + } |
| + if (source_dpi != source_dpi_) { |
| + source_dpi_ = source_dpi; |
| + decoder_needs_reset = true; |
| + } |
| + |
| // If we've never seen a screen size, ignore the packet. |
| if (source_size_.isZero()) { |
| return; |
| @@ -82,7 +98,7 @@ void RectangleUpdateDecoder::DecodePacket(scoped_ptr<VideoPacket> packet, |
| if (decoder_needs_reset) { |
| decoder_->Initialize(source_size_); |
| - consumer_->SetSourceSize(source_size_); |
| + consumer_->SetSourceSize(source_size_, source_dpi_); |
| } |
| if (!decoder_->IsReadyForData()) { |