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

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

Issue 2669183002: Seems incorrect to se device_scale_factor in SetLocalSurfaceId.
Patch Set: Created 3 years, 10 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 CompositorFrameSink::DetachFromClient(); 87 CompositorFrameSink::DetachFromClient();
88 } 88 }
89 89
90 void DirectCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { 90 void DirectCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
91 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size(); 91 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
92 if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) { 92 if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) {
93 delegated_local_surface_id_ = surface_id_allocator_.GenerateId(); 93 delegated_local_surface_id_ = surface_id_allocator_.GenerateId();
94 last_swap_frame_size_ = frame_size; 94 last_swap_frame_size_ = frame_size;
95 } 95 }
96 display_->SetLocalSurfaceId(delegated_local_surface_id_, 96 display_->SetLocalSurfaceId(delegated_local_surface_id_);
97 frame.metadata.device_scale_factor); 97 display_->SetDeviceScaleFactor(frame.metadata.device_scale_factor);
98 98
99 factory_.SubmitCompositorFrame( 99 factory_.SubmitCompositorFrame(
100 delegated_local_surface_id_, std::move(frame), 100 delegated_local_surface_id_, std::move(frame),
101 base::Bind(&DirectCompositorFrameSink::DidDrawCallback, 101 base::Bind(&DirectCompositorFrameSink::DidDrawCallback,
102 base::Unretained(this))); 102 base::Unretained(this)));
103 } 103 }
104 104
105 void DirectCompositorFrameSink::ForceReclaimResources() { 105 void DirectCompositorFrameSink::ForceReclaimResources() {
106 if (delegated_local_surface_id_.is_valid()) 106 if (delegated_local_surface_id_.is_valid())
107 factory_.ClearSurface(); 107 factory_.ClearSurface();
(...skipping 26 matching lines...) Expand all
134 // This notification is not relevant to our client outside of tests. We 134 // This notification is not relevant to our client outside of tests. We
135 // unblock the client from DidDrawCallback() when the surface is going to 135 // unblock the client from DidDrawCallback() when the surface is going to
136 // be drawn. 136 // be drawn.
137 } 137 }
138 138
139 void DirectCompositorFrameSink::DidDrawCallback() { 139 void DirectCompositorFrameSink::DidDrawCallback() {
140 client_->DidReceiveCompositorFrameAck(); 140 client_->DidReceiveCompositorFrameAck();
141 } 141 }
142 142
143 } // namespace cc 143 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698