<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Chris Marrin wrote:<br>
I think this is close. But I'm still concerned about the implicit sync point that happens when you call one rendering API after having used the other. I think it will lead to user confusion ("why did things get so much slower when I just added a string of text to the canvas? I guess text rendering is just really slow.") and bad habits. If users do [2D call, 3D call, 2D call, 3D call] it will be very slow but it's not clear why. If they do [enable2D, 2D call, enable3D, 3D call, enable2D, 2D call, enable3D, 3D call], it will be much more clear that the better approach is [enable 2D, 2D call, 2D call, enable 3D, 3D call, 3D call]. It is a more purposeful API and is more helpful to authors.
As Kenneth Waters pointed out, we don't NEED to have a synch mechanism, but I think it makes a better API. But I also agree that using getContext() for this unnecessarily overloads that call, so an explicit enable(...) call would be better.
<a class="moz-txt-link-abbreviated" href="mailto:email@example.com">firstname.lastname@example.org</a>
I agree that explicit sync points are needed. To really drive the point
home that switching between contexts is costly, the sync points should
be called waitContext("WebGL"), waitContext("2D"), etc. This naming
reflects what is actually happening. It also happens to be the name
used in EGL for this functionality: eglWaitAPI.<br>