diff --git a/sky/shell/platform/linux/platform_view_linux.cc b/sky/shell/platform/linux/platform_view_linux.cc index 73fee52ab70..106e3c923e3 100644 --- a/sky/shell/platform/linux/platform_view_linux.cc +++ b/sky/shell/platform/linux/platform_view_linux.cc @@ -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 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 diff --git a/sky/shell/platform/linux/platform_view_linux.h b/sky/shell/platform/linux/platform_view_linux.h new file mode 100644 index 00000000000..1afa3bae581 --- /dev/null +++ b/sky/shell/platform/linux/platform_view_linux.h @@ -0,0 +1,40 @@ +// 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 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 weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(PlatformViewLinux); +}; + +} // namespace shell +} // namespace sky + +#endif // SKY_SHELL_PLATFORM_LINUX_PLATFORM_VIEW_LINUX_H_