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

Side by Side Diff: gpu/command_buffer/service/in_process_command_buffer.h

Issue 24925002: Move Insert/SignalSyncPoint() to GpuControl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_IN_PROCESS_COMMAND_BUFFER_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool Initialize(scoped_refptr<gfx::GLSurface> surface, 80 bool Initialize(scoped_refptr<gfx::GLSurface> surface,
81 bool is_offscreen, 81 bool is_offscreen,
82 bool share_resources, 82 bool share_resources,
83 gfx::AcceleratedWidget window, 83 gfx::AcceleratedWidget window,
84 const gfx::Size& size, 84 const gfx::Size& size,
85 const std::vector<int32>& attribs, 85 const std::vector<int32>& attribs,
86 gfx::GpuPreference gpu_preference, 86 gfx::GpuPreference gpu_preference,
87 const base::Closure& context_lost_callback, 87 const base::Closure& context_lost_callback,
88 unsigned int share_group_id); 88 unsigned int share_group_id);
89 void Destroy(); 89 void Destroy();
90 void SignalSyncPoint(unsigned sync_point,
91 const base::Closure& callback);
92 90
93 // CommandBuffer implementation: 91 // CommandBuffer implementation:
94 virtual bool Initialize() OVERRIDE; 92 virtual bool Initialize() OVERRIDE;
95 virtual State GetState() OVERRIDE; 93 virtual State GetState() OVERRIDE;
96 virtual State GetLastState() OVERRIDE; 94 virtual State GetLastState() OVERRIDE;
97 virtual int32 GetLastToken() OVERRIDE; 95 virtual int32 GetLastToken() OVERRIDE;
98 virtual void Flush(int32 put_offset) OVERRIDE; 96 virtual void Flush(int32 put_offset) OVERRIDE;
99 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE; 97 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE;
100 virtual void SetGetBuffer(int32 shm_id) OVERRIDE; 98 virtual void SetGetBuffer(int32 shm_id) OVERRIDE;
101 virtual void SetGetOffset(int32 get_offset) OVERRIDE; 99 virtual void SetGetOffset(int32 get_offset) OVERRIDE;
102 virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE; 100 virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE;
103 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; 101 virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
104 virtual gpu::Buffer GetTransferBuffer(int32 id) OVERRIDE; 102 virtual gpu::Buffer GetTransferBuffer(int32 id) OVERRIDE;
105 virtual void SetToken(int32 token) OVERRIDE; 103 virtual void SetToken(int32 token) OVERRIDE;
106 virtual void SetParseError(gpu::error::Error error) OVERRIDE; 104 virtual void SetParseError(gpu::error::Error error) OVERRIDE;
107 virtual void SetContextLostReason( 105 virtual void SetContextLostReason(
108 gpu::error::ContextLostReason reason) OVERRIDE; 106 gpu::error::ContextLostReason reason) OVERRIDE;
109 virtual uint32 InsertSyncPoint() OVERRIDE;
110 virtual gpu::error::Error GetLastError() OVERRIDE; 107 virtual gpu::error::Error GetLastError() OVERRIDE;
111 108
112 // GpuControl implementation: 109 // GpuControl implementation:
113 virtual bool SupportsGpuMemoryBuffer() OVERRIDE; 110 virtual bool SupportsGpuMemoryBuffer() OVERRIDE;
114 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( 111 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
115 size_t width, 112 size_t width,
116 size_t height, 113 size_t height,
117 unsigned internalformat, 114 unsigned internalformat,
118 int32* id) OVERRIDE; 115 int32* id) OVERRIDE;
119 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; 116 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
117 virtual uint32 InsertSyncPoint() OVERRIDE;
118 virtual void SignalSyncPoint(uint32 sync_point,
119 const base::Closure& callback) OVERRIDE;
120 120
121 // The serializer interface to the GPU service (i.e. thread). 121 // The serializer interface to the GPU service (i.e. thread).
122 class SchedulerClient { 122 class SchedulerClient {
123 public: 123 public:
124 virtual ~SchedulerClient() {} 124 virtual ~SchedulerClient() {}
125 virtual void QueueTask(const base::Closure& task) = 0; 125 virtual void QueueTask(const base::Closure& task) = 0;
126 }; 126 };
127 127
128 #if defined(OS_ANDROID) 128 #if defined(OS_ANDROID)
129 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( 129 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // Only used with explicit scheduling and the gpu thread is the same as 184 // Only used with explicit scheduling and the gpu thread is the same as
185 // the client thread. 185 // the client thread.
186 scoped_ptr<base::SequenceChecker> sequence_checker_; 186 scoped_ptr<base::SequenceChecker> sequence_checker_;
187 187
188 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); 188 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer);
189 }; 189 };
190 190
191 } // namespace gpu 191 } // namespace gpu
192 192
193 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ 193 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698