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

Side by Side Diff: services/ui/surfaces/display_compositor.cc

Issue 2547243002: Set device scale factor in CompositorFrame and scale frame size in WS. (Closed)
Patch Set: test Created 4 years 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 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/surfaces/display_compositor.h" 5 #include "services/ui/surfaces/display_compositor.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/output/in_process_context_provider.h" 9 #include "cc/output/in_process_context_provider.h"
10 #include "cc/output/texture_mailbox_deleter.h" 10 #include "cc/output/texture_mailbox_deleter.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 240
241 const cc::SurfaceId& DisplayCompositor::GetRootSurfaceId() const { 241 const cc::SurfaceId& DisplayCompositor::GetRootSurfaceId() const {
242 return reference_manager_->GetRootSurfaceId(); 242 return reference_manager_->GetRootSurfaceId();
243 } 243 }
244 244
245 void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceId& surface_id, 245 void DisplayCompositor::OnSurfaceCreated(const cc::SurfaceId& surface_id,
246 const gfx::Size& frame_size, 246 const gfx::Size& frame_size,
247 float device_scale_factor) { 247 float device_scale_factor) {
248 DCHECK(thread_checker_.CalledOnValidThread()); 248 DCHECK(thread_checker_.CalledOnValidThread());
249 DCHECK_GT(device_scale_factor, 0.0f);
249 // We can get into a situation where multiple CompositorFrames arrive for a 250 // We can get into a situation where multiple CompositorFrames arrive for a
250 // CompositorFrameSink before the DisplayCompositorClient can add any 251 // CompositorFrameSink before the DisplayCompositorClient can add any
251 // references for the frame. When the second frame with a new size arrives, 252 // references for the frame. When the second frame with a new size arrives,
252 // the first will be destroyed and then if there are no references it will be 253 // the first will be destroyed and then if there are no references it will be
253 // deleted during surface GC. A temporary reference, removed when a real 254 // deleted during surface GC. A temporary reference, removed when a real
254 // reference is received, is added to prevent this from happening. 255 // reference is received, is added to prevent this from happening.
255 reference_manager_->AddSurfaceReference(GetRootSurfaceId(), surface_id); 256 reference_manager_->AddSurfaceReference(GetRootSurfaceId(), surface_id);
256 temp_references_[surface_id.frame_sink_id()].push_back( 257 temp_references_[surface_id.frame_sink_id()].push_back(
257 surface_id.local_frame_id()); 258 surface_id.local_frame_id());
258 259
259 if (client_) 260 if (client_)
260 client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor); 261 client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor);
261 } 262 }
262 263
263 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, 264 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id,
264 bool* changed) {} 265 bool* changed) {}
265 266
266 } // namespace ui 267 } // namespace ui
OLDNEW
« no previous file with comments | « content/browser/compositor/mus_browser_compositor_output_surface.cc ('k') | services/ui/ws/frame_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698