| 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 "services/ui/ws/frame_generator.h" | 5 #include "services/ui/ws/frame_generator.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 const gfx::Rect& viewport, | 86 const gfx::Rect& viewport, |
| 87 bool resourceless_software_draw) {} | 87 bool resourceless_software_draw) {} |
| 88 | 88 |
| 89 void FrameGenerator::SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) {} | 89 void FrameGenerator::SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) {} |
| 90 | 90 |
| 91 void FrameGenerator::SetExternalTilePriorityConstraints( | 91 void FrameGenerator::SetExternalTilePriorityConstraints( |
| 92 const gfx::Rect& viewport_rect, | 92 const gfx::Rect& viewport_rect, |
| 93 const gfx::Transform& transform) {} | 93 const gfx::Transform& transform) {} |
| 94 | 94 |
| 95 void FrameGenerator::OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) { | 95 void FrameGenerator::OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) { |
| 96 if (!root_window_->visible()) | 96 if (!root_window_->visible() || |
| 97 begin_frame_args.type == cc::BeginFrameArgs::MISSED) { |
| 97 return; | 98 return; |
| 99 } |
| 98 | 100 |
| 99 // TODO(fsamuel): We should add a trace for generating a top level frame. | 101 // TODO(fsamuel): We should add a trace for generating a top level frame. |
| 100 cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds())); | 102 cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds())); |
| 101 | 103 |
| 102 compositor_frame_sink_->SubmitCompositorFrame(std::move(frame)); | 104 compositor_frame_sink_->SubmitCompositorFrame(std::move(frame)); |
| 103 SetNeedsBeginFrame(false); | 105 SetNeedsBeginFrame(false); |
| 104 last_begin_frame_args_ = begin_frame_args; | 106 last_begin_frame_args_ = begin_frame_args; |
| 105 } | 107 } |
| 106 | 108 |
| 107 const cc::BeginFrameArgs& FrameGenerator::LastUsedBeginFrameArgs() const { | 109 const cc::BeginFrameArgs& FrameGenerator::LastUsedBeginFrameArgs() const { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 return; | 194 return; |
| 193 } | 195 } |
| 194 | 196 |
| 195 begin_frame_source_->RemoveObserver(this); | 197 begin_frame_source_->RemoveObserver(this); |
| 196 observing_begin_frames_ = false; | 198 observing_begin_frames_ = false; |
| 197 } | 199 } |
| 198 | 200 |
| 199 } // namespace ws | 201 } // namespace ws |
| 200 | 202 |
| 201 } // namespace ui | 203 } // namespace ui |
| OLD | NEW |