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 "content/common/gpu/gpu_channel_manager.h" | 5 #include "content/common/gpu/gpu_channel_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 void GpuChannelManager::OnUpdateValueState( | 237 void GpuChannelManager::OnUpdateValueState( |
238 int client_id, unsigned int target, const gpu::ValueState& state) { | 238 int client_id, unsigned int target, const gpu::ValueState& state) { |
239 // Only pass updated state to the channel corresponding to the | 239 // Only pass updated state to the channel corresponding to the |
240 // render_widget_host where the event originated. | 240 // render_widget_host where the event originated. |
241 auto it = gpu_channels_.find(client_id); | 241 auto it = gpu_channels_.find(client_id); |
242 if (it != gpu_channels_.end()) | 242 if (it != gpu_channels_.end()) |
243 it->second->HandleUpdateValueState(target, state); | 243 it->second->HandleUpdateValueState(target, state); |
244 } | 244 } |
245 | 245 |
246 void GpuChannelManager::OnLoadedShader(std::string program_proto) { | 246 void GpuChannelManager::OnLoadedShader(const std::string& program_proto) { |
247 if (program_cache()) | 247 if (program_cache()) |
248 program_cache()->LoadProgram(program_proto); | 248 program_cache()->LoadProgram(program_proto); |
249 } | 249 } |
250 | 250 |
251 uint32_t GpuChannelManager::GetUnprocessedOrderNum() const { | 251 uint32_t GpuChannelManager::GetUnprocessedOrderNum() const { |
252 uint32_t unprocessed_order_num = 0; | 252 uint32_t unprocessed_order_num = 0; |
253 for (auto& kv : gpu_channels_) { | 253 for (auto& kv : gpu_channels_) { |
254 unprocessed_order_num = | 254 unprocessed_order_num = |
255 std::max(unprocessed_order_num, kv.second->GetUnprocessedOrderNum()); | 255 std::max(unprocessed_order_num, kv.second->GetUnprocessedOrderNum()); |
256 } | 256 } |
(...skipping 24 matching lines...) Expand all Loading... |
281 | 281 |
282 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 282 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
283 if (!default_offscreen_surface_.get()) { | 283 if (!default_offscreen_surface_.get()) { |
284 default_offscreen_surface_ = | 284 default_offscreen_surface_ = |
285 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); | 285 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); |
286 } | 286 } |
287 return default_offscreen_surface_.get(); | 287 return default_offscreen_surface_.get(); |
288 } | 288 } |
289 | 289 |
290 } // namespace content | 290 } // namespace content |
OLD | NEW |