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..e69564f817184bef78c6b22d56974628af7aa048 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) { |
@@ -64,7 +65,7 @@ void RectangleUpdateDecoder::DecodePacket(scoped_ptr<VideoPacket> packet, |
base::ScopedClosureRunner done_runner(done); |
bool decoder_needs_reset = false; |
- // If the packet includes a screen size, store it. |
+ // If the packet includes screen size or DPI information, store them. |
if (packet->format().has_screen_width() && |
packet->format().has_screen_height()) { |
SkISize source_size = SkISize::Make(packet->format().screen_width(), |
@@ -74,6 +75,14 @@ void RectangleUpdateDecoder::DecodePacket(scoped_ptr<VideoPacket> packet, |
decoder_needs_reset = true; |
} |
} |
+ if (packet->format().has_x_dpi() && packet->format().has_y_dpi()) { |
+ SkIPoint source_dpi(SkIPoint::Make(packet->format().x_dpi(), |
+ packet->format().y_dpi())); |
+ if (source_dpi != source_dpi_) { |
+ source_dpi_ = source_dpi; |
+ decoder_needs_reset = true; |
Wez
2012/07/19 23:15:29
nit: The Decoder doesn't actually need resetting,
Jamie
2012/07/20 00:42:14
Done.
|
+ } |
+ } |
// If we've never seen a screen size, ignore the packet. |
if (source_size_.isZero()) { |
@@ -82,7 +91,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()) { |