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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/viz/client/local_surface_id_provider.cc
diff --git a/components/viz/client/local_surface_id_provider.cc b/components/viz/client/local_surface_id_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..caf3ca96063dc403abdb808a16a8823ba87b3bc1
--- /dev/null
+++ b/components/viz/client/local_surface_id_provider.cc
@@ -0,0 +1,29 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/viz/client/local_surface_id_provider.h"
+#include "cc/output/compositor_frame.h"
+
+namespace viz {
+
+LocalSurfaceIdProvider::LocalSurfaceIdProvider() = default;
+
+LocalSurfaceIdProvider::~LocalSurfaceIdProvider() = default;
+
+DefaultLocalSurfaceIdProvider::DefaultLocalSurfaceIdProvider() = default;
+
+const cc::LocalSurfaceId&
+DefaultLocalSurfaceIdProvider::GetLocalSurfaceIdForFrame(
+ const cc::CompositorFrame& frame) {
+ gfx::Size frame_size = frame.render_pass_list.back()->output_rect.size();
+ if (!local_surface_id_.is_valid() || surface_size_ != frame_size ||
+ frame.metadata.device_scale_factor != device_scale_factor_) {
+ local_surface_id_ = local_surface_id_allocator_.GenerateId();
+ }
+ surface_size_ = frame_size;
+ device_scale_factor_ = frame.metadata.device_scale_factor;
+ return local_surface_id_;
+}
+
+} // namespace viz
« 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