OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/compositor/browser_compositor_output_surface.h" | 5 #include "content/browser/compositor/browser_compositor_output_surface.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { | 41 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { |
42 DCHECK(CalledOnValidThread()); | 42 DCHECK(CalledOnValidThread()); |
43 if (!HasClient()) | 43 if (!HasClient()) |
44 return; | 44 return; |
45 output_surface_map_->Remove(surface_id_); | 45 output_surface_map_->Remove(surface_id_); |
46 vsync_manager_->RemoveObserver(this); | 46 vsync_manager_->RemoveObserver(this); |
47 } | 47 } |
48 | 48 |
49 void BrowserCompositorOutputSurface::Initialize() { | 49 void BrowserCompositorOutputSurface::Initialize() { |
50 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 50 capabilities_.max_frames_pending = 1; |
51 if (command_line->HasSwitch(switches::kUIMaxFramesPending)) { | |
52 std::string string_value = command_line->GetSwitchValueASCII( | |
53 switches::kUIMaxFramesPending); | |
54 int int_value; | |
55 if (base::StringToInt(string_value, &int_value)) | |
56 capabilities_.max_frames_pending = int_value; | |
57 else | |
58 LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending; | |
59 } | |
60 capabilities_.adjust_deadline_for_parent = false; | 51 capabilities_.adjust_deadline_for_parent = false; |
61 | 52 |
62 DetachFromThread(); | 53 DetachFromThread(); |
63 } | 54 } |
64 | 55 |
65 bool BrowserCompositorOutputSurface::BindToClient( | 56 bool BrowserCompositorOutputSurface::BindToClient( |
66 cc::OutputSurfaceClient* client) { | 57 cc::OutputSurfaceClient* client) { |
67 DCHECK(CalledOnValidThread()); | 58 DCHECK(CalledOnValidThread()); |
68 | 59 |
69 if (!OutputSurface::BindToClient(client)) | 60 if (!OutputSurface::BindToClient(client)) |
(...skipping 27 matching lines...) Expand all Loading... |
97 DCHECK(CalledOnValidThread()); | 88 DCHECK(CalledOnValidThread()); |
98 DCHECK(HasClient()); | 89 DCHECK(HasClient()); |
99 vsync_manager_->UpdateVSyncParameters(timebase, interval); | 90 vsync_manager_->UpdateVSyncParameters(timebase, interval); |
100 } | 91 } |
101 | 92 |
102 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) { | 93 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) { |
103 reflector_ = reflector; | 94 reflector_ = reflector; |
104 } | 95 } |
105 | 96 |
106 } // namespace content | 97 } // namespace content |
OLD | NEW |