| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/mus/surfaces/direct_output_surface_ozone.h" | 5 #include "components/mus/surfaces/direct_output_surface_ozone.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool DirectOutputSurfaceOzone::BindToClient(cc::OutputSurfaceClient* client) { | 91 bool DirectOutputSurfaceOzone::BindToClient(cc::OutputSurfaceClient* client) { |
| 92 if (!cc::OutputSurface::BindToClient(client)) | 92 if (!cc::OutputSurface::BindToClient(client)) |
| 93 return false; | 93 return false; |
| 94 | 94 |
| 95 client->SetBeginFrameSource(synthetic_begin_frame_source_.get()); | 95 client->SetBeginFrameSource(synthetic_begin_frame_source_.get()); |
| 96 | 96 |
| 97 if (capabilities_.uses_default_gl_framebuffer) { | 97 if (capabilities_.uses_default_gl_framebuffer) { |
| 98 capabilities_.flipped_output_surface = | 98 capabilities_.flipped_output_surface = |
| 99 context_provider()->ContextCapabilities().gpu.flips_vertically; | 99 context_provider()->ContextCapabilities().flips_vertically; |
| 100 } | 100 } |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void DirectOutputSurfaceOzone::OnUpdateVSyncParametersFromGpu( | 104 void DirectOutputSurfaceOzone::OnUpdateVSyncParametersFromGpu( |
| 105 base::TimeTicks timebase, | 105 base::TimeTicks timebase, |
| 106 base::TimeDelta interval) { | 106 base::TimeDelta interval) { |
| 107 DCHECK(HasClient()); | 107 DCHECK(HasClient()); |
| 108 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval); | 108 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval); |
| 109 } | 109 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 139 // must create the native window in the size that the hardware reports. | 139 // must create the native window in the size that the hardware reports. |
| 140 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, | 140 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, |
| 141 float scale_factor, | 141 float scale_factor, |
| 142 bool alpha) { | 142 bool alpha) { |
| 143 OutputSurface::Reshape(size, scale_factor, alpha); | 143 OutputSurface::Reshape(size, scale_factor, alpha); |
| 144 DCHECK(output_surface_); | 144 DCHECK(output_surface_); |
| 145 output_surface_->Reshape(SurfaceSize(), scale_factor); | 145 output_surface_->Reshape(SurfaceSize(), scale_factor); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace mus | 148 } // namespace mus |
| OLD | NEW |