cancelled_ = true;
}
- virtual void DidComplete(const AsyncMemoryParams& mem_params) OVERRIDE {
+ void DidComplete(const AsyncMemoryParams& mem_params) override {
base::AutoLock locked(lock_);
if (!cancelled_) {
DCHECK(mem_params.buffer().get());
}
private:
- virtual ~AsyncPixelTransferCompletionObserverImpl() {}
+ ~AsyncPixelTransferCompletionObserverImpl() override {}
base::subtle::Atomic32 submit_count_;
AsyncPixelTransfersCompletedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
protected:
- virtual ~AsyncPixelTransfersCompletedQuery();
+ ~AsyncPixelTransfersCompletedQuery() override;
scoped_refptr<AsyncPixelTransferCompletionObserverImpl> observer_;
};
return AddToPendingTransferQueue(submit_count);
}
-bool AsyncPixelTransfersCompletedQuery::Process() {
+bool AsyncPixelTransfersCompletedQuery::Process(bool did_finish) {
QuerySync* sync = manager()->decoder()->GetSharedMemoryAs<QuerySync*>(
shm_id(), shm_offset(), sizeof(*sync));
if (!sync)
AllSamplesPassedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset,
GLuint service_id);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
protected:
- virtual ~AllSamplesPassedQuery();
+ ~AllSamplesPassedQuery() override;
private:
// Service side query id.
return AddToPendingQueue(submit_count);
}
-bool AllSamplesPassedQuery::Process() {
+bool AllSamplesPassedQuery::Process(bool did_finish) {
GLuint available = 0;
glGetQueryObjectuivARB(
service_id_, GL_QUERY_RESULT_AVAILABLE_EXT, &available);
CommandsIssuedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
protected:
- virtual ~CommandsIssuedQuery();
+ ~CommandsIssuedQuery() override;
private:
base::TimeTicks begin_time_;
return MarkAsCompleted(elapsed.InMicroseconds());
}
-bool CommandsIssuedQuery::Process() {
+bool CommandsIssuedQuery::Process(bool did_finish) {
NOTREACHED();
return true;
}
CommandLatencyQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
protected:
- virtual ~CommandLatencyQuery();
+ ~CommandLatencyQuery() override;
};
CommandLatencyQuery::CommandLatencyQuery(
return MarkAsCompleted(now.InMicroseconds());
}
-bool CommandLatencyQuery::Process() {
+bool CommandLatencyQuery::Process(bool did_finish) {
NOTREACHED();
return true;
}
AsyncReadPixelsCompletedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
protected:
void Complete();
- virtual ~AsyncReadPixelsCompletedQuery();
+ ~AsyncReadPixelsCompletedQuery() override;
private:
bool completed_;
base::Bind(&AsyncReadPixelsCompletedQuery::Complete,
AsWeakPtr()));
- return Process();
+ return Process(false);
}
void AsyncReadPixelsCompletedQuery::Complete() {
complete_result_ = MarkAsCompleted(1);
}
-bool AsyncReadPixelsCompletedQuery::Process() {
+bool AsyncReadPixelsCompletedQuery::Process(bool did_finish) {
return !completed_ || complete_result_;
}
GetErrorQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
protected:
- virtual ~GetErrorQuery();
+ ~GetErrorQuery() override;
private:
};
return MarkAsCompleted(manager()->decoder()->GetErrorState()->GetGLError());
}
-bool GetErrorQuery::Process() {
+bool GetErrorQuery::Process(bool did_finish) {
NOTREACHED();
return true;
}
uint32 shm_offset);
// Overridden from QueryManager::Query:
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ bool Begin() override;
+ bool End(base::subtle::Atomic32 submit_count) override;
+ bool Process(bool did_finish) override;
+ void Destroy(bool have_context) override;
protected:
- virtual ~CommandsCompletedQuery();
+ ~CommandsCompletedQuery() override;
private:
scoped_ptr<gfx::GLFence> fence_;
return AddToPendingQueue(submit_count);
}
-bool CommandsCompletedQuery::Process() {
- if (fence_ && !fence_->HasCompleted())
+bool CommandsCompletedQuery::Process(bool did_finish) {
+ // Note: |did_finish| guarantees that the GPU has passed the fence but
+ // we cannot assume that GLFence::HasCompleted() will return true yet as
+ // that's not guaranteed by all GLFence implementations.
+ //
+ // TODO(reveman): Add UMA stats to determine how common it is that glFinish()
+ // needs to be called for these queries to complete. crbug.com/431845
+ if (!did_finish && fence_ && !fence_->HasCompleted())
return true;
+
return MarkAsCompleted(0);
}
return true;
}
-bool QueryManager::ProcessPendingQueries() {
+bool QueryManager::ProcessPendingQueries(bool did_finish) {
while (!pending_queries_.empty()) {
Query* query = pending_queries_.front().get();
- if (!query->Process()) {
+ if (!query->Process(did_finish)) {
return false;
}
if (query->pending()) {
bool QueryManager::ProcessPendingTransferQueries() {
while (!pending_transfer_queries_.empty()) {
Query* query = pending_transfer_queries_.front().get();
- if (!query->Process()) {
+ if (!query->Process(false)) {
return false;
}
if (query->pending()) {