| Index: remoting/client/frame_consumer_proxy.cc
|
| diff --git a/remoting/client/frame_consumer_proxy.cc b/remoting/client/frame_consumer_proxy.cc
|
| index 65b84ed70b13e9468376f9175a4570c8f83af4aa..8da95c5379c951602ac76c2af73ce324e81a5229 100644
|
| --- a/remoting/client/frame_consumer_proxy.cc
|
| +++ b/remoting/client/frame_consumer_proxy.cc
|
| @@ -6,59 +6,60 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/message_loop.h"
|
| +#include "ppapi/cpp/image_data.h"
|
|
|
| namespace remoting {
|
|
|
| FrameConsumerProxy::FrameConsumerProxy(
|
| - FrameConsumer* frame_consumer,
|
| base::MessageLoopProxy* frame_consumer_message_loop)
|
| - : frame_consumer_(frame_consumer),
|
| + : frame_consumer_(NULL),
|
| frame_consumer_message_loop_(frame_consumer_message_loop) {
|
| }
|
|
|
| FrameConsumerProxy::~FrameConsumerProxy() {
|
| }
|
|
|
| -void FrameConsumerProxy::AllocateFrame(
|
| - media::VideoFrame::Format format,
|
| - const SkISize& size,
|
| - scoped_refptr<media::VideoFrame>* frame_out,
|
| - const base::Closure& done) {
|
| +void FrameConsumerProxy::PaintBuffer(const SkISize& view_size,
|
| + const SkIRect& clip_area,
|
| + pp::ImageData* buffer,
|
| + const SkRegion& region) {
|
| if (!frame_consumer_message_loop_->BelongsToCurrentThread()) {
|
| frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind(
|
| - &FrameConsumerProxy::AllocateFrame, this, format, size, frame_out,
|
| - done));
|
| + &FrameConsumerProxy::PaintBuffer, this,
|
| + view_size, clip_area, buffer, region));
|
| return;
|
| }
|
|
|
| - if (frame_consumer_) {
|
| - frame_consumer_->AllocateFrame(format, size, frame_out, done);
|
| - }
|
| + if (frame_consumer_)
|
| + frame_consumer_->PaintBuffer(view_size, clip_area, buffer, region);
|
| }
|
|
|
| -void FrameConsumerProxy::ReleaseFrame(media::VideoFrame* frame) {
|
| +void FrameConsumerProxy::ReturnBuffer(pp::ImageData* buffer) {
|
| if (!frame_consumer_message_loop_->BelongsToCurrentThread()) {
|
| frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind(
|
| - &FrameConsumerProxy::ReleaseFrame, this, make_scoped_refptr(frame)));
|
| + &FrameConsumerProxy::ReturnBuffer, this, buffer));
|
| return;
|
| }
|
|
|
| if (frame_consumer_)
|
| - frame_consumer_->ReleaseFrame(frame);
|
| + frame_consumer_->ReturnBuffer(buffer);
|
| }
|
|
|
| -void FrameConsumerProxy::OnPartialFrameOutput(media::VideoFrame* frame,
|
| - SkRegion* region,
|
| - const base::Closure& done) {
|
| +void FrameConsumerProxy::SetScreenSize(const SkISize& screen_size) {
|
| if (!frame_consumer_message_loop_->BelongsToCurrentThread()) {
|
| frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind(
|
| - &FrameConsumerProxy::OnPartialFrameOutput, this,
|
| - make_scoped_refptr(frame), region, done));
|
| + &FrameConsumerProxy::SetScreenSize, this, screen_size));
|
| return;
|
| }
|
|
|
| if (frame_consumer_)
|
| - frame_consumer_->OnPartialFrameOutput(frame, region, done);
|
| + frame_consumer_->SetScreenSize(screen_size);
|
| +}
|
| +
|
| +void FrameConsumerProxy::Attach(FrameConsumer* frame_consumer) {
|
| + DCHECK(frame_consumer_message_loop_->BelongsToCurrentThread());
|
| + DCHECK(frame_consumer_ == NULL);
|
| + frame_consumer_ = frame_consumer;
|
| }
|
|
|
| void FrameConsumerProxy::Detach() {
|
|
|