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

Side by Side Diff: services/ui/ws/server_window_compositor_frame_sink.cc

Issue 2425923003: Replaced is_null() with is_valid in SurfaceId and related classes. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | ui/android/delegated_frame_host_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/server_window_compositor_frame_sink.h" 5 #include "services/ui/ws/server_window_compositor_frame_sink.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 bool needs_begin_frame) { 62 bool needs_begin_frame) {
63 needs_begin_frame_ = needs_begin_frame; 63 needs_begin_frame_ = needs_begin_frame;
64 UpdateNeedsBeginFramesInternal(); 64 UpdateNeedsBeginFramesInternal();
65 } 65 }
66 66
67 void ServerWindowCompositorFrameSink::SubmitCompositorFrame( 67 void ServerWindowCompositorFrameSink::SubmitCompositorFrame(
68 cc::CompositorFrame frame) { 68 cc::CompositorFrame frame) {
69 gfx::Size frame_size = frame.render_pass_list[0]->output_rect.size(); 69 gfx::Size frame_size = frame.render_pass_list[0]->output_rect.size();
70 // If the size of the CompostiorFrame has changed then destroy the existing 70 // If the size of the CompostiorFrame has changed then destroy the existing
71 // Surface and create a new one of the appropriate size. 71 // Surface and create a new one of the appropriate size.
72 if (local_frame_id_.is_null() || frame_size != last_submitted_frame_size_) { 72 if (!local_frame_id_.is_valid() || frame_size != last_submitted_frame_size_) {
73 if (!local_frame_id_.is_null()) 73 if (local_frame_id_.is_valid())
74 surface_factory_.Destroy(local_frame_id_); 74 surface_factory_.Destroy(local_frame_id_);
75 local_frame_id_ = surface_id_allocator_.GenerateId(); 75 local_frame_id_ = surface_id_allocator_.GenerateId();
76 surface_factory_.Create(local_frame_id_); 76 surface_factory_.Create(local_frame_id_);
77 if (display_) 77 if (display_)
78 display_->Resize(frame_size); 78 display_->Resize(frame_size);
79 } 79 }
80 ++ack_pending_count_; 80 ++ack_pending_count_;
81 surface_factory_.SubmitCompositorFrame( 81 surface_factory_.SubmitCompositorFrame(
82 local_frame_id_, std::move(frame), 82 local_frame_id_, std::move(frame),
83 base::Bind(&ServerWindowCompositorFrameSink::DidReceiveCompositorFrameAck, 83 base::Bind(&ServerWindowCompositorFrameSink::DidReceiveCompositorFrameAck,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 added_frame_observer_ = needs_begin_frame_; 216 added_frame_observer_ = needs_begin_frame_;
217 if (needs_begin_frame_) 217 if (needs_begin_frame_)
218 begin_frame_source_->AddObserver(this); 218 begin_frame_source_->AddObserver(this);
219 else 219 else
220 begin_frame_source_->RemoveObserver(this); 220 begin_frame_source_->RemoveObserver(this);
221 } 221 }
222 222
223 } // namespace ws 223 } // namespace ws
224 } // namespace ui 224 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/frame_generator.cc ('k') | ui/android/delegated_frame_host_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698