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

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

Issue 2923583002: Remove RendererCompositorFrameSink and use ClientCompositorFrameSink instead (Closed)
Patch Set: Fix windows 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
« no previous file with comments | « components/viz/client/local_surface_id_provider.h ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 LocalSurfaceIdProvider::LocalSurfaceIdProvider() = default;
11
12 LocalSurfaceIdProvider::~LocalSurfaceIdProvider() = default;
13
14 DefaultLocalSurfaceIdProvider::DefaultLocalSurfaceIdProvider() = default;
15
16 const cc::LocalSurfaceId&
17 DefaultLocalSurfaceIdProvider::GetLocalSurfaceIdForFrame(
18 const cc::CompositorFrame& frame) {
19 gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
20 if (!local_surface_id_.is_valid() || surface_size_ != frame_size ||
21 frame.metadata.device_scale_factor != device_scale_factor_) {
22 local_surface_id_ = local_surface_id_allocator_.GenerateId();
23 }
24 surface_size_ = frame_size;
25 device_scale_factor_ = frame.metadata.device_scale_factor;
26 return local_surface_id_;
27 }
28
29 } // namespace viz
OLDNEW
« no previous file with comments | « components/viz/client/local_surface_id_provider.h ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698