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

Side by Side Diff: cc/surfaces/direct_compositor_frame_sink.cc

Issue 2868473002: Implement aura::Window::CreateCompositorFrameSink() (Closed)
Patch Set: Address review issues Created 3 years, 7 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
OLDNEW
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 "cc/surfaces/direct_compositor_frame_sink.h" 5 #include "cc/surfaces/direct_compositor_frame_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/compositor_frame_sink_client.h" 9 #include "cc/output/compositor_frame_sink_client.h"
10 #include "cc/surfaces/display.h" 10 #include "cc/surfaces/display.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId(); 103 delegated_local_surface_id_ = local_surface_id_allocator_.GenerateId();
104 last_swap_frame_size_ = frame_size; 104 last_swap_frame_size_ = frame_size;
105 } 105 }
106 display_->SetLocalSurfaceId(delegated_local_surface_id_, 106 display_->SetLocalSurfaceId(delegated_local_surface_id_,
107 frame.metadata.device_scale_factor); 107 frame.metadata.device_scale_factor);
108 108
109 support_->SubmitCompositorFrame(delegated_local_surface_id_, 109 support_->SubmitCompositorFrame(delegated_local_surface_id_,
110 std::move(frame)); 110 std::move(frame));
111 } 111 }
112 112
113 void DirectCompositorFrameSink::EvictFrame() {
114 support_->EvictFrame();
115 }
116
113 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() { 117 void DirectCompositorFrameSink::DisplayOutputSurfaceLost() {
114 is_lost_ = true; 118 is_lost_ = true;
115 client_->DidLoseCompositorFrameSink(); 119 client_->DidLoseCompositorFrameSink();
116 } 120 }
117 121
118 void DirectCompositorFrameSink::DisplayWillDrawAndSwap( 122 void DirectCompositorFrameSink::DisplayWillDrawAndSwap(
119 bool will_draw_and_swap, 123 bool will_draw_and_swap,
120 const RenderPassList& render_passes) { 124 const RenderPassList& render_passes) {
121 // This notification is not relevant to our client outside of tests. 125 // This notification is not relevant to our client outside of tests.
122 } 126 }
(...skipping 29 matching lines...) Expand all
152 support_->SetNeedsBeginFrame(needs_begin_frame); 156 support_->SetNeedsBeginFrame(needs_begin_frame);
153 } 157 }
154 158
155 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) { 159 void DirectCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {
156 // If there was damage, SubmitCompositorFrame includes the ack. 160 // If there was damage, SubmitCompositorFrame includes the ack.
157 if (!ack.has_damage) 161 if (!ack.has_damage)
158 support_->BeginFrameDidNotSwap(ack); 162 support_->BeginFrameDidNotSwap(ack);
159 } 163 }
160 164
161 } // namespace cc 165 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698