OLD | NEW |
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 #include "gpu/command_buffer/service/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 } | 375 } |
376 } | 376 } |
377 if (!context_group) | 377 if (!context_group) |
378 share_group = new gfx::GLShareGroup; | 378 share_group = new gfx::GLShareGroup; |
379 } | 379 } |
380 | 380 |
381 bool bind_generates_resource = false; | 381 bool bind_generates_resource = false; |
382 decoder_.reset(gles2::GLES2Decoder::Create( | 382 decoder_.reset(gles2::GLES2Decoder::Create( |
383 context_group ? context_group->decoder_->GetContextGroup() | 383 context_group ? context_group->decoder_->GetContextGroup() |
384 : new gles2::ContextGroup( | 384 : new gles2::ContextGroup( |
385 NULL, NULL, NULL, NULL, bind_generates_resource))); | 385 NULL, NULL, NULL, bind_generates_resource))); |
386 | 386 |
387 gpu_scheduler_.reset( | 387 gpu_scheduler_.reset( |
388 new GpuScheduler(command_buffer.get(), decoder_.get(), decoder_.get())); | 388 new GpuScheduler(command_buffer.get(), decoder_.get(), decoder_.get())); |
389 command_buffer->SetGetBufferChangeCallback(base::Bind( | 389 command_buffer->SetGetBufferChangeCallback(base::Bind( |
390 &GpuScheduler::SetGetBuffer, base::Unretained(gpu_scheduler_.get()))); | 390 &GpuScheduler::SetGetBuffer, base::Unretained(gpu_scheduler_.get()))); |
391 command_buffer_ = command_buffer.Pass(); | 391 command_buffer_ = command_buffer.Pass(); |
392 | 392 |
393 decoder_->set_engine(gpu_scheduler_.get()); | 393 decoder_->set_engine(gpu_scheduler_.get()); |
394 | 394 |
395 if (!surface_) { | 395 if (!surface_) { |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 g_uses_explicit_scheduling = true; | 747 g_uses_explicit_scheduling = true; |
748 g_gpu_queue.Get().SetScheduleCallback(callback); | 748 g_gpu_queue.Get().SetScheduleCallback(callback); |
749 } | 749 } |
750 | 750 |
751 // static | 751 // static |
752 void InProcessCommandBuffer::ProcessGpuWorkOnCurrentThread() { | 752 void InProcessCommandBuffer::ProcessGpuWorkOnCurrentThread() { |
753 g_gpu_queue.Get().RunTasks(); | 753 g_gpu_queue.Get().RunTasks(); |
754 } | 754 } |
755 | 755 |
756 } // namespace gpu | 756 } // namespace gpu |
OLD | NEW |