| Index: content/browser/compositor/delegated_frame_host.cc
|
| diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc
|
| index a636ef2f25b3975f742cfdbb999a30e065ed8741..ae3efbb33444f5fe66d0b83badcb1925d73003bb 100644
|
| --- a/content/browser/compositor/delegated_frame_host.cc
|
| +++ b/content/browser/compositor/delegated_frame_host.cc
|
| @@ -300,10 +300,9 @@ void DelegatedFrameHost::DidReceiveFrameFromRenderer(
|
| request->set_source(frame_subscriber());
|
| request->set_area(gfx::Rect(current_frame_size_in_dip_));
|
| if (subscriber_texture.get()) {
|
| - request->SetTextureMailbox(
|
| - cc::TextureMailbox(subscriber_texture->mailbox(),
|
| - subscriber_texture->target(),
|
| - subscriber_texture->sync_point()));
|
| + request->SetTextureMailbox(cc::TextureMailbox(
|
| + subscriber_texture->mailbox(), subscriber_texture->target(),
|
| + subscriber_texture->sync_point(), subscriber_texture->sync_token()));
|
| }
|
| RequestCopyOfOutput(request.Pass());
|
| }
|
| @@ -599,7 +598,7 @@ static void CopyFromCompositingSurfaceFinished(
|
| sync_point = gl_helper->InsertSyncPoint();
|
| }
|
| bool lost_resource = sync_point == 0;
|
| - release_callback->Run(sync_point, lost_resource);
|
| + release_callback->Run(sync_point, gpu::SyncToken(), lost_resource);
|
|
|
| callback.Run(*bitmap,
|
| result ? content::READBACK_SUCCESS : content::READBACK_FAILED);
|
| @@ -644,17 +643,11 @@ void DelegatedFrameHost::PrepareTextureCopyOutputResult(
|
| ignore_result(scoped_callback_runner.Release());
|
|
|
| gl_helper->CropScaleReadbackAndCleanMailbox(
|
| - texture_mailbox.mailbox(),
|
| - texture_mailbox.sync_point(),
|
| - result->size(),
|
| - gfx::Rect(result->size()),
|
| - dst_size_in_pixel,
|
| - pixels,
|
| - color_type,
|
| - base::Bind(&CopyFromCompositingSurfaceFinished,
|
| - callback,
|
| - base::Passed(&release_callback),
|
| - base::Passed(&bitmap),
|
| + texture_mailbox.mailbox(), texture_mailbox.sync_point(),
|
| + texture_mailbox.sync_token(), result->size(), gfx::Rect(result->size()),
|
| + dst_size_in_pixel, pixels, color_type,
|
| + base::Bind(&CopyFromCompositingSurfaceFinished, callback,
|
| + base::Passed(&release_callback), base::Passed(&bitmap),
|
| base::Passed(&bitmap_pixels_lock)),
|
| GLHelper::SCALER_QUALITY_GOOD);
|
| }
|
| @@ -714,13 +707,14 @@ void DelegatedFrameHost::PrepareBitmapCopyOutputResult(
|
| void DelegatedFrameHost::ReturnSubscriberTexture(
|
| base::WeakPtr<DelegatedFrameHost> dfh,
|
| scoped_refptr<OwnedMailbox> subscriber_texture,
|
| - uint32 sync_point) {
|
| + uint32 sync_point,
|
| + const gpu::SyncToken& sync_token) {
|
| if (!subscriber_texture.get())
|
| return;
|
| if (!dfh)
|
| return;
|
|
|
| - subscriber_texture->UpdateSyncPoint(sync_point);
|
| + subscriber_texture->UpdateSyncPoint(sync_point, sync_token);
|
|
|
| if (dfh->frame_subscriber_ && subscriber_texture->texture_id())
|
| dfh->idle_frame_subscriber_textures_.push_back(subscriber_texture);
|
| @@ -745,9 +739,10 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceFinishedForVideo(
|
| // should be no |subscriber_texture|.
|
| DCHECK(!subscriber_texture.get());
|
| bool lost_resource = sync_point == 0;
|
| - release_callback->Run(sync_point, lost_resource);
|
| + release_callback->Run(sync_point, gpu::SyncToken(), lost_resource);
|
| }
|
| - ReturnSubscriberTexture(dfh, subscriber_texture, sync_point);
|
| + ReturnSubscriberTexture(dfh, subscriber_texture, sync_point,
|
| + gpu::SyncToken());
|
| }
|
|
|
| // static
|
| @@ -758,8 +753,8 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceHasResultForVideo(
|
| const base::Callback<void(bool)>& callback,
|
| scoped_ptr<cc::CopyOutputResult> result) {
|
| base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
|
| - base::ScopedClosureRunner scoped_return_subscriber_texture(
|
| - base::Bind(&ReturnSubscriberTexture, dfh, subscriber_texture, 0));
|
| + base::ScopedClosureRunner scoped_return_subscriber_texture(base::Bind(
|
| + &ReturnSubscriberTexture, dfh, subscriber_texture, 0, gpu::SyncToken()));
|
|
|
| if (!dfh)
|
| return;
|
| @@ -867,11 +862,10 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceHasResultForVideo(
|
| callback,
|
| subscriber_texture,
|
| base::Passed(&release_callback));
|
| - yuv_readback_pipeline->ReadbackYUV(texture_mailbox.mailbox(),
|
| - texture_mailbox.sync_point(),
|
| - video_frame.get(),
|
| - region_in_frame.origin(),
|
| - finished_callback);
|
| + yuv_readback_pipeline->ReadbackYUV(
|
| + texture_mailbox.mailbox(), texture_mailbox.sync_point(),
|
| + texture_mailbox.sync_token(), video_frame.get(), region_in_frame.origin(),
|
| + finished_callback);
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|