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/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 if (!OutputSurface::BindToClient(client)) | 74 if (!OutputSurface::BindToClient(client)) |
75 return false; | 75 return false; |
76 | 76 |
77 output_surface_map_->AddWithID(this, surface_id_); | 77 output_surface_map_->AddWithID(this, surface_id_); |
78 if (reflector_) | 78 if (reflector_) |
79 reflector_->OnSourceSurfaceReady(surface_id_); | 79 reflector_->OnSourceSurfaceReady(surface_id_); |
80 return true; | 80 return true; |
81 } | 81 } |
82 | 82 |
83 void BrowserCompositorOutputSurface::Reshape(gfx::Size size, | 83 void BrowserCompositorOutputSurface::Reshape(const gfx::Size& size, |
84 float scale_factor) { | 84 float scale_factor) { |
85 OutputSurface::Reshape(size, scale_factor); | 85 OutputSurface::Reshape(size, scale_factor); |
86 if (reflector_.get()) | 86 if (reflector_.get()) |
87 reflector_->OnReshape(size); | 87 reflector_->OnReshape(size); |
88 } | 88 } |
89 | 89 |
90 void BrowserCompositorOutputSurface::OnUpdateVSyncParameters( | 90 void BrowserCompositorOutputSurface::OnUpdateVSyncParameters( |
91 base::TimeTicks timebase, | 91 base::TimeTicks timebase, |
92 base::TimeDelta interval) { | 92 base::TimeDelta interval) { |
93 DCHECK(CalledOnValidThread()); | 93 DCHECK(CalledOnValidThread()); |
94 DCHECK(HasClient()); | 94 DCHECK(HasClient()); |
95 OnVSyncParametersChanged(timebase, interval); | 95 OnVSyncParametersChanged(timebase, interval); |
96 compositor_message_loop_->PostTask( | 96 compositor_message_loop_->PostTask( |
97 FROM_HERE, | 97 FROM_HERE, |
98 base::Bind(&ui::Compositor::OnUpdateVSyncParameters, | 98 base::Bind(&ui::Compositor::OnUpdateVSyncParameters, |
99 compositor_, timebase, interval)); | 99 compositor_, timebase, interval)); |
100 } | 100 } |
101 | 101 |
102 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) { | 102 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) { |
103 reflector_ = reflector; | 103 reflector_ = reflector; |
104 } | 104 } |
105 | 105 |
106 } // namespace content | 106 } // namespace content |
OLD | NEW |