Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Unified Diff: services/ui/ws/frame_generator.cc

Issue 2755573002: Add FrameGenerator Unit Tests (Closed)
Patch Set: Removed TestCompositorFrameSink due to name conflict Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/display_client_compositor_frame_sink.h ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/frame_generator.cc
diff --git a/services/ui/ws/frame_generator.cc b/services/ui/ws/frame_generator.cc
index 30b17f3da99bf188dcddf76cbfd9508f4e87a110..41980cca1dbf0f6acdf4d41bc28ae71f093ceb64 100644
--- a/services/ui/ws/frame_generator.cc
+++ b/services/ui/ws/frame_generator.cc
@@ -93,8 +93,10 @@ void FrameGenerator::SetExternalTilePriorityConstraints(
const gfx::Transform& transform) {}
void FrameGenerator::OnBeginFrame(const cc::BeginFrameArgs& begin_frame_args) {
- if (!root_window_->visible())
+ if (!root_window_->visible() ||
+ begin_frame_args.type == cc::BeginFrameArgs::MISSED) {
return;
+ }
// TODO(fsamuel): We should add a trace for generating a top level frame.
cc::CompositorFrame frame(GenerateCompositorFrame(root_window_->bounds()));
@@ -186,14 +188,11 @@ void FrameGenerator::SetNeedsBeginFrame(bool needs_begin_frame) {
if (needs_begin_frame == observing_begin_frames_)
return;
- if (needs_begin_frame) {
+ observing_begin_frames_ = needs_begin_frame;
+ if (needs_begin_frame)
begin_frame_source_->AddObserver(this);
- observing_begin_frames_ = true;
- return;
- }
-
- begin_frame_source_->RemoveObserver(this);
- observing_begin_frames_ = false;
+ else
+ begin_frame_source_->RemoveObserver(this);
}
} // namespace ws
« no previous file with comments | « services/ui/ws/display_client_compositor_frame_sink.h ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698