提交 ca72520d 编写于 作者: J Jason Simmons 提交者: GitHub

Provide a PlatformView implementation for Linux (#2796)

上级 3976beb1
......@@ -2,13 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sky/shell/platform_view.h"
#include "sky/shell/platform/linux/platform_view_linux.h"
namespace sky {
namespace shell {
PlatformView* PlatformView::Create(const Config& config) {
return new PlatformView(config);
PlatformView* PlatformView::Create(const Config& config,
SurfaceConfig surface_config) {
return new PlatformViewLinux(config, surface_config);
}
PlatformViewLinux::PlatformViewLinux(const Config& config,
SurfaceConfig surface_config)
: PlatformView(config, surface_config), weak_factory_(this) {}
PlatformViewLinux::~PlatformViewLinux() {}
base::WeakPtr<sky::shell::PlatformView> PlatformViewLinux::GetWeakViewPtr() {
return weak_factory_.GetWeakPtr();
}
uint64_t PlatformViewLinux::DefaultFramebuffer() const {
return 0;
}
bool PlatformViewLinux::ContextMakeCurrent() {
return false;
}
bool PlatformViewLinux::SwapBuffers() {
return false;
}
} // namespace shell
......
// Copyright 2016 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 SKY_SHELL_PLATFORM_LINUX_PLATFORM_VIEW_LINUX_H_
#define SKY_SHELL_PLATFORM_LINUX_PLATFORM_VIEW_LINUX_H_
#include "sky/shell/platform_view.h"
namespace sky {
namespace shell {
class PlatformViewLinux : public PlatformView {
public:
explicit PlatformViewLinux(const Config& config, SurfaceConfig surface_config);
~PlatformViewLinux() override;
// sky::shell::PlatformView override
base::WeakPtr<sky::shell::PlatformView> GetWeakViewPtr() override;
// sky::shell::PlatformView override
uint64_t DefaultFramebuffer() const override;
// sky::shell::PlatformView override
bool ContextMakeCurrent() override;
// sky::shell::PlatformView override
bool SwapBuffers() override;
private:
base::WeakPtrFactory<PlatformViewLinux> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PlatformViewLinux);
};
} // namespace shell
} // namespace sky
#endif // SKY_SHELL_PLATFORM_LINUX_PLATFORM_VIEW_LINUX_H_
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册