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

Side by Side Diff: gpu/gles2_conform_support/egl/display.cc

Issue 235563002: gpu: Separate GpuControlService from GpuControl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "gpu/gles2_conform_support/egl/display.h" 5 #include "gpu/gles2_conform_support/egl/display.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "gpu/command_buffer/client/gles2_implementation.h" 10 #include "gpu/command_buffer/client/gles2_implementation.h"
11 #include "gpu/command_buffer/client/gles2_lib.h" 11 #include "gpu/command_buffer/client/gles2_lib.h"
12 #include "gpu/command_buffer/client/transfer_buffer.h" 12 #include "gpu/command_buffer/client/transfer_buffer.h"
13 #include "gpu/command_buffer/service/context_group.h" 13 #include "gpu/command_buffer/service/context_group.h"
14 #include "gpu/command_buffer/service/gpu_control_service.h"
15 #include "gpu/command_buffer/service/transfer_buffer_manager.h" 14 #include "gpu/command_buffer/service/transfer_buffer_manager.h"
16 #include "gpu/gles2_conform_support/egl/config.h" 15 #include "gpu/gles2_conform_support/egl/config.h"
17 #include "gpu/gles2_conform_support/egl/surface.h" 16 #include "gpu/gles2_conform_support/egl/surface.h"
18 17
19 namespace { 18 namespace {
20 const int32 kCommandBufferSize = 1024 * 1024; 19 const int32 kCommandBufferSize = 1024 * 1024;
21 const int32 kTransferBufferSize = 512 * 1024; 20 const int32 kTransferBufferSize = 512 * 1024;
22 } 21 }
23 22
24 namespace egl { 23 namespace egl {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 162
164 if (!decoder_->Initialize(gl_surface_.get(), 163 if (!decoder_->Initialize(gl_surface_.get(),
165 gl_context_.get(), 164 gl_context_.get(),
166 gl_surface_->IsOffscreen(), 165 gl_surface_->IsOffscreen(),
167 size, 166 size,
168 gpu::gles2::DisallowedFeatures(), 167 gpu::gles2::DisallowedFeatures(),
169 attribs)) { 168 attribs)) {
170 return EGL_NO_SURFACE; 169 return EGL_NO_SURFACE;
171 } 170 }
172 171
173 gpu_control_.reset(new gpu::GpuControlService( 172 gpu_control_service_.reset(
174 NULL, NULL, group->mailbox_manager(), NULL, decoder_->GetCapabilities())); 173 new gpu::GpuControlService(NULL, group->mailbox_manager(), NULL));
175 174
176 command_buffer->SetPutOffsetChangeCallback( 175 command_buffer->SetPutOffsetChangeCallback(
177 base::Bind(&gpu::GpuScheduler::PutChanged, 176 base::Bind(&gpu::GpuScheduler::PutChanged,
178 base::Unretained(gpu_scheduler_.get()))); 177 base::Unretained(gpu_scheduler_.get())));
179 command_buffer->SetGetBufferChangeCallback( 178 command_buffer->SetGetBufferChangeCallback(
180 base::Bind(&gpu::GpuScheduler::SetGetBuffer, 179 base::Bind(&gpu::GpuScheduler::SetGetBuffer,
181 base::Unretained(gpu_scheduler_.get()))); 180 base::Unretained(gpu_scheduler_.get())));
182 181
183 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( 182 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper(
184 new gpu::gles2::GLES2CmdHelper(command_buffer.get())); 183 new gpu::gles2::GLES2CmdHelper(command_buffer.get()));
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 229
231 bool bind_generates_resources = true; 230 bool bind_generates_resources = true;
232 bool lose_context_when_out_of_memory = false; 231 bool lose_context_when_out_of_memory = false;
233 232
234 context_.reset( 233 context_.reset(
235 new gpu::gles2::GLES2Implementation(gles2_cmd_helper_.get(), 234 new gpu::gles2::GLES2Implementation(gles2_cmd_helper_.get(),
236 NULL, 235 NULL,
237 transfer_buffer_.get(), 236 transfer_buffer_.get(),
238 bind_generates_resources, 237 bind_generates_resources,
239 lose_context_when_out_of_memory, 238 lose_context_when_out_of_memory,
240 gpu_control_.get())); 239 this));
241 240
242 if (!context_->Initialize( 241 if (!context_->Initialize(
243 kTransferBufferSize, 242 kTransferBufferSize,
244 kTransferBufferSize / 2, 243 kTransferBufferSize / 2,
245 kTransferBufferSize * 2, 244 kTransferBufferSize * 2,
246 gpu::gles2::GLES2Implementation::kNoLimit)) { 245 gpu::gles2::GLES2Implementation::kNoLimit)) {
247 return EGL_NO_CONTEXT; 246 return EGL_NO_CONTEXT;
248 } 247 }
249 248
250 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); 249 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets");
(...skipping 13 matching lines...) Expand all
264 gles2::SetGLContext(NULL); 263 gles2::SetGLContext(NULL);
265 } else { 264 } else {
266 DCHECK(IsValidSurface(draw)); 265 DCHECK(IsValidSurface(draw));
267 DCHECK(IsValidSurface(read)); 266 DCHECK(IsValidSurface(read));
268 DCHECK(IsValidContext(ctx)); 267 DCHECK(IsValidContext(ctx));
269 gles2::SetGLContext(context_.get()); 268 gles2::SetGLContext(context_.get());
270 } 269 }
271 return true; 270 return true;
272 } 271 }
273 272
273 gpu::Capabilities Display::GetCapabilities() {
274 return decoder_->GetCapabilities();
275 }
276
277 gfx::GpuMemoryBuffer* Display::CreateGpuMemoryBuffer(
278 size_t width,
279 size_t height,
280 unsigned internalformat,
281 int32* id) {
282 NOTIMPLEMENTED();
283 return NULL;
284 }
285
286 void Display::DestroyGpuMemoryBuffer(int32 id) {
287 NOTIMPLEMENTED();
288 }
289
290 uint32 Display::InsertSyncPoint() {
291 NOTIMPLEMENTED();
292 return 0u;
293 }
294
295 void Display::SignalSyncPoint(uint32 sync_point,
296 const base::Closure& callback) {
297 NOTIMPLEMENTED();
298 }
299
300 void Display::SignalQuery(uint32 query, const base::Closure& callback) {
301 NOTIMPLEMENTED();
302 }
303
304 void Display::SetSurfaceVisible(bool visible) {
305 NOTIMPLEMENTED();
306 }
307
308 void Display::SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats) {
309 NOTIMPLEMENTED();
310 }
311
312 void Display::Echo(const base::Closure& callback) {
313 NOTIMPLEMENTED();
314 }
315
316 uint32 Display::CreateStreamTexture(uint32 texture_id) {
317 NOTIMPLEMENTED();
318 return 0;
319 }
320
274 } // namespace egl 321 } // namespace egl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698