Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: remoting/host/screen_recorder_unittest.cc

Issue 7622002: Revert 96327 - Switch over to using SkRegions to calculate dirty areas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/host/x_server_pixel_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/screen_recorder_unittest.cc
===================================================================
--- remoting/host/screen_recorder_unittest.cc (revision 96327)
+++ remoting/host/screen_recorder_unittest.cc (working copy)
@@ -31,9 +31,13 @@
namespace {
-ACTION_P2(RunCallback, region, data) {
- SkRegion& dirty_region = data->mutable_dirty_region();
- dirty_region.op(region, SkRegion::kUnion_Op);
+ACTION_P2(RunCallback, rects, data) {
+ InvalidRects& dirty_rects = data->mutable_dirty_rects();
+ InvalidRects temp_rects;
+ std::set_union(dirty_rects.begin(), dirty_rects.end(),
+ rects.begin(), rects.end(),
+ std::inserter(temp_rects, temp_rects.begin()));
+ dirty_rects.swap(temp_rects);
arg0->Run(data);
delete arg0;
}
@@ -103,7 +107,8 @@
// This test mocks capturer, encoder and network layer to operate one recording
// cycle.
TEST_F(ScreenRecorderTest, OneRecordCycle) {
- SkRegion update_region(SkIRect::MakeXYWH(0, 0, 10, 10));
+ InvalidRects update_rects;
+ update_rects.insert(gfx::Rect(0, 0, 10, 10));
DataPlanes planes;
for (int i = 0; i < DataPlanes::kPlaneCount; ++i) {
planes.data[i] = reinterpret_cast<uint8*>(i);
@@ -114,8 +119,8 @@
EXPECT_CALL(capturer_, InvalidateFullScreen());
// First the capturer is called.
- EXPECT_CALL(capturer_, CaptureInvalidRegion(NotNull()))
- .WillOnce(RunCallback(update_region, data));
+ EXPECT_CALL(capturer_, CaptureInvalidRects(NotNull()))
+ .WillOnce(RunCallback(update_rects, data));
// Expect the encoder be called.
EXPECT_CALL(*encoder_, Encode(data, false, NotNull()))
@@ -151,7 +156,8 @@
// ScreenRecorder is instructed to come to a complete stop. We expect the stop
// sequence to be executed successfully.
TEST_F(ScreenRecorderTest, StartAndStop) {
- SkRegion update_region(SkIRect::MakeXYWH(0, 0, 10, 10));
+ InvalidRects update_rects;
+ update_rects.insert(gfx::Rect(0, 0, 10, 10));
DataPlanes planes;
for (int i = 0; i < DataPlanes::kPlaneCount; ++i) {
planes.data[i] = reinterpret_cast<uint8*>(i);
@@ -163,8 +169,8 @@
EXPECT_CALL(capturer_, InvalidateFullScreen());
// First the capturer is called.
- EXPECT_CALL(capturer_, CaptureInvalidRegion(NotNull()))
- .WillRepeatedly(RunCallback(update_region, data));
+ EXPECT_CALL(capturer_, CaptureInvalidRects(NotNull()))
+ .WillRepeatedly(RunCallback(update_rects, data));
// Expect the encoder be called.
EXPECT_CALL(*encoder_, Encode(data, false, NotNull()))
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/host/x_server_pixel_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698