aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas/webgl_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-10-02 09:07:04 -0400
committerGitHub <noreply@github.com>2019-10-02 09:07:04 -0400
commit13a43e69e0fa16540ec02b6fc3569202470e9e5d (patch)
tree2156ca28bf21ec26a41bca94a0cc5ec0a8610ec3 /components/canvas/webgl_thread.rs
parentb6df281b80927621a8c7b2eca7c5f7b24511e525 (diff)
parent248545ddda503e06bc59b5274c63a6c25da4b355 (diff)
downloadservo-13a43e69e0fa16540ec02b6fc3569202470e9e5d.tar.gz
servo-13a43e69e0fa16540ec02b6fc3569202470e9e5d.zip
Auto merge of #24250 - imiklos:webglsync, r=jdm
Initial implementation of WebGLSync This patch adds initial support for [WebGLSync](https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.14). Note: There is no test for the isSync, deleteSync and waitSync functions in the `conformance2/sync/sync-webgl-specific.html`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24250) <!-- Reviewable:end -->
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r--components/canvas/webgl_thread.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index 6fa60d3d7c3..65eeff2a7c1 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -1360,6 +1360,33 @@ impl WebGLImpl {
}
sender.send(value[0] != 0).unwrap()
},
+ WebGLCommand::FenceSync(ref sender) => {
+ let value = ctx.gl().fence_sync(gl::SYNC_GPU_COMMANDS_COMPLETE, 0);
+ sender
+ .send(unsafe { WebGLSyncId::new(value as u64) })
+ .unwrap();
+ },
+ WebGLCommand::IsSync(sync_id, ref sender) => {
+ let value = ctx.gl().is_sync(sync_id.get() as *const _);
+ sender.send(value).unwrap();
+ },
+ WebGLCommand::ClientWaitSync(sync_id, flags, timeout, ref sender) => {
+ let value =
+ ctx.gl()
+ .client_wait_sync(sync_id.get() as *const _, flags, timeout as u64);
+ sender.send(value).unwrap();
+ },
+ WebGLCommand::WaitSync(sync_id, flags, timeout) => {
+ ctx.gl()
+ .wait_sync(sync_id.get() as *const _, flags, timeout as u64);
+ },
+ WebGLCommand::GetSyncParameter(sync_id, param, ref sender) => {
+ let value = ctx.gl().get_sync_iv(sync_id.get() as *const _, param);
+ sender.send(value[0] as u32).unwrap();
+ },
+ WebGLCommand::DeleteSync(sync_id) => {
+ ctx.gl().delete_sync(sync_id.get() as *const _);
+ },
WebGLCommand::GetParameterBool4(param, ref sender) => {
let mut value = [0; 4];
unsafe {