| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { | 54 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { |
| 55 if (reflector_) | 55 if (reflector_) |
| 56 reflector_->DetachFromOutputSurface(); | 56 reflector_->DetachFromOutputSurface(); |
| 57 DCHECK(!reflector_); | 57 DCHECK(!reflector_); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu( | 60 void BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu( |
| 61 base::TimeTicks timebase, | 61 base::TimeTicks timebase, |
| 62 base::TimeDelta interval) { | 62 base::TimeDelta interval) { |
| 63 DCHECK(HasClient()); | 63 DCHECK(client_); // BindToClient should have been called already. |
| 64 |
| 64 if (interval.is_zero()) { | 65 if (interval.is_zero()) { |
| 65 // TODO(brianderson): We should not be receiving 0 intervals. | 66 // TODO(brianderson): We should not be receiving 0 intervals. |
| 66 interval = cc::BeginFrameArgs::DefaultInterval(); | 67 interval = cc::BeginFrameArgs::DefaultInterval(); |
| 67 } | 68 } |
| 68 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval); | 69 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval); |
| 69 vsync_manager_->UpdateVSyncParameters(timebase, interval); | 70 vsync_manager_->UpdateVSyncParameters(timebase, interval); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) { | 73 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) { |
| 73 // Software mirroring is done by doing a GL copy out of the framebuffer - if | 74 // Software mirroring is done by doing a GL copy out of the framebuffer - if |
| 74 // we have overlays then that data will be missing. | 75 // we have overlays then that data will be missing. |
| 75 if (overlay_candidate_validator_) { | 76 if (overlay_candidate_validator_) { |
| 76 overlay_candidate_validator_->SetSoftwareMirrorMode(reflector != nullptr); | 77 overlay_candidate_validator_->SetSoftwareMirrorMode(reflector != nullptr); |
| 77 } | 78 } |
| 78 reflector_ = reflector; | 79 reflector_ = reflector; |
| 79 | 80 |
| 80 OnReflectorChanged(); | 81 OnReflectorChanged(); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void BrowserCompositorOutputSurface::OnReflectorChanged() { | 84 void BrowserCompositorOutputSurface::OnReflectorChanged() { |
| 84 } | 85 } |
| 85 | 86 |
| 86 cc::OverlayCandidateValidator* | 87 cc::OverlayCandidateValidator* |
| 87 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { | 88 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { |
| 88 return overlay_candidate_validator_.get(); | 89 return overlay_candidate_validator_.get(); |
| 89 } | 90 } |
| 90 | 91 |
| 92 bool BrowserCompositorOutputSurface::HasExternalStencilTest() const { |
| 93 return false; |
| 94 } |
| 95 |
| 96 void BrowserCompositorOutputSurface::ApplyExternalStencil() {} |
| 97 |
| 91 } // namespace content | 98 } // namespace content |
| OLD | NEW |