| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/atomicops.h" | 14 #include "base/atomicops.h" |
| 15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "gpu/command_buffer/service/feature_info.h" | 19 #include "gpu/command_buffer/service/feature_info.h" |
| 20 #include "gpu/gpu_export.h" | 20 #include "gpu/gpu_export.h" |
| 21 | 21 |
| 22 namespace gfx { | 22 namespace gl { |
| 23 class GPUTimer; | 23 class GPUTimer; |
| 24 class GPUTimingClient; | 24 class GPUTimingClient; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace gpu { | 27 namespace gpu { |
| 28 | 28 |
| 29 class GLES2Decoder; | 29 class GLES2Decoder; |
| 30 | 30 |
| 31 namespace gles2 { | 31 namespace gles2 { |
| 32 | 32 |
| 33 class FeatureInfo; | 33 class FeatureInfo; |
| 34 | 34 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // True if there are pending transfer queries. | 255 // True if there are pending transfer queries. |
| 256 bool HavePendingTransferQueries(); | 256 bool HavePendingTransferQueries(); |
| 257 | 257 |
| 258 // Do any updates we need to do when the frame has begun. | 258 // Do any updates we need to do when the frame has begun. |
| 259 void ProcessFrameBeginUpdates(); | 259 void ProcessFrameBeginUpdates(); |
| 260 | 260 |
| 261 GLES2Decoder* decoder() const { | 261 GLES2Decoder* decoder() const { |
| 262 return decoder_; | 262 return decoder_; |
| 263 } | 263 } |
| 264 | 264 |
| 265 std::unique_ptr<gfx::GPUTimer> CreateGPUTimer(bool elapsed_time); | 265 std::unique_ptr<gl::GPUTimer> CreateGPUTimer(bool elapsed_time); |
| 266 bool GPUTimingAvailable(); | 266 bool GPUTimingAvailable(); |
| 267 | 267 |
| 268 void GenQueries(GLsizei n, const GLuint* queries); | 268 void GenQueries(GLsizei n, const GLuint* queries); |
| 269 bool IsValidQuery(GLuint id); | 269 bool IsValidQuery(GLuint id); |
| 270 | 270 |
| 271 private: | 271 private: |
| 272 void StartTracking(Query* query); | 272 void StartTracking(Query* query); |
| 273 void StopTracking(Query* query); | 273 void StopTracking(Query* query); |
| 274 | 274 |
| 275 // Wrappers for BeginQueryARB and EndQueryARB to hide differences between | 275 // Wrappers for BeginQueryARB and EndQueryARB to hide differences between |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 typedef std::map<GLenum, scoped_refptr<Query> > ActiveQueryMap; | 331 typedef std::map<GLenum, scoped_refptr<Query> > ActiveQueryMap; |
| 332 ActiveQueryMap active_queries_; | 332 ActiveQueryMap active_queries_; |
| 333 | 333 |
| 334 // Queries waiting for completion. | 334 // Queries waiting for completion. |
| 335 typedef std::deque<scoped_refptr<Query> > QueryQueue; | 335 typedef std::deque<scoped_refptr<Query> > QueryQueue; |
| 336 QueryQueue pending_queries_; | 336 QueryQueue pending_queries_; |
| 337 | 337 |
| 338 // Async pixel transfer queries waiting for completion. | 338 // Async pixel transfer queries waiting for completion. |
| 339 QueryQueue pending_transfer_queries_; | 339 QueryQueue pending_transfer_queries_; |
| 340 | 340 |
| 341 scoped_refptr<gfx::GPUTimingClient> gpu_timing_client_; | 341 scoped_refptr<gl::GPUTimingClient> gpu_timing_client_; |
| 342 | 342 |
| 343 DISALLOW_COPY_AND_ASSIGN(QueryManager); | 343 DISALLOW_COPY_AND_ASSIGN(QueryManager); |
| 344 }; | 344 }; |
| 345 | 345 |
| 346 } // namespace gles2 | 346 } // namespace gles2 |
| 347 } // namespace gpu | 347 } // namespace gpu |
| 348 | 348 |
| 349 #endif // GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ | 349 #endif // GPU_COMMAND_BUFFER_SERVICE_QUERY_MANAGER_H_ |
| OLD | NEW |