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 "content/browser/renderer_host/image_transport_factory.h" | 5 #include "content/browser/renderer_host/image_transport_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "base/strings/string_number_conversions.h" | |
| 15 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 16 #include "cc/output_surface.h" | 17 #include "cc/output_surface.h" |
| 17 #include "cc/output_surface_client.h" | 18 #include "cc/output_surface_client.h" |
| 18 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 19 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 19 #include "content/browser/gpu/gpu_data_manager_impl.h" | 20 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 20 #include "content/browser/gpu/gpu_process_host.h" | 21 #include "content/browser/gpu/gpu_process_host.h" |
| 21 #include "content/browser/gpu/gpu_surface_tracker.h" | 22 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 22 #include "content/common/gpu/client/context_provider_command_buffer.h" | 23 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 23 #include "content/common/gpu/client/gl_helper.h" | 24 #include "content/common/gpu/client/gl_helper.h" |
| 24 #include "content/common/gpu/client/gpu_channel_host.h" | 25 #include "content/common/gpu/client/gpu_channel_host.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 WebGraphicsContext3DCommandBufferImpl* context, | 303 WebGraphicsContext3DCommandBufferImpl* context, |
| 303 int surface_id, | 304 int surface_id, |
| 304 BrowserCompositorOutputSurfaceProxy* output_surface_proxy, | 305 BrowserCompositorOutputSurfaceProxy* output_surface_proxy, |
| 305 base::MessageLoopProxy* compositor_message_loop, | 306 base::MessageLoopProxy* compositor_message_loop, |
| 306 base::WeakPtr<ui::Compositor> compositor) | 307 base::WeakPtr<ui::Compositor> compositor) |
| 307 : OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D>(context)), | 308 : OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D>(context)), |
| 308 surface_id_(surface_id), | 309 surface_id_(surface_id), |
| 309 output_surface_proxy_(output_surface_proxy), | 310 output_surface_proxy_(output_surface_proxy), |
| 310 compositor_message_loop_(compositor_message_loop), | 311 compositor_message_loop_(compositor_message_loop), |
| 311 compositor_(compositor) { | 312 compositor_(compositor) { |
| 313 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
| 314 if (command_line->HasSwitch(switches::kUIMaxFramesPending)) { | |
| 315 std::string string_value = command_line->GetSwitchValueASCII( | |
| 316 switches::kUIMaxFramesPending); | |
| 317 int int_value; | |
| 318 if (base::StringToInt(string_value, &int_value)) | |
| 319 capabilities_.max_frames_pending = int_value; | |
| 320 else | |
| 321 LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending; | |
|
DaveMoore
2013/03/13 17:49:06
Nit: extra space
jonathan.backer
2013/03/13 18:00:25
Done.
| |
| 322 } | |
| 312 DetachFromThread(); | 323 DetachFromThread(); |
| 313 } | 324 } |
| 314 | 325 |
| 315 virtual ~BrowserCompositorOutputSurface() { | 326 virtual ~BrowserCompositorOutputSurface() { |
| 316 DCHECK(CalledOnValidThread()); | 327 DCHECK(CalledOnValidThread()); |
| 317 if (!client_) | 328 if (!client_) |
| 318 return; | 329 return; |
| 319 output_surface_proxy_->RemoveSurface(surface_id_); | 330 output_surface_proxy_->RemoveSurface(surface_id_); |
| 320 } | 331 } |
| 321 | 332 |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 768 delete g_factory; | 779 delete g_factory; |
| 769 g_factory = NULL; | 780 g_factory = NULL; |
| 770 } | 781 } |
| 771 | 782 |
| 772 // static | 783 // static |
| 773 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 784 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
| 774 return g_factory; | 785 return g_factory; |
| 775 } | 786 } |
| 776 | 787 |
| 777 } // namespace content | 788 } // namespace content |
| OLD | NEW |