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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 1088903002: cc: VideoResourceUpdater: don't dismiss the sync_point given by the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass compositor sync_point with no previous sync point in media::VideoFrame Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index c0d6923fcf11724b20d5a06714a14862bbec59d5..dea3176c43d65f9e59193049b459298e25c51f24 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -27,15 +27,28 @@ const ResourceFormat kRGBResourceFormat = RGBA_8888;
class SyncPointClientImpl : public media::VideoFrame::SyncPointClient {
public:
- explicit SyncPointClientImpl(gpu::gles2::GLES2Interface* gl) : gl_(gl) {}
+ explicit SyncPointClientImpl(gpu::gles2::GLES2Interface* gl,
+ uint32 sync_point)
+ : gl_(gl), sync_point_(sync_point) {}
~SyncPointClientImpl() override {}
- uint32 InsertSyncPoint() override { return gl_->InsertSyncPointCHROMIUM(); }
+ uint32 InsertSyncPoint() override {
+ if (sync_point_)
+ return sync_point_;
+ return gl_->InsertSyncPointCHROMIUM();
+ }
void WaitSyncPoint(uint32 sync_point) override {
+ if (!sync_point)
+ return;
gl_->WaitSyncPointCHROMIUM(sync_point);
+ if (sync_point_) {
+ gl_->WaitSyncPointCHROMIUM(sync_point_);
+ sync_point_ = 0;
+ }
}
private:
gpu::gles2::GLES2Interface* gl_;
+ uint32 sync_point_;
};
} // namespace
@@ -375,10 +388,11 @@ void VideoResourceUpdater::ReturnTexture(
// resource.
if (lost_resource || !updater.get())
return;
- // VideoFrame::UpdateReleaseSyncPoint() creates new sync point using the same
- // GL context which created the given |sync_point|, so discard the
- // |sync_point|.
- SyncPointClientImpl client(updater->context_provider_->ContextGL());
+ // Update the release sync point in |video_frame| with |sync_point|
+ // returned by the compositor and emit a WaitSyncPointCHROMIUM on
+ // |video_frame|'s previous sync point using the current GL context.
+ SyncPointClientImpl client(updater->context_provider_->ContextGL(),
+ sync_point);
video_frame->UpdateReleaseSyncPoint(&client);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698