[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] webglcontextrestored, WEBKIT_lose_context
- To: "Gregg Tavares (wrk)" <email@example.com>
- Subject: Re: [Public WebGL] webglcontextrestored, WEBKIT_lose_context
- From: James Robinson <firstname.lastname@example.org>
- Date: Tue, 12 Apr 2011 18:31:00 -0700
- Cc: Glenn Maynard <email@example.com>, public webgl <firstname.lastname@example.org>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1302658262; bh=64+LSRmo03wlDnkad2bndhCTVro=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type; b=t+MvAdq3TVSBCvncGUEffNc28piiUsu4wS8GWIGuIbD7spQm+rCNkNmD6GuIsxUQe aePgHIn0/DgMj4xRb7coA==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xD9GdvnIfmpCqStAVXeYA4/Na9bPESQw9ot79Qar1PI=; b=Or3XzwVM4iNugk2AanTuvgoIXtYwTmvlT3BaCX8OuevLKYfBX0QtOsGM0ARBymni5Q jTHNaMo/qBQ6sEHoBOAA==
- Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=fnufXRksJDa9hFdI715aPbtJV/tzzcBke8b1sW9PAQJAF96mVpsBVwp1ShDgTEsdEr 93Ue+t0ZaLBsuEpNPvHQ==
- In-reply-to: <BANLkTimL=FbOLsG+F8_Yj=Qst+V6CSBi6g@mail.gmail.com>
- List-id: Public WebGL Mailing List <public_webgl.khronos.org>
- References: <BANLkTik5L+UFV-NLZ5f2oN9NyvkX8OneTA@mail.gmail.com> <BANLkTimL=FbOLsG+F8_Yj=Qst+V6CSBi6g@mail.gmail.com>
- Sender: email@example.com
On Tue, Apr 12, 2011 at 6:22 PM, Gregg Tavares (wrk) <firstname.lastname@example.org>
The problem is the application HAS TO TAKE ACTION if the context is lost and restored. So, if an webgl auto-restores the context and the app doesn't handle it the results are random and unpredictable. All resources are lost and you have to re-create them. If the app is creating resources on the fly some will get re-created some not. It was deemed that unpredictability is bad. Adding a listener to "webglcontextlost" is a signal to WebGL that "this app is going to handle lost/restored context". Any app that doesn't handle it should fail immediately on context lost which is why it's not auto-restored.
The opposite way makes no sense. Apps that don't deal with lost-restored contexts are not going to start correctly marking themselves as unable to handle the situation. Rather, only apps that go to the effort to handle lost-restored contexts will tell WebGL they know how to handle it.
The default behavior with this proposal is that a lost context is permanent (since on a context loss without a webgllostcontext event handler the default action will occur and the context will be marked as permanently lost). The application has to opt-in to auto-restoring the context by registering a contextlost event handler that calls event.preventDefault().