Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3407)

Unified Diff: gpu/command_buffer/tests/gl_manager.h

Issue 235563002: gpu: Separate GpuControlService from GpuControl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove MailboxManager Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/tests/gl_manager.h
diff --git a/gpu/command_buffer/tests/gl_manager.h b/gpu/command_buffer/tests/gl_manager.h
index 6eb5909515907615d3d11b8d7ba285089a95f552..7b51b9e271404cd002a0a450ee22753e34e2a844 100644
--- a/gpu/command_buffer/tests/gl_manager.h
+++ b/gpu/command_buffer/tests/gl_manager.h
@@ -5,8 +5,10 @@
#ifndef GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_
#define GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_
+#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "ui/gfx/size.h"
@@ -39,7 +41,7 @@ class ShareGroup;
};
-class GLManager {
+class GLManager : private GpuControl {
public:
struct Options {
Options();
@@ -63,7 +65,7 @@ class GLManager {
GpuMemoryBufferFactory* gpu_memory_buffer_factory;
};
GLManager();
- ~GLManager();
+ virtual ~GLManager();
void Initialize(const Options& options);
void Destroy();
@@ -94,6 +96,23 @@ class GLManager {
const gpu::gles2::FeatureInfo::Workarounds& workarounds() const;
+ // GpuControl implementation.
+ virtual Capabilities GetCapabilities() OVERRIDE;
+ virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
+ size_t height,
+ unsigned internalformat,
+ int32* id) OVERRIDE;
+ virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
+ virtual uint32 InsertSyncPoint() OVERRIDE;
+ virtual void SignalSyncPoint(uint32 sync_point,
+ const base::Closure& callback) OVERRIDE;
+ virtual void SignalQuery(uint32 query,
+ const base::Closure& callback) OVERRIDE;
+ virtual void SetSurfaceVisible(bool visible) OVERRIDE;
+ virtual void SendManagedMemoryStats(const ManagedMemoryStats& stats) OVERRIDE;
+ virtual void Echo(const base::Closure& callback) OVERRIDE;
+ virtual uint32 CreateStreamTexture(uint32 texture_id) OVERRIDE;
+
private:
void PumpCommands();
bool GetBufferChanged(int32 transfer_buffer_id);
@@ -102,7 +121,7 @@ class GLManager {
scoped_refptr<gles2::MailboxManager> mailbox_manager_;
scoped_refptr<gfx::GLShareGroup> share_group_;
scoped_ptr<CommandBufferService> command_buffer_;
- scoped_ptr<GpuControlService> gpu_control_;
+ scoped_ptr<GpuControlService> gpu_control_service_;
scoped_ptr<gles2::GLES2Decoder> decoder_;
scoped_ptr<GpuScheduler> gpu_scheduler_;
scoped_refptr<gfx::GLSurface> surface_;
@@ -112,6 +131,10 @@ class GLManager {
scoped_ptr<gles2::GLES2Implementation> gles2_implementation_;
bool context_lost_allowed_;
+ // Client GpuControl implementation.
+ GpuMemoryBufferFactory* gpu_memory_buffer_factory_;
+ base::ScopedPtrHashMap<int32, gfx::GpuMemoryBuffer> memory_buffers_;
+
// Used on Android to virtualize GL for all contexts.
static int use_count_;
static scoped_refptr<gfx::GLShareGroup>* base_share_group_;

Powered by Google App Engine
This is Rietveld 408576698