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 "components/mus/surfaces/direct_output_surface.h" | 5 #include "components/mus/surfaces/direct_output_surface.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
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 18 matching lines...) Expand all Loading... |
29 DirectOutputSurface::~DirectOutputSurface() {} | 29 DirectOutputSurface::~DirectOutputSurface() {} |
30 | 30 |
31 bool DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { | 31 bool DirectOutputSurface::BindToClient(cc::OutputSurfaceClient* client) { |
32 if (!cc::OutputSurface::BindToClient(client)) | 32 if (!cc::OutputSurface::BindToClient(client)) |
33 return false; | 33 return false; |
34 | 34 |
35 client->SetBeginFrameSource(synthetic_begin_frame_source_.get()); | 35 client->SetBeginFrameSource(synthetic_begin_frame_source_.get()); |
36 | 36 |
37 if (capabilities_.uses_default_gl_framebuffer) { | 37 if (capabilities_.uses_default_gl_framebuffer) { |
38 capabilities_.flipped_output_surface = | 38 capabilities_.flipped_output_surface = |
39 context_provider()->ContextCapabilities().gpu.flips_vertically; | 39 context_provider()->ContextCapabilities().flips_vertically; |
40 } | 40 } |
41 return true; | 41 return true; |
42 } | 42 } |
43 | 43 |
44 void DirectOutputSurface::OnVSyncParametersUpdated(int64_t timebase, | 44 void DirectOutputSurface::OnVSyncParametersUpdated(int64_t timebase, |
45 int64_t interval) { | 45 int64_t interval) { |
46 auto timebase_time_ticks = base::TimeTicks::FromInternalValue(timebase); | 46 auto timebase_time_ticks = base::TimeTicks::FromInternalValue(timebase); |
47 auto interval_time_delta = base::TimeDelta::FromInternalValue(interval); | 47 auto interval_time_delta = base::TimeDelta::FromInternalValue(interval); |
48 | 48 |
49 if (interval_time_delta.is_zero()) { | 49 if (interval_time_delta.is_zero()) { |
(...skipping 23 matching lines...) Expand all Loading... |
73 gpu::SyncToken sync_token; | 73 gpu::SyncToken sync_token; |
74 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); | 74 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); |
75 | 75 |
76 context_provider_->ContextSupport()->SignalSyncToken( | 76 context_provider_->ContextSupport()->SignalSyncToken( |
77 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete, | 77 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete, |
78 weak_ptr_factory_.GetWeakPtr())); | 78 weak_ptr_factory_.GetWeakPtr())); |
79 client_->DidSwapBuffers(); | 79 client_->DidSwapBuffers(); |
80 } | 80 } |
81 | 81 |
82 } // namespace mus | 82 } // namespace mus |
OLD | NEW |