diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-19 21:24:28 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-19 21:24:28 +0000 |
commit | b4e50594c117da39d9d65beed489acc3ce4cd35e (patch) | |
tree | eb321c268adbabfc85ad3dae6931be64c2f92150 /remoting/codec/codec_test.cc | |
parent | c45d12c0186dbf6a1ffdbb7cb45a15c2366d9dcf (diff) | |
download | chromium_src-b4e50594c117da39d9d65beed489acc3ce4cd35e.zip chromium_src-b4e50594c117da39d9d65beed489acc3ce4cd35e.tar.gz chromium_src-b4e50594c117da39d9d65beed489acc3ce4cd35e.tar.bz2 |
Revert 224101 "Remove dependency on Skia from chromoting client."
> 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
TBR=sergeyu@chromium.org
Review URL: https://codereview.chromium.org/24217003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224205 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, 17 insertions, 14 deletions
diff --git a/remoting/codec/codec_test.cc b/remoting/codec/codec_test.cc index 26bd84c..83d1035 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( - webrtc::DesktopSize(screen_size_.width(), screen_size_.height())); + SkISize::Make(screen_size_.width(), screen_size_.height())); } void Reset() { expected_region_.Clear(); - update_region_.Clear(); + update_region_.setEmpty(); } void ResetRenderedData() { @@ -89,9 +89,10 @@ class VideoDecoderTester { void RenderFrame() { decoder_->RenderFrame( - webrtc::DesktopSize(view_size_.width(), view_size_.height()), - webrtc::DesktopRect::MakeWH(view_size_.width(), view_size_.height()), - image_data_.get(), view_size_.width() * kBytesPerPixel, + SkISize::Make(view_size_.width(), view_size_.height()), + SkIRect::MakeWH(view_size_.width(), view_size_.height()), + image_data_.get(), + view_size_.width() * kBytesPerPixel, &update_region_); } @@ -124,10 +125,14 @@ class VideoDecoderTester { ASSERT_TRUE(frame_); // Test the content of the update region. - EXPECT_TRUE(expected_region_.Equals(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)); - for (webrtc::DesktopRegion::Iterator i(update_region_); !i.IsAtEnd(); - i.Advance()) { + for (SkRegion::Iterator i(update_region_); !i.done(); i.next()) { const int stride = view_size_.width() * kBytesPerPixel; EXPECT_EQ(stride, frame_->stride()); const int offset = stride * i.rect().top() + @@ -152,8 +157,7 @@ class VideoDecoderTester { double max_error = 0.0; double sum_error = 0.0; int error_num = 0; - for (webrtc::DesktopRegion::Iterator i(update_region_); !i.IsAtEnd(); - i.Advance()) { + for (SkRegion::Iterator i(update_region_); !i.done(); i.next()) { const int stride = view_size_.width() * kBytesPerPixel; const int offset = stride * i.rect().top() + kBytesPerPixel * i.rect().left(); @@ -195,7 +199,7 @@ class VideoDecoderTester { DesktopSize view_size_; bool strict_; webrtc::DesktopRegion expected_region_; - webrtc::DesktopRegion update_region_; + SkRegion update_region_; VideoDecoder* decoder_; scoped_ptr<uint8[]> image_data_; webrtc::DesktopFrame* frame_; @@ -377,9 +381,8 @@ void TestVideoEncoderDecoderGradient(VideoEncoder* encoder, // invalidates the frame. decoder_tester.ResetRenderedData(); decoder->Invalidate( - webrtc::DesktopSize(view_size.width(), view_size.height()), - webrtc::DesktopRegion( - webrtc::DesktopRect::MakeWH(view_size.width(), view_size.height()))); + SkISize::Make(view_size.width(), view_size.height()), + SkRegion(SkIRect::MakeWH(view_size.width(), view_size.height()))); decoder_tester.RenderFrame(); decoder_tester.VerifyResultsApprox(expected_result->data(), max_error_limit, mean_error_limit); |