summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorlionel.g.landwerlin <lionel.g.landwerlin@intel.com>2015-04-16 04:48:31 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-16 11:48:46 +0000
commitee1b10bd38de9e6f96e491bd30c63577e22a9bae (patch)
tree03d4611c6b5c1634b0d562ea05199facf68a64de /cc
parent7b45a34b0d0da16f07829b471d01d878ac170da2 (diff)
downloadchromium_src-ee1b10bd38de9e6f96e491bd30c63577e22a9bae.zip
chromium_src-ee1b10bd38de9e6f96e491bd30c63577e22a9bae.tar.gz
chromium_src-ee1b10bd38de9e6f96e491bd30c63577e22a9bae.tar.bz2
cc: VideoResourceUpdater: don't dismiss the sync_point given by the compositor
When the compositor is done using a video texture, it returns a sync_point associated with the last use of this texture. We appear to drop this sync_point on the floor, neither waiting on it, nor associating it to the video frame returned to the GpuVideoDecoder. This change emits a WaitSyncPointCHROMIUM on the compositor sync point when updating the renderer's media::VideoFrame release sync point. BUG=chrome-os-partner:37786 Review URL: https://codereview.chromium.org/1088903002 Cr-Commit-Position: refs/heads/master@{#325416}
Diffstat (limited to 'cc')
-rw-r--r--cc/resources/video_resource_updater.cc26
1 files changed, 20 insertions, 6 deletions
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index c0d6923..dea3176 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);
}