diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-19 10:31:21 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-19 10:31:21 +0000 |
commit | 228b46159d1189b6b724533111d54b97dcd046e3 (patch) | |
tree | 4e60e41e5d53ec7d72fd38bdad8aed68409babc0 /remoting/codec/codec_test.cc | |
parent | 3e8d64d8d02af43c169f1074a90d7977bb21a793 (diff) | |
download | chromium_src-228b46159d1189b6b724533111d54b97dcd046e3.zip chromium_src-228b46159d1189b6b724533111d54b97dcd046e3.tar.gz chromium_src-228b46159d1189b6b724533111d54b97dcd046e3.tar.bz2 |
Remove dependency on Skia from chromoting client.
Now DesktopRegion, DesktopRect and DesktopSize are used instead of
corresponding skia types.
TBR=reed@google.com (for _moved_ skia dependency)
Review URL: https://chromiumcodereview.appspot.com/23440046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/codec/codec_test.cc')
-rw-r--r-- | remoting/codec/codec_test.cc | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/remoting/codec/codec_test.cc b/remoting/codec/codec_test.cc index 83d1035..26bd84c 100644 --- a/remoting/codec/codec_test.cc +++ b/remoting/codec/codec_test.cc @@ -64,12 +64,12 @@ class VideoDecoderTester { view_size_.width() * view_size_.height() * kBytesPerPixel]); EXPECT_TRUE(image_data_.get()); decoder_->Initialize( - SkISize::Make(screen_size_.width(), screen_size_.height())); + webrtc::DesktopSize(screen_size_.width(), screen_size_.height())); } void Reset() { expected_region_.Clear(); - update_region_.setEmpty(); + update_region_.Clear(); } void ResetRenderedData() { @@ -89,10 +89,9 @@ class VideoDecoderTester { void RenderFrame() { decoder_->RenderFrame( - SkISize::Make(view_size_.width(), view_size_.height()), - SkIRect::MakeWH(view_size_.width(), view_size_.height()), - image_data_.get(), - view_size_.width() * kBytesPerPixel, + webrtc::DesktopSize(view_size_.width(), view_size_.height()), + webrtc::DesktopRect::MakeWH(view_size_.width(), view_size_.height()), + image_data_.get(), view_size_.width() * kBytesPerPixel, &update_region_); } @@ -125,14 +124,10 @@ class VideoDecoderTester { ASSERT_TRUE(frame_); // Test the content of the update region. - webrtc::DesktopRegion update_region; - for (SkRegion::Iterator i(update_region_); !i.done(); i.next()) { - update_region.AddRect(webrtc::DesktopRect::MakeXYWH( - i.rect().x(), i.rect().y(), i.rect().width(), i.rect().height())); - } - EXPECT_TRUE(expected_region_.Equals(update_region)); + EXPECT_TRUE(expected_region_.Equals(update_region_)); - for (SkRegion::Iterator i(update_region_); !i.done(); i.next()) { + for (webrtc::DesktopRegion::Iterator i(update_region_); !i.IsAtEnd(); + i.Advance()) { const int stride = view_size_.width() * kBytesPerPixel; EXPECT_EQ(stride, frame_->stride()); const int offset = stride * i.rect().top() + @@ -157,7 +152,8 @@ class VideoDecoderTester { double max_error = 0.0; double sum_error = 0.0; int error_num = 0; - for (SkRegion::Iterator i(update_region_); !i.done(); i.next()) { + for (webrtc::DesktopRegion::Iterator i(update_region_); !i.IsAtEnd(); + i.Advance()) { const int stride = view_size_.width() * kBytesPerPixel; const int offset = stride * i.rect().top() + kBytesPerPixel * i.rect().left(); @@ -199,7 +195,7 @@ class VideoDecoderTester { DesktopSize view_size_; bool strict_; webrtc::DesktopRegion expected_region_; - SkRegion update_region_; + webrtc::DesktopRegion update_region_; VideoDecoder* decoder_; scoped_ptr<uint8[]> image_data_; webrtc::DesktopFrame* frame_; @@ -381,8 +377,9 @@ void TestVideoEncoderDecoderGradient(VideoEncoder* encoder, // invalidates the frame. decoder_tester.ResetRenderedData(); decoder->Invalidate( - SkISize::Make(view_size.width(), view_size.height()), - SkRegion(SkIRect::MakeWH(view_size.width(), view_size.height()))); + webrtc::DesktopSize(view_size.width(), view_size.height()), + webrtc::DesktopRegion( + webrtc::DesktopRect::MakeWH(view_size.width(), view_size.height()))); decoder_tester.RenderFrame(); decoder_tester.VerifyResultsApprox(expected_result->data(), max_error_limit, mean_error_limit); |