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

Unified Diff: components/viz/client/local_surface_id_provider.h

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
Index: components/viz/client/local_surface_id_provider.h
diff --git a/components/viz/client/local_surface_id_provider.h b/components/viz/client/local_surface_id_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..50f4dd2e77d0658f25002c40f7a62fc09d728a69
--- /dev/null
+++ b/components/viz/client/local_surface_id_provider.h
@@ -0,0 +1,48 @@
+// 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.
+
+#ifndef COMPONENTS_VIZ_CLIENT_LOCAL_SURFACE_ID_PROVIDER_H_
+#define COMPONENTS_VIZ_CLIENT_LOCAL_SURFACE_ID_PROVIDER_H_
+
+#include "cc/surfaces/local_surface_id.h"
+#include "cc/surfaces/local_surface_id_allocator.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace cc {
+class CompositorFrame;
+}
+
+namespace viz {
+
+class LocalSurfaceIdProvider {
+ public:
+ LocalSurfaceIdProvider();
+ virtual ~LocalSurfaceIdProvider();
+
+ virtual const cc::LocalSurfaceId& GetLocalSurfaceIdForFrame(
+ const cc::CompositorFrame& frame) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LocalSurfaceIdProvider);
+};
+
+class DefaultLocalSurfaceIdProvider : public LocalSurfaceIdProvider {
+ public:
+ DefaultLocalSurfaceIdProvider();
+
+ const cc::LocalSurfaceId& GetLocalSurfaceIdForFrame(
+ const cc::CompositorFrame& frame) override;
+
+ private:
+ cc::LocalSurfaceId local_surface_id_;
+ gfx::Size surface_size_;
+ float device_scale_factor_ = 0;
+ cc::LocalSurfaceIdAllocator local_surface_id_allocator_;
+
+ DISALLOW_COPY_AND_ASSIGN(DefaultLocalSurfaceIdProvider);
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_CLIENT_LOCAL_SURFACE_ID_PROVIDER_H_
« no previous file with comments | « components/viz/client/client_compositor_frame_sink.cc ('k') | components/viz/client/local_surface_id_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698