1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_ 7 8 #include "base/callback.h" 9 #include "gpu/command_buffer/common/capabilities.h" 10 #include "gpu/gpu_export.h" 11 #include "ui/gfx/gpu_memory_buffer.h" 12 13 namespace gpu { 14 class GpuMemoryBufferManagerInterface; 15 16 namespace gles2 { 17 class QueryManager; 18 } 19 20 class GPU_EXPORT GpuControlService { 21 public: 22 GpuControlService(GpuMemoryBufferManagerInterface* gpu_memory_buffer_manager, 23 gles2::QueryManager* query_manager); 24 virtual ~GpuControlService(); 25 26 void SignalQuery(uint32 query, const base::Closure& callback); 27 28 void RegisterGpuMemoryBuffer(int32 id, 29 gfx::GpuMemoryBufferHandle buffer, 30 size_t width, 31 size_t height, 32 unsigned internalformat); 33 void UnregisterGpuMemoryBuffer(int32 id); 34 35 private: 36 GpuMemoryBufferManagerInterface* gpu_memory_buffer_manager_; 37 gles2::QueryManager* query_manager_; 38 39 DISALLOW_COPY_AND_ASSIGN(GpuControlService); 40 }; 41 42 } // namespace gpu 43 44 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_CONTROL_SERVICE_H_ 45