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

Side by Side Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2881813002: Revert of gpu: GPU service scheduler. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « gpu/ipc/service/gpu_channel_unittest.cc ('k') | services/ui/gpu/gpu_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ipc/service/gpu_command_buffer_stub.h" 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 13 matching lines...) Expand all
24 #include "gpu/command_buffer/common/sync_token.h" 24 #include "gpu/command_buffer/common/sync_token.h"
25 #include "gpu/command_buffer/service/command_executor.h" 25 #include "gpu/command_buffer/service/command_executor.h"
26 #include "gpu/command_buffer/service/gl_context_virtual.h" 26 #include "gpu/command_buffer/service/gl_context_virtual.h"
27 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" 27 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
28 #include "gpu/command_buffer/service/image_manager.h" 28 #include "gpu/command_buffer/service/image_manager.h"
29 #include "gpu/command_buffer/service/logger.h" 29 #include "gpu/command_buffer/service/logger.h"
30 #include "gpu/command_buffer/service/mailbox_manager.h" 30 #include "gpu/command_buffer/service/mailbox_manager.h"
31 #include "gpu/command_buffer/service/memory_tracking.h" 31 #include "gpu/command_buffer/service/memory_tracking.h"
32 #include "gpu/command_buffer/service/preemption_flag.h" 32 #include "gpu/command_buffer/service/preemption_flag.h"
33 #include "gpu/command_buffer/service/query_manager.h" 33 #include "gpu/command_buffer/service/query_manager.h"
34 #include "gpu/command_buffer/service/scheduler.h"
35 #include "gpu/command_buffer/service/service_utils.h" 34 #include "gpu/command_buffer/service/service_utils.h"
36 #include "gpu/command_buffer/service/sync_point_manager.h" 35 #include "gpu/command_buffer/service/sync_point_manager.h"
37 #include "gpu/command_buffer/service/transfer_buffer_manager.h" 36 #include "gpu/command_buffer/service/transfer_buffer_manager.h"
38 #include "gpu/ipc/common/gpu_messages.h" 37 #include "gpu/ipc/common/gpu_messages.h"
39 #include "gpu/ipc/service/gpu_channel.h" 38 #include "gpu/ipc/service/gpu_channel.h"
40 #include "gpu/ipc/service/gpu_channel_manager.h" 39 #include "gpu/ipc/service/gpu_channel_manager.h"
41 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" 40 #include "gpu/ipc/service/gpu_channel_manager_delegate.h"
42 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" 41 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
43 #include "gpu/ipc/service/gpu_memory_manager.h" 42 #include "gpu/ipc/service/gpu_memory_manager.h"
44 #include "gpu/ipc/service/gpu_memory_tracking.h" 43 #include "gpu/ipc/service/gpu_memory_tracking.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 new CommandBufferService(context_group_->transfer_buffer_manager())); 645 new CommandBufferService(context_group_->transfer_buffer_manager()));
647 646
648 decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get())); 647 decoder_.reset(gles2::GLES2Decoder::Create(context_group_.get()));
649 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(), 648 executor_.reset(new CommandExecutor(command_buffer_.get(), decoder_.get(),
650 decoder_.get())); 649 decoder_.get()));
651 650
652 sync_point_client_state_ = 651 sync_point_client_state_ =
653 channel_->sync_point_manager()->CreateSyncPointClientState( 652 channel_->sync_point_manager()->CreateSyncPointClientState(
654 CommandBufferNamespace::GPU_IO, command_buffer_id_, sequence_id_); 653 CommandBufferNamespace::GPU_IO, command_buffer_id_, sequence_id_);
655 654
656 if (channel_->scheduler()) { 655 // TODO(sunnyps): Hook callback to gpu scheduler.
657 executor_->SetPauseExecutionCallback( 656 if (channel_->preempted_flag()) {
658 base::Bind(&Scheduler::ShouldYield,
659 base::Unretained(channel_->scheduler()), sequence_id_));
660 } else if (channel_->preempted_flag()) {
661 executor_->SetPauseExecutionCallback( 657 executor_->SetPauseExecutionCallback(
662 base::Bind(&PreemptionFlag::IsSet, channel_->preempted_flag())); 658 base::Bind(&PreemptionFlag::IsSet, channel_->preempted_flag()));
663 } 659 }
664 660
665 decoder_->set_engine(executor_.get()); 661 decoder_->set_engine(executor_.get());
666 662
667 if (offscreen) { 663 if (offscreen) {
668 // Do we want to create an offscreen rendering context suitable 664 // Do we want to create an offscreen rendering context suitable
669 // for directly drawing to a separately supplied surface? In that 665 // for directly drawing to a separately supplied surface? In that
670 // case, we must ensure that the surface used for context creation 666 // case, we must ensure that the surface used for context creation
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 command_buffer_->GetLastState().error == error::kLostContext) 1253 command_buffer_->GetLastState().error == error::kLostContext)
1258 return; 1254 return;
1259 1255
1260 command_buffer_->SetContextLostReason(error::kUnknown); 1256 command_buffer_->SetContextLostReason(error::kUnknown);
1261 if (decoder_) 1257 if (decoder_)
1262 decoder_->MarkContextLost(error::kUnknown); 1258 decoder_->MarkContextLost(error::kUnknown);
1263 command_buffer_->SetParseError(error::kLostContext); 1259 command_buffer_->SetParseError(error::kLostContext);
1264 } 1260 }
1265 1261
1266 } // namespace gpu 1262 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_channel_unittest.cc ('k') | services/ui/gpu/gpu_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698