| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 GpuInProcessThread::~GpuInProcessThread() { | 95 GpuInProcessThread::~GpuInProcessThread() { |
| 96 Stop(); | 96 Stop(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void GpuInProcessThread::ScheduleTask(const base::Closure& task) { | 99 void GpuInProcessThread::ScheduleTask(const base::Closure& task) { |
| 100 message_loop()->PostTask(FROM_HERE, task); | 100 message_loop()->PostTask(FROM_HERE, task); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void GpuInProcessThread::ScheduleIdleWork(const base::Closure& callback) { | 103 void GpuInProcessThread::ScheduleIdleWork(const base::Closure& callback) { |
| 104 // Match delay with GpuCommandBufferStub. |
| 104 message_loop()->PostDelayedTask( | 105 message_loop()->PostDelayedTask( |
| 105 FROM_HERE, callback, base::TimeDelta::FromMilliseconds(5)); | 106 FROM_HERE, callback, base::TimeDelta::FromMilliseconds(2)); |
| 106 } | 107 } |
| 107 | 108 |
| 108 scoped_refptr<gles2::ShaderTranslatorCache> | 109 scoped_refptr<gles2::ShaderTranslatorCache> |
| 109 GpuInProcessThread::shader_translator_cache() { | 110 GpuInProcessThread::shader_translator_cache() { |
| 110 if (!shader_translator_cache_.get()) | 111 if (!shader_translator_cache_.get()) |
| 111 shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache; | 112 shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache; |
| 112 return shader_translator_cache_; | 113 return shader_translator_cache_; |
| 113 } | 114 } |
| 114 | 115 |
| 115 struct GpuInProcessThreadHolder { | 116 struct GpuInProcessThreadHolder { |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 | 950 |
| 950 #if defined(OS_ANDROID) | 951 #if defined(OS_ANDROID) |
| 951 scoped_refptr<gfx::SurfaceTexture> | 952 scoped_refptr<gfx::SurfaceTexture> |
| 952 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { | 953 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { |
| 953 DCHECK(stream_texture_manager_); | 954 DCHECK(stream_texture_manager_); |
| 954 return stream_texture_manager_->GetSurfaceTexture(stream_id); | 955 return stream_texture_manager_->GetSurfaceTexture(stream_id); |
| 955 } | 956 } |
| 956 #endif | 957 #endif |
| 957 | 958 |
| 958 } // namespace gpu | 959 } // namespace gpu |
| OLD | NEW |