@@ -182,7 +182,7 @@ function checkEyesInValidationBox() {
182182 * @param {y } y - The y co-ordinate of the desired point to plot
183183 */
184184function drawCoordinates ( colour , x , y ) {
185- var ctx = document . getElementById ( "plotting_canvas" ) . getContext ( '2d' ) ;
185+ var ctx = document . getElementById ( "plotting_canvas" ) . getContext ( '2d' , { willReadFrequently : true } ) ;
186186 ctx . fillStyle = colour ; // Red color
187187 ctx . beginPath ( ) ;
188188 ctx . arc ( x , y , 5 , 0 , Math . PI * 2 , true ) ;
@@ -222,7 +222,7 @@ function paintCurrentFrame(canvas, width, height) {
222222 canvas . height = height ;
223223 }
224224
225- var ctx = canvas . getContext ( '2d' ) ;
225+ var ctx = canvas . getContext ( '2d' , { willReadFrequently : true } ) ;
226226 ctx . drawImage ( videoElement , 0 , 0 , canvas . width , canvas . height ) ;
227227}
228228
@@ -287,8 +287,8 @@ async function loop() {
287287 {
288288 // Get tracker object
289289 var tracker = webgazer . getTracker ( ) ;
290- faceOverlay . getContext ( '2d' ) . clearRect ( 0 , 0 , videoElement . videoWidth , videoElement . videoHeight ) ;
291- tracker . drawFaceOverlay ( faceOverlay . getContext ( '2d' ) , tracker . getPositions ( ) ) ;
290+ faceOverlay . getContext ( '2d' , { willReadFrequently : true } ) . clearRect ( 0 , 0 , videoElement . videoWidth , videoElement . videoHeight ) ;
291+ tracker . drawFaceOverlay ( faceOverlay . getContext ( '2d' , { willReadFrequently : true } ) , tracker . getPositions ( ) ) ;
292292 }
293293
294294 // Feedback box
0 commit comments