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

Side by Side Diff: components/viz/client/local_surface_id_provider.cc

Issue 2923583002: Remove RendererCompositorFrameSink and use ClientCompositorFrameSink instead (Closed)
Patch Set: c Created 3 years, 6 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/viz/client/local_surface_id_provider.h"
6 #include "cc/output/compositor_frame.h"
7
8 namespace viz {
9
10 const cc::LocalSurfaceId&
11 DefaultLocalSurfaceIdProvider::GetLocalSurfaceIdForFrame(
12 const cc::CompositorFrame& frame) {
13 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
14 if (!local_surface_id_.is_valid() || surface_size_ != frame_size ||
15 frame.metadata.device_scale_factor != device_scale_factor_) {
16 local_surface_id_ = local_surface_id_allocator_.GenerateId();
17 }
18 surface_size_ = frame_size;
19 device_scale_factor_ = frame.metadata.device_scale_factor;
20 return local_surface_id_;
21 }
22
23 } // namespace viz
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698