diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-30 20:35:26 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-30 20:35:26 +0000 |
commit | bcad2686e10ff2ff31c21e2cc77bd1cee6482e9e (patch) | |
tree | 6000696a564ee1d3c005c63947d38e9486d75143 /remoting/client/rectangle_update_decoder.cc | |
parent | a31de5292f5facfeec460cd2defc0b131851fb7a (diff) | |
download | chromium_src-bcad2686e10ff2ff31c21e2cc77bd1cee6482e9e.zip chromium_src-bcad2686e10ff2ff31c21e2cc77bd1cee6482e9e.tar.gz chromium_src-bcad2686e10ff2ff31c21e2cc77bd1cee6482e9e.tar.bz2 |
Move us fully from gfx:: over to skia types for consistency.
BUG=92085
TEST=BUILD
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=103523
Review URL: http://codereview.chromium.org/7992011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/rectangle_update_decoder.cc')
-rw-r--r-- | remoting/client/rectangle_update_decoder.cc | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/remoting/client/rectangle_update_decoder.cc b/remoting/client/rectangle_update_decoder.cc index b96b7ba..b653e27 100644 --- a/remoting/client/rectangle_update_decoder.cc +++ b/remoting/client/rectangle_update_decoder.cc @@ -20,7 +20,7 @@ namespace remoting { class PartialFrameCleanup : public Task { public: - PartialFrameCleanup(media::VideoFrame* frame, UpdatedRects* rects, + PartialFrameCleanup(media::VideoFrame* frame, RectVector* rects, RectangleUpdateDecoder* decoder) : frame_(frame), rects_(rects), decoder_(decoder) { } @@ -36,7 +36,7 @@ class PartialFrameCleanup : public Task { private: scoped_refptr<media::VideoFrame> frame_; - UpdatedRects* rects_; + RectVector* rects_; scoped_refptr<RectangleUpdateDecoder> decoder_; }; @@ -52,8 +52,8 @@ RectangleUpdateDecoder::~RectangleUpdateDecoder() { } void RectangleUpdateDecoder::Initialize(const SessionConfig& config) { - initial_screen_size_ = gfx::Size(config.initial_resolution().width, - config.initial_resolution().height); + initial_screen_size_ = SkISize::Make(config.initial_resolution().width, + config.initial_resolution().height); // Initialize decoder based on the selected codec. ChannelConfig::Codec codec = config.video_config().codec; @@ -98,16 +98,20 @@ void RectangleUpdateDecoder::AllocateFrame(const VideoPacket* packet, // Find the required frame size. bool has_screen_size = packet->format().has_screen_width() && packet->format().has_screen_height(); - gfx::Size screen_size(packet->format().screen_width(), - packet->format().screen_height()); + SkISize screen_size(SkISize::Make(packet->format().screen_width(), + packet->format().screen_height())); if (!has_screen_size) screen_size = initial_screen_size_; // Find the current frame size. - gfx::Size frame_size(0, 0); - if (frame_) - frame_size = gfx::Size(static_cast<int>(frame_->width()), - static_cast<int>(frame_->height())); + int width = 0; + int height = 0; + if (frame_) { + width = static_cast<int>(frame_->width()); + height = static_cast<int>(frame_->height()); + } + + SkISize frame_size(SkISize::Make(width, height)); // Allocate a new frame, if necessary. if ((!frame_) || (has_screen_size && (screen_size != frame_size))) { @@ -175,7 +179,7 @@ void RectangleUpdateDecoder::SetScaleRatios(double horizontal_ratio, decoder_->SetScaleRatios(horizontal_ratio, vertical_ratio); } -void RectangleUpdateDecoder::UpdateClipRect(const gfx::Rect& new_clip_rect) { +void RectangleUpdateDecoder::UpdateClipRect(const SkIRect& new_clip_rect) { if (message_loop_ != MessageLoop::current()) { message_loop_->PostTask( FROM_HERE, @@ -189,36 +193,36 @@ void RectangleUpdateDecoder::UpdateClipRect(const gfx::Rect& new_clip_rect) { return; // Find out the rectangles to show because of clip rect is updated. - if (new_clip_rect.y() < clip_rect_.y()) { + if (new_clip_rect.fTop < clip_rect_.fTop) { refresh_rects_.push_back( - gfx::Rect(new_clip_rect.x(), - new_clip_rect.y(), - new_clip_rect.width(), - clip_rect_.y() - new_clip_rect.y())); + SkIRect::MakeXYWH(new_clip_rect.fLeft, + new_clip_rect.fTop, + new_clip_rect.width(), + clip_rect_.fTop - new_clip_rect.fTop)); } - if (new_clip_rect.x() < clip_rect_.x()) { + if (new_clip_rect.fLeft < clip_rect_.fLeft) { refresh_rects_.push_back( - gfx::Rect(new_clip_rect.x(), - clip_rect_.y(), - clip_rect_.x() - new_clip_rect.x(), - clip_rect_.height())); + SkIRect::MakeXYWH(new_clip_rect.fLeft, + clip_rect_.fTop, + clip_rect_.fLeft - new_clip_rect.fLeft, + clip_rect_.height())); } - if (new_clip_rect.right() > clip_rect_.right()) { + if (new_clip_rect.fRight > clip_rect_.fRight) { refresh_rects_.push_back( - gfx::Rect(clip_rect_.right(), - clip_rect_.y(), - new_clip_rect.right() - clip_rect_.right(), - new_clip_rect.height())); + SkIRect::MakeXYWH(clip_rect_.fRight, + clip_rect_.fTop, + new_clip_rect.fRight - clip_rect_.fRight, + new_clip_rect.height())); } - if (new_clip_rect.bottom() > clip_rect_.bottom()) { + if (new_clip_rect.fBottom > clip_rect_.fBottom) { refresh_rects_.push_back( - gfx::Rect(new_clip_rect.x(), - clip_rect_.bottom(), - new_clip_rect.width(), - new_clip_rect.bottom() - clip_rect_.bottom())); + SkIRect::MakeXYWH(new_clip_rect.fLeft, + clip_rect_.fBottom, + new_clip_rect.width(), + new_clip_rect.fBottom - clip_rect_.fBottom)); } clip_rect_ = new_clip_rect; @@ -240,8 +244,8 @@ void RectangleUpdateDecoder::RefreshFullFrame() { return; refresh_rects_.push_back( - gfx::Rect(0, 0, static_cast<int>(frame_->width()), - static_cast<int>(frame_->height()))); + SkIRect::MakeWH(static_cast<int>(frame_->width()), + static_cast<int>(frame_->height()))); DoRefresh(); } @@ -251,7 +255,7 @@ void RectangleUpdateDecoder::SubmitToConsumer() { if (!frame_) return; - UpdatedRects* dirty_rects = new UpdatedRects(); + RectVector* dirty_rects = new RectVector(); decoder_->GetUpdatedRects(dirty_rects); frame_is_consuming_ = true; |