| Index: Source/core/html/canvas/WebGLQuery.cpp
|
| diff --git a/Source/core/html/canvas/WebGLQuery.cpp b/Source/core/html/canvas/WebGLQuery.cpp
|
| index 58c5f0c83fbf8072f77d1213f0a87b200988ad29..9fff37db0c1d4c06643f2a4151486c5b8a0e0f73 100644
|
| --- a/Source/core/html/canvas/WebGLQuery.cpp
|
| +++ b/Source/core/html/canvas/WebGLQuery.cpp
|
| @@ -29,10 +29,34 @@ WebGLQuery::~WebGLQuery()
|
|
|
| WebGLQuery::WebGLQuery(WebGL2RenderingContextBase* ctx)
|
| : WebGLSharedPlatform3DObject(ctx)
|
| + , m_target(0)
|
| {
|
| setObject(ctx->webContext()->createQueryEXT());
|
| }
|
|
|
| +void WebGLQuery::setTarget(GLenum target)
|
| +{
|
| + ASSERT(object());
|
| + ASSERT(isCompatibleTarget(target));
|
| + m_target = target;
|
| +}
|
| +
|
| +bool WebGLQuery::isCompatibleTarget(GLenum target)
|
| +{
|
| + if (!m_target)
|
| + return true;
|
| +
|
| + switch (target) {
|
| + // The SAMPLES_PASSED targets are interchangable.
|
| + case GL_ANY_SAMPLES_PASSED:
|
| + case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
|
| + return m_target == GL_ANY_SAMPLES_PASSED || m_target == GL_ANY_SAMPLES_PASSED_CONSERVATIVE;
|
| + // Otherwise target is finalized the first time beginQuery() is called.
|
| + default:
|
| + return m_target == target;
|
| + }
|
| +}
|
| +
|
| void WebGLQuery::deleteObjectImpl(WebGraphicsContext3D* context3d)
|
| {
|
| context3d->deleteQueryEXT(m_object);
|
|
|