2019-07-16 22:09:04 +02:00
|
|
|
// Copyright 2019 The Chromium Embedded Framework 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 CEF_LIBCEF_BROWSER_OSR_HOST_DISPLAY_CLIENT_OSR_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_OSR_HOST_DISPLAY_CLIENT_OSR_H_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2023-01-30 18:43:54 +01:00
|
|
|
#include "base/functional/callback.h"
|
2020-02-10 18:10:17 +01:00
|
|
|
#include "base/memory/shared_memory_mapping.h"
|
2019-07-16 22:09:04 +02:00
|
|
|
#include "components/viz/host/host_display_client.h"
|
|
|
|
#include "ui/gfx/native_widget_types.h"
|
|
|
|
|
|
|
|
class CefLayeredWindowUpdaterOSR;
|
|
|
|
class CefRenderWidgetHostViewOSR;
|
|
|
|
|
|
|
|
class CefHostDisplayClientOSR : public viz::HostDisplayClient {
|
|
|
|
public:
|
|
|
|
CefHostDisplayClientOSR(CefRenderWidgetHostViewOSR* const view,
|
|
|
|
gfx::AcceleratedWidget widget);
|
2021-12-06 21:40:25 +01:00
|
|
|
|
|
|
|
CefHostDisplayClientOSR(const CefHostDisplayClientOSR&) = delete;
|
|
|
|
CefHostDisplayClientOSR& operator=(const CefHostDisplayClientOSR&) = delete;
|
|
|
|
|
2019-07-16 22:09:04 +02:00
|
|
|
~CefHostDisplayClientOSR() override;
|
|
|
|
|
|
|
|
void SetActive(bool active);
|
|
|
|
const void* GetPixelMemory() const;
|
|
|
|
gfx::Size GetPixelSize() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// mojom::DisplayClient implementation.
|
|
|
|
void UseProxyOutputDevice(UseProxyOutputDeviceCallback callback) override;
|
|
|
|
|
|
|
|
void CreateLayeredWindowUpdater(
|
2019-11-12 17:11:44 +01:00
|
|
|
mojo::PendingReceiver<viz::mojom::LayeredWindowUpdater> receiver)
|
|
|
|
override;
|
|
|
|
|
2022-01-24 18:58:02 +01:00
|
|
|
#if BUILDFLAG(IS_LINUX)
|
2019-11-12 17:11:44 +01:00
|
|
|
void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
|
|
|
|
#endif
|
2019-07-16 22:09:04 +02:00
|
|
|
|
|
|
|
CefRenderWidgetHostViewOSR* const view_;
|
|
|
|
std::unique_ptr<CefLayeredWindowUpdaterOSR> layered_window_updater_;
|
|
|
|
bool active_ = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_OSR_HOST_DISPLAY_CLIENT_OSR_H_
|