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

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

Issue 2365753003: mus ws: Move 'reset(new' to base::MakeUnique. (Closed)
Patch Set: Merge with tot Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « services/ui/ws/focus_controller.cc ('k') | services/ui/ws/frame_generator_unittest.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 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 "base/containers/adapters.h" 7 #include "base/containers/adapters.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/quads/render_pass.h" 9 #include "cc/quads/render_pass.h"
10 #include "cc/quads/render_pass_draw_quad.h" 10 #include "cc/quads/render_pass_draw_quad.h"
(...skipping 22 matching lines...) Expand all
33 FrameGenerator::~FrameGenerator() { 33 FrameGenerator::~FrameGenerator() {
34 // Invalidate WeakPtrs now to avoid callbacks back into the 34 // Invalidate WeakPtrs now to avoid callbacks back into the
35 // FrameGenerator during destruction of |display_compositor_|. 35 // FrameGenerator during destruction of |display_compositor_|.
36 weak_factory_.InvalidateWeakPtrs(); 36 weak_factory_.InvalidateWeakPtrs();
37 display_compositor_.reset(); 37 display_compositor_.reset();
38 } 38 }
39 39
40 void FrameGenerator::OnGpuChannelEstablished( 40 void FrameGenerator::OnGpuChannelEstablished(
41 scoped_refptr<gpu::GpuChannelHost> channel) { 41 scoped_refptr<gpu::GpuChannelHost> channel) {
42 if (widget_ != gfx::kNullAcceleratedWidget) { 42 if (widget_ != gfx::kNullAcceleratedWidget) {
43 display_compositor_.reset( 43 display_compositor_ = base::MakeUnique<DisplayCompositor>(
44 new DisplayCompositor(base::ThreadTaskRunnerHandle::Get(), widget_, 44 base::ThreadTaskRunnerHandle::Get(), widget_, std::move(channel),
45 std::move(channel), surfaces_state_)); 45 surfaces_state_);
46 } else { 46 } else {
47 gpu_channel_ = std::move(channel); 47 gpu_channel_ = std::move(channel);
48 } 48 }
49 } 49 }
50 50
51 void FrameGenerator::RequestRedraw(const gfx::Rect& redraw_region) { 51 void FrameGenerator::RequestRedraw(const gfx::Rect& redraw_region) {
52 dirty_rect_.Union(redraw_region); 52 dirty_rect_.Union(redraw_region);
53 WantToDraw(); 53 WantToDraw();
54 } 54 }
55 55
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 gfx::Rect() /* opaque_rect */, 227 gfx::Rect() /* opaque_rect */,
228 bounds_at_origin /* visible_rect */, true /* needs_blending*/, 228 bounds_at_origin /* visible_rect */, true /* needs_blending*/,
229 underlay_surface->id()); 229 underlay_surface->id());
230 DCHECK(!underlay_surface->may_contain_video()); 230 DCHECK(!underlay_surface->may_contain_video());
231 } 231 }
232 } 232 }
233 233
234 } // namespace ws 234 } // namespace ws
235 235
236 } // namespace ui 236 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/focus_controller.cc ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698