| Index: gpu/command_buffer/service/query_manager.cc
|
| diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
|
| index 14a4ab4858178d32066f96253bca458621f31813..0f94d46397aa9535a6db8ad266684ff1235ee313 100644
|
| --- a/gpu/command_buffer/service/query_manager.cc
|
| +++ b/gpu/command_buffer/service/query_manager.cc
|
| @@ -7,7 +7,7 @@
|
| #include "base/logging.h"
|
| #include "base/time.h"
|
| #include "gpu/command_buffer/common/gles2_cmd_format.h"
|
| -#include "gpu/command_buffer/service/common_decoder.h"
|
| +#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
|
| #include "gpu/command_buffer/service/feature_info.h"
|
|
|
| namespace gpu {
|
| @@ -120,8 +120,52 @@ void CommandsIssuedQuery::Destroy(bool /* have_context */) {
|
| CommandsIssuedQuery::~CommandsIssuedQuery() {
|
| }
|
|
|
| +class GetErrorQuery : public QueryManager::Query {
|
| + public:
|
| + GetErrorQuery(
|
| + QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
|
| +
|
| + virtual bool Begin() OVERRIDE;
|
| + virtual bool End(uint32 submit_count) OVERRIDE;
|
| + virtual bool Process() OVERRIDE;
|
| + virtual void Destroy(bool have_context) OVERRIDE;
|
| +
|
| + protected:
|
| + virtual ~GetErrorQuery();
|
| +
|
| + private:
|
| +};
|
| +
|
| +GetErrorQuery::GetErrorQuery(
|
| + QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
|
| + : Query(manager, target, shm_id, shm_offset) {
|
| +}
|
| +
|
| +bool GetErrorQuery::Begin() {
|
| + return true;
|
| +}
|
| +
|
| +bool GetErrorQuery::End(uint32 submit_count) {
|
| + MarkAsPending(submit_count);
|
| + return MarkAsCompleted(manager()->decoder()->GetGLError());
|
| +}
|
| +
|
| +bool GetErrorQuery::Process() {
|
| + NOTREACHED();
|
| + return true;
|
| +}
|
| +
|
| +void GetErrorQuery::Destroy(bool /* have_context */) {
|
| + if (!IsDeleted()) {
|
| + MarkAsDeleted();
|
| + }
|
| +}
|
| +
|
| +GetErrorQuery::~GetErrorQuery() {
|
| +}
|
| +
|
| QueryManager::QueryManager(
|
| - CommonDecoder* decoder,
|
| + GLES2Decoder* decoder,
|
| FeatureInfo* feature_info)
|
| : decoder_(decoder),
|
| use_arb_occlusion_query2_for_occlusion_query_boolean_(
|
| @@ -159,6 +203,9 @@ QueryManager::Query* QueryManager::CreateQuery(
|
| case GL_COMMANDS_ISSUED_CHROMIUM:
|
| query = new CommandsIssuedQuery(this, target, shm_id, shm_offset);
|
| break;
|
| + case GL_GET_ERROR_QUERY_CHROMIUM:
|
| + query = new GetErrorQuery(this, target, shm_id, shm_offset);
|
| + break;
|
| default: {
|
| GLuint service_id = 0;
|
| glGenQueriesARB(1, &service_id);
|
| @@ -253,7 +300,7 @@ QueryManager::Query::~Query() {
|
| bool QueryManager::Query::MarkAsCompleted(GLuint result) {
|
| DCHECK(pending_);
|
| QuerySync* sync = manager_->decoder_->GetSharedMemoryAs<QuerySync*>(
|
| - shm_id_, shm_offset_, sizeof(*sync));
|
| + shm_id_, shm_offset_, sizeof(*sync));
|
| if (!sync) {
|
| return false;
|
| }
|
|
|