зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1167504 - Part 9: Remove BindableName - Queries. r=jgilbert
This commit is contained in:
Родитель
bdc3ac4601
Коммит
da00b1f5f9
|
@ -93,8 +93,8 @@ WebGLExtensionDisjointTimerQuery::BeginQueryEXT(GLenum target,
|
|||
|
||||
mContext->MakeContextCurrent();
|
||||
gl::GLContext* gl = mContext->GL();
|
||||
gl->fBeginQuery(target, query->GLName());
|
||||
query->BindTo(LOCAL_GL_TIME_ELAPSED_EXT);
|
||||
gl->fBeginQuery(target, query->mGLName);
|
||||
query->mTarget = LOCAL_GL_TIME_ELAPSED_EXT;
|
||||
mActiveQuery = query;
|
||||
}
|
||||
|
||||
|
@ -137,8 +137,8 @@ WebGLExtensionDisjointTimerQuery::QueryCounterEXT(WebGLTimerQuery* query,
|
|||
}
|
||||
|
||||
mContext->MakeContextCurrent();
|
||||
mContext->GL()->fQueryCounter(query->GLName(), target);
|
||||
query->BindTo(LOCAL_GL_TIMESTAMP_EXT);
|
||||
mContext->GL()->fQueryCounter(query->mGLName, target);
|
||||
query->mTarget = LOCAL_GL_TIMESTAMP_EXT;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -210,7 +210,7 @@ WebGLExtensionDisjointTimerQuery::GetQueryObjectEXT(JSContext* cx,
|
|||
switch (pname) {
|
||||
case LOCAL_GL_QUERY_RESULT_EXT: {
|
||||
GLuint64 result = 0;
|
||||
mContext->GL()->fGetQueryObjectui64v(query->GLName(),
|
||||
mContext->GL()->fGetQueryObjectui64v(query->mGLName,
|
||||
LOCAL_GL_QUERY_RESULT_EXT,
|
||||
&result);
|
||||
retval.set(JS::NumberValue(result));
|
||||
|
@ -218,7 +218,7 @@ WebGLExtensionDisjointTimerQuery::GetQueryObjectEXT(JSContext* cx,
|
|||
}
|
||||
case LOCAL_GL_QUERY_RESULT_AVAILABLE_EXT: {
|
||||
GLuint avail = 0;
|
||||
mContext->GL()->fGetQueryObjectuiv(query->GLName(),
|
||||
mContext->GL()->fGetQueryObjectuiv(query->mGLName,
|
||||
LOCAL_GL_QUERY_RESULT_AVAILABLE_EXT,
|
||||
&avail);
|
||||
retval.set(JS::BooleanValue(bool(avail)));
|
||||
|
|
|
@ -92,6 +92,11 @@ TranslateWithoutValidation(const nsACString& sourceNS, bool isWebGL2,
|
|||
|
||||
switch (glesslVersion) {
|
||||
case 100:
|
||||
if (!versionStrLen) {
|
||||
/* According to ARB_ES2_compatibility extension glsl
|
||||
* should accept #version 100 for ES 2 shaders. */
|
||||
reversionedSource.insert(versionStrStart, "#version 100\n");
|
||||
}
|
||||
break;
|
||||
case 300:
|
||||
reversionedSource.insert(versionStrStart, "#version 330\n");
|
||||
|
|
|
@ -20,11 +20,17 @@ WebGLTimerQuery::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
|
|||
}
|
||||
|
||||
WebGLTimerQuery::WebGLTimerQuery(WebGLContext* webgl, GLuint aName)
|
||||
: WebGLBindableName<QueryBinding>(aName)
|
||||
, WebGLContextBoundObject(webgl)
|
||||
: WebGLContextBoundObject(webgl)
|
||||
, mGLName(aName)
|
||||
, mTarget(LOCAL_GL_NONE)
|
||||
{
|
||||
}
|
||||
|
||||
WebGLTimerQuery::~WebGLTimerQuery()
|
||||
{
|
||||
DeleteOnce();
|
||||
}
|
||||
|
||||
WebGLTimerQuery*
|
||||
WebGLTimerQuery::Create(WebGLContext* webgl)
|
||||
{
|
||||
|
@ -41,6 +47,13 @@ WebGLTimerQuery::Delete()
|
|||
mContext->gl->fDeleteQueries(1, &mGLName);
|
||||
}
|
||||
|
||||
WebGLContext*
|
||||
WebGLTimerQuery::GetParentObject() const
|
||||
{
|
||||
return Context();
|
||||
}
|
||||
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLTimerQuery)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLTimerQuery, AddRef)
|
||||
|
|
|
@ -14,32 +14,32 @@ namespace mozilla {
|
|||
|
||||
class WebGLTimerQuery final
|
||||
: public nsWrapperCache
|
||||
, public WebGLBindableName<QueryBinding>
|
||||
, public WebGLRefCountedObject<WebGLTimerQuery>
|
||||
, public WebGLContextBoundObject
|
||||
{
|
||||
public:
|
||||
static WebGLTimerQuery* Create(WebGLContext* webgl);
|
||||
|
||||
// WebGLRefCountedObject
|
||||
void Delete();
|
||||
|
||||
// nsWrapperCache
|
||||
WebGLContext* GetParentObject() const {
|
||||
return Context();
|
||||
}
|
||||
bool HasEverBeenBound() const { return mTarget != LOCAL_GL_NONE; }
|
||||
GLenum Target() const { return mTarget; }
|
||||
|
||||
WebGLContext* GetParentObject() const;
|
||||
|
||||
// NS
|
||||
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
const GLenum mGLName;
|
||||
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTimerQuery)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTimerQuery)
|
||||
|
||||
private:
|
||||
explicit WebGLTimerQuery(WebGLContext* webgl, GLuint aName);
|
||||
~WebGLTimerQuery() {
|
||||
DeleteOnce();
|
||||
}
|
||||
~WebGLTimerQuery();
|
||||
|
||||
GLenum mTarget;
|
||||
|
||||
friend class WebGLExtensionDisjointTimerQuery;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче