Commit 111d31ef authored by alexeypa@chromium.org's avatar alexeypa@chromium.org

Remove unused VideoFrameCapturer::size_most_recent() method.

BUG=104544


Review URL: https://chromiumcodereview.appspot.com/11821004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175734 0039d316-1c4b-4281-b951-d872f2087c98
parent c572f5c8
......@@ -21,7 +21,6 @@ class MockVideoFrameCapturer : public VideoFrameCapturer {
MOCK_METHOD0(Stop, void());
MOCK_METHOD1(InvalidateRegion, void(const SkRegion& invalid_region));
MOCK_METHOD0(CaptureFrame, void());
MOCK_CONST_METHOD0(size_most_recent, const SkISize&());
private:
DISALLOW_COPY_AND_ASSIGN(MockVideoFrameCapturer);
......
......@@ -107,9 +107,6 @@ class VideoFrameCapturer {
// data of the previous capture. There can be at most one concurrent read
// going on when this method is called.
virtual void CaptureFrame() = 0;
// Get the size of the most recently captured screen.
virtual const SkISize& size_most_recent() const = 0;
};
} // namespace remoting
......
......@@ -70,10 +70,6 @@ void VideoFrameCapturerFake::CaptureFrame() {
delegate_->OnCaptureCompleted(capture_data);
}
const SkISize& VideoFrameCapturerFake::size_most_recent() const {
return helper_.size_most_recent();
}
void VideoFrameCapturerFake::GenerateImage() {
memset(buffers_[current_buffer_].get(), 0xff,
size_.width() * size_.height() * CaptureData::kBytesPerPixel);
......
......@@ -29,7 +29,6 @@ class VideoFrameCapturerFake : public VideoFrameCapturer {
virtual void Stop() OVERRIDE;
virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE;
virtual void CaptureFrame() OVERRIDE;
virtual const SkISize& size_most_recent() const OVERRIDE;
private:
// Generates an image in the front buffer.
......
......@@ -62,7 +62,6 @@ class VideoFrameCapturerLinux : public VideoFrameCapturer {
virtual void Stop() OVERRIDE;
virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE;
virtual void CaptureFrame() OVERRIDE;
virtual const SkISize& size_most_recent() const OVERRIDE;
private:
void InitXDamage();
......@@ -589,10 +588,6 @@ void VideoFrameCapturerLinux::SlowBlit(uint8* image, const SkIRect& rect,
}
}
const SkISize& VideoFrameCapturerLinux::size_most_recent() const {
return helper_.size_most_recent();
}
} // namespace
// static
......
......@@ -112,7 +112,6 @@ class VideoFrameCapturerMac : public VideoFrameCapturer {
virtual void Stop() OVERRIDE;
virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE;
virtual void CaptureFrame() OVERRIDE;
virtual const SkISize& size_most_recent() const OVERRIDE;
private:
void CaptureCursor();
......@@ -653,10 +652,6 @@ void VideoFrameCapturerMac::CgBlitPostLion(const VideoFrame& buffer,
}
}
const SkISize& VideoFrameCapturerMac::size_most_recent() const {
return helper_.size_most_recent();
}
void VideoFrameCapturerMac::ScreenConfigurationChanged() {
// Release existing buffers, which will be of the wrong size.
ReleaseBuffers();
......
......@@ -86,7 +86,6 @@ class VideoFrameCapturerWin : public VideoFrameCapturer {
virtual void Stop() OVERRIDE;
virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE;
virtual void CaptureFrame() OVERRIDE;
virtual const SkISize& size_most_recent() const OVERRIDE;
private:
// Make sure that the device contexts match the screen configuration.
......@@ -275,10 +274,6 @@ void VideoFrameCapturerWin::CaptureFrame() {
CaptureCursor();
}
const SkISize& VideoFrameCapturerWin::size_most_recent() const {
return helper_.size_most_recent();
}
void VideoFrameCapturerWin::Start(Delegate* delegate) {
DCHECK(delegate_ == NULL);
......
......@@ -217,6 +217,8 @@ void DesktopSessionAgent::OnCaptureCompleted(
scoped_refptr<CaptureData> capture_data) {
DCHECK(video_capture_task_runner()->BelongsToCurrentThread());
current_size_ = capture_data->size();
// Serialize CaptureData
SerializedCapturedData serialized_data;
serialized_data.shared_buffer_id = capture_data->shared_buffer()->id();
......@@ -341,7 +343,7 @@ void DesktopSessionAgent::OnInvalidateRegion(
return;
}
SkIRect bounds = SkIRect::MakeSize(video_capturer_->size_most_recent());
SkIRect bounds = SkIRect::MakeSize(current_size_);
// Convert |invalid_rects| into a region.
SkRegion invalid_region;
......@@ -512,6 +514,7 @@ DesktopSessionAgent::DesktopSessionAgent(
input_task_runner_(input_task_runner),
io_task_runner_(io_task_runner),
video_capture_task_runner_(video_capture_task_runner),
current_size_(SkISize::Make(0, 0)),
next_shared_buffer_id_(1),
started_(false) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
......
......@@ -22,6 +22,7 @@
#include "remoting/host/ui_strings.h"
#include "remoting/protocol/clipboard_stub.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkSize.h"
namespace IPC {
class ChannelProxy;
......@@ -225,6 +226,9 @@ class DesktopSessionAgent
// IPC channel connecting the desktop process with the network process.
scoped_ptr<IPC::ChannelProxy> network_channel_;
// Size of the most recent captured video frame.
SkISize current_size_;
// Next shared buffer ID to be used.
int next_shared_buffer_id_;
......
......@@ -13,8 +13,7 @@ namespace remoting {
IpcVideoFrameCapturer::IpcVideoFrameCapturer(
scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
: delegate_(NULL),
desktop_session_proxy_(desktop_session_proxy),
size_most_recent_(SkISize::Make(0, 0)) {
desktop_session_proxy_(desktop_session_proxy) {
}
IpcVideoFrameCapturer::~IpcVideoFrameCapturer() {
......@@ -38,15 +37,8 @@ void IpcVideoFrameCapturer::CaptureFrame() {
desktop_session_proxy_->CaptureFrame();
}
const SkISize& IpcVideoFrameCapturer::size_most_recent() const {
return size_most_recent_;
}
void IpcVideoFrameCapturer::OnCaptureCompleted(
scoped_refptr<CaptureData> capture_data) {
if (capture_data)
size_most_recent_ = capture_data->size();
if (delegate_)
delegate_->OnCaptureCompleted(capture_data);
}
......
......@@ -30,7 +30,6 @@ class IpcVideoFrameCapturer : public VideoFrameCapturer {
virtual void Stop() OVERRIDE;
virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE;
virtual void CaptureFrame() OVERRIDE;
virtual const SkISize& size_most_recent() const OVERRIDE;
// Called when a video frame has been captured. |capture_data| describes
// a captured frame.
......@@ -46,9 +45,6 @@ class IpcVideoFrameCapturer : public VideoFrameCapturer {
// Wraps the IPC channel to the desktop session agent.
scoped_refptr<DesktopSessionProxy> desktop_session_proxy_;
// Size of the most recent captured frame.
SkISize size_most_recent_;
DISALLOW_COPY_AND_ASSIGN(IpcVideoFrameCapturer);
};
......
......@@ -73,7 +73,7 @@ MockVideoEncoder::~MockVideoEncoder() {}
class VideoSchedulerTest : public testing::Test {
public:
VideoSchedulerTest() : size_(SkISize::Make(0, 0)) {
VideoSchedulerTest() {
}
virtual void SetUp() OVERRIDE {
......@@ -104,7 +104,6 @@ class VideoSchedulerTest : public testing::Test {
// The following mock objects are owned by VideoScheduler.
MockVideoEncoder* encoder_;
SkISize size_;
scoped_refptr<CaptureData> data_;
private:
......@@ -125,15 +124,12 @@ void VideoSchedulerTest::GenerateOnCaptureCompleted() {
TEST_F(VideoSchedulerTest, StartAndStop) {
Expectation capturer_start = EXPECT_CALL(capturer_, Start(_));
size_.set(kWidth, kHeight);
data_ = new CaptureData(NULL, kWidth * CaptureData::kBytesPerPixel, size_);
data_ = new CaptureData(NULL, kWidth * CaptureData::kBytesPerPixel,
SkISize::Make(kWidth, kHeight));
// Create a RunLoop through which to drive |message_loop_|.
base::RunLoop run_loop;
EXPECT_CALL(capturer_, size_most_recent())
.WillRepeatedly(ReturnRef(size_));
// First the capturer is called.
Expectation capturer_capture = EXPECT_CALL(capturer_, CaptureFrame())
.After(capturer_start)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment