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

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

Issue 2056413003: Fix a bug in the implementation of DescheduleUntilFinishedCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile error on windows. Created 4 years, 6 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/command_buffer/service/gles2_cmd_decoder_passthrough.cc ('k') | no next file » | 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 if (time_since_idle > max_time_since_idle) 316 if (time_since_idle > max_time_since_idle)
317 is_idle = true; 317 is_idle = true;
318 } 318 }
319 319
320 if (is_idle) { 320 if (is_idle) {
321 last_idle_time_ = base::TimeTicks::Now(); 321 last_idle_time_ = base::TimeTicks::Now();
322 executor_->PerformIdleWork(); 322 executor_->PerformIdleWork();
323 } 323 }
324 324
325 executor_->ProcessPendingQueries(); 325 executor_->ProcessPendingQueries();
326 executor_->PerformPollingWork();
326 } 327 }
327 328
328 ScheduleDelayedWork( 329 ScheduleDelayedWork(
329 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodBusyMs)); 330 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodBusyMs));
330 } 331 }
331 332
332 bool GpuCommandBufferStub::HasUnprocessedCommands() { 333 bool GpuCommandBufferStub::HasUnprocessedCommands() {
333 if (command_buffer_) { 334 if (command_buffer_) {
334 CommandBuffer::State state = command_buffer_->GetLastState(); 335 CommandBuffer::State state = command_buffer_->GetLastState();
335 return command_buffer_->GetPutOffset() != state.get_offset && 336 return command_buffer_->GetPutOffset() != state.get_offset &&
336 !error::IsError(state.error); 337 !error::IsError(state.error);
337 } 338 }
338 return false; 339 return false;
339 } 340 }
340 341
341 void GpuCommandBufferStub::ScheduleDelayedWork(base::TimeDelta delay) { 342 void GpuCommandBufferStub::ScheduleDelayedWork(base::TimeDelta delay) {
342 bool has_more_work = executor_.get() && (executor_->HasPendingQueries() || 343 bool has_more_work = executor_.get() && (executor_->HasPendingQueries() ||
343 executor_->HasMoreIdleWork()); 344 executor_->HasMoreIdleWork() ||
345 executor_->HasPollingWork());
344 if (!has_more_work) { 346 if (!has_more_work) {
345 last_idle_time_ = base::TimeTicks(); 347 last_idle_time_ = base::TimeTicks();
346 return; 348 return;
347 } 349 }
348 350
349 base::TimeTicks current_time = base::TimeTicks::Now(); 351 base::TimeTicks current_time = base::TimeTicks::Now();
350 // |process_delayed_work_time_| is set if processing of delayed work is 352 // |process_delayed_work_time_| is set if processing of delayed work is
351 // already scheduled. Just update the time if already scheduled. 353 // already scheduled. Just update the time if already scheduled.
352 if (!process_delayed_work_time_.is_null()) { 354 if (!process_delayed_work_time_.is_null()) {
353 process_delayed_work_time_ = current_time + delay; 355 process_delayed_work_time_ = current_time + delay;
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); 1116 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params));
1115 } 1117 }
1116 1118
1117 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1119 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1118 base::TimeDelta interval) { 1120 base::TimeDelta interval) {
1119 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1121 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1120 interval)); 1122 interval));
1121 } 1123 }
1122 1124
1123 } // namespace gpu 1125 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698