diff --git a/engine/BUILD.gn b/engine/BUILD.gn index b94f7d515..e78ba4ebe 100644 --- a/engine/BUILD.gn +++ b/engine/BUILD.gn @@ -69,7 +69,8 @@ config("non_test_config") { group("engine") { deps = [ - "//sky/engine/web", "//sky/engine/platform", + "//sky/engine/public/sky", + "//sky/engine/web", ] } diff --git a/engine/public/sky/BUILD.gn b/engine/public/sky/BUILD.gn new file mode 100644 index 000000000..872d2d3d8 --- /dev/null +++ b/engine/public/sky/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2015 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. + +source_set("sky") { + deps = [ + "//skia", + "//sky/engine/core", + "//sky/engine/platform", + ] + + configs += [ + "//sky/engine:config", + "//sky/engine:inside_blink", + "//sky/engine:non_test_config", + ] + + sources = [ + "sky_display_metrics.h", + "sky_view.cc", + "sky_view.h", + ] +} diff --git a/engine/public/sky/sky_display_metrics.h b/engine/public/sky/sky_display_metrics.h new file mode 100644 index 000000000..5bdff08f6 --- /dev/null +++ b/engine/public/sky/sky_display_metrics.h @@ -0,0 +1,19 @@ +// Copyright 2015 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_ENGINE_PUBLIC_SKY_SKY_DISPLAY_METRICS_H_ +#define SKY_ENGINE_PUBLIC_SKY_SKY_DISPLAY_METRICS_H_ + +#include "sky/engine/public/platform/WebSize.h" + +namespace blink { + +struct SkyDisplayMetrics { + WebSize size; + float device_pixel_ratio; +}; + +} // namespace blink + +#endif // SKY_ENGINE_PUBLIC_SKY_SKY_DISPLAY_METRICS_H_ diff --git a/engine/public/sky/sky_view.cc b/engine/public/sky/sky_view.cc new file mode 100644 index 000000000..694f39f92 --- /dev/null +++ b/engine/public/sky/sky_view.cc @@ -0,0 +1,34 @@ +// Copyright 2015 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 "config.h" +#include "sky/engine/public/sky/sky_view.h" + +namespace blink { + +std::unique_ptr SkyView::Create() { + return std::unique_ptr(new SkyView); +} + +SkyView::SkyView() { +} + +SkyView::~SkyView() { +} + +void SkyView::SetDisplayMetrics(const SkyDisplayMetrics& metrics) { +} + +void SkyView::Load(const WebURL& url) { +} + +skia::RefPtr SkyView::Paint() { + return skia::RefPtr(); +} + +bool SkyView::HandleInputEvent(const WebInputEvent& event) { + return false; +} + +} // namespace blink diff --git a/engine/public/sky/sky_view.h b/engine/public/sky/sky_view.h new file mode 100644 index 000000000..aef82c405 --- /dev/null +++ b/engine/public/sky/sky_view.h @@ -0,0 +1,34 @@ +// Copyright 2015 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_ENGINE_PUBLIC_SKY_SKY_VIEW_H_ +#define SKY_ENGINE_PUBLIC_SKY_SKY_VIEW_H_ + +#include +#include "skia/ext/refptr.h" +#include "sky/engine/public/platform/WebCommon.h" +#include "sky/engine/public/platform/WebURL.h" +#include "sky/engine/public/sky/sky_display_metrics.h" +#include "third_party/skia/include/core/SkPicture.h" + +namespace blink { +class WebInputEvent; + +class SkyView { + public: + static std::unique_ptr Create(); + ~SkyView(); + + void SetDisplayMetrics(const SkyDisplayMetrics& metrics); + void Load(const WebURL& url); + skia::RefPtr Paint(); + bool HandleInputEvent(const WebInputEvent& event); + + private: + SkyView(); +}; + +} // namespace blink + +#endif // SKY_ENGINE_PUBLIC_SKY_SKY_VIEW_H_