Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs)); | 268 base::TimeDelta::FromMilliseconds(kHandleMoreWorkPeriodMs)); |
| 269 } | 269 } |
| 270 | 270 |
| 271 return handled; | 271 return handled; |
| 272 } | 272 } |
| 273 | 273 |
| 274 bool GpuCommandBufferStub::Send(IPC::Message* message) { | 274 bool GpuCommandBufferStub::Send(IPC::Message* message) { |
| 275 return channel_->Send(message); | 275 return channel_->Send(message); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void GpuCommandBufferStub::ReportProgress() { | |
| 279 if (auto* watchdog = channel_->watchdog()) { | |
| 280 watchdog->CheckArmed(); | |
| 281 } | |
| 282 } | |
| 283 | |
| 278 bool GpuCommandBufferStub::IsScheduled() { | 284 bool GpuCommandBufferStub::IsScheduled() { |
| 279 return (!executor_.get() || executor_->scheduled()); | 285 return (!executor_.get() || executor_->scheduled()); |
| 280 } | 286 } |
| 281 | 287 |
| 282 void GpuCommandBufferStub::PollWork() { | 288 void GpuCommandBufferStub::PollWork() { |
| 283 // Post another delayed task if we have not yet reached the time at which | 289 // Post another delayed task if we have not yet reached the time at which |
| 284 // we should process delayed work. | 290 // we should process delayed work. |
| 285 base::TimeTicks current_time = base::TimeTicks::Now(); | 291 base::TimeTicks current_time = base::TimeTicks::Now(); |
| 286 DCHECK(!process_delayed_work_time_.is_null()); | 292 DCHECK(!process_delayed_work_time_.is_null()); |
| 287 if (process_delayed_work_time_ > current_time) { | 293 if (process_delayed_work_time_ > current_time) { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 462 new gles2::FeatureInfo(manager->gpu_driver_bug_workarounds()); | 468 new gles2::FeatureInfo(manager->gpu_driver_bug_workarounds()); |
| 463 gpu::GpuMemoryBufferFactory* gmb_factory = | 469 gpu::GpuMemoryBufferFactory* gmb_factory = |
| 464 channel_->gpu_channel_manager()->gpu_memory_buffer_factory(); | 470 channel_->gpu_channel_manager()->gpu_memory_buffer_factory(); |
| 465 context_group_ = new gles2::ContextGroup( | 471 context_group_ = new gles2::ContextGroup( |
| 466 manager->gpu_preferences(), channel_->mailbox_manager(), | 472 manager->gpu_preferences(), channel_->mailbox_manager(), |
| 467 new GpuCommandBufferMemoryTracker(channel_, | 473 new GpuCommandBufferMemoryTracker(channel_, |
| 468 command_buffer_id_.GetUnsafeValue()), | 474 command_buffer_id_.GetUnsafeValue()), |
| 469 manager->shader_translator_cache(), | 475 manager->shader_translator_cache(), |
| 470 manager->framebuffer_completeness_cache(), feature_info, | 476 manager->framebuffer_completeness_cache(), feature_info, |
| 471 init_params.attribs.bind_generates_resource, | 477 init_params.attribs.bind_generates_resource, |
| 472 gmb_factory ? gmb_factory->AsImageFactory() : nullptr); | 478 gmb_factory ? gmb_factory->AsImageFactory() : nullptr, this); |
|
danakj
2016/10/05 21:36:15
Can you /* progress_reporter */ on the |this|
ericrk
2016/10/05 22:36:17
Done.
| |
| 473 } | 479 } |
| 474 | 480 |
| 475 #if defined(OS_MACOSX) | 481 #if defined(OS_MACOSX) |
| 476 // Virtualize PreferIntegratedGpu contexts by default on OS X to prevent | 482 // Virtualize PreferIntegratedGpu contexts by default on OS X to prevent |
| 477 // performance regressions when enabling FCM. | 483 // performance regressions when enabling FCM. |
| 478 // http://crbug.com/180463 | 484 // http://crbug.com/180463 |
| 479 if (init_params.attribs.gpu_preference == gl::PreferIntegratedGpu) | 485 if (init_params.attribs.gpu_preference == gl::PreferIntegratedGpu) |
| 480 use_virtualized_gl_context_ = true; | 486 use_virtualized_gl_context_ = true; |
| 481 #endif | 487 #endif |
| 482 | 488 |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1113 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); | 1119 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); |
| 1114 } | 1120 } |
| 1115 | 1121 |
| 1116 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1122 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1117 base::TimeDelta interval) { | 1123 base::TimeDelta interval) { |
| 1118 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1124 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1119 interval)); | 1125 interval)); |
| 1120 } | 1126 } |
| 1121 | 1127 |
| 1122 } // namespace gpu | 1128 } // namespace gpu |
| OLD | NEW |