Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/webview_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@

## 0.3.9
* Update LWE binary (6bae13cb915bd41c5aac4aaaae72865f20924c03)

## 0.3.10
* Apply PlatformView, PlatformViewFactory APIs change
2 changes: 1 addition & 1 deletion packages/webview_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This package is not an _endorsed_ implementation of `webview_flutter`. Therefore

```yaml
dependencies:
webview_flutter_tizen: ^0.3.8
webview_flutter_tizen: ^0.3.10
```

## Example
Expand Down
2 changes: 1 addition & 1 deletion packages/webview_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_tizen
description: Tizen implementation of the webview plugin
homepage: https://github.com/flutter-tizen/plugins
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/webview_flutter
version: 0.3.9
version: 0.3.10

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
has_navigation_delegate_(false),
has_progress_tracking_(false),
context_(nullptr),
texture_variant_(nullptr) {
texture_variant_(nullptr),
platform_window_(platform_window) {
tbm_pool_ = std::make_unique<BufferPool>(width, height);
texture_variant_ = new flutter::TextureVariant(flutter::GpuBufferTexture(
[this](size_t width, size_t height) -> const FlutterDesktopGpuBuffer* {
Expand Down
1 change: 1 addition & 0 deletions packages/webview_flutter/tizen/src/webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class WebView : public PlatformView {
flutter::TextureVariant* texture_variant_;
std::mutex mutex_;
std::unique_ptr<BufferPool> tbm_pool_;
void* platform_window_;
};

#endif // FLUTTER_PLUGIN_WEBVIEW_FLUTTER_TIZEN_WEVIEW_H_
7 changes: 5 additions & 2 deletions packages/webview_flutter/tizen/src/webview_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
#include "webview_flutter_tizen_plugin.h"

WebViewFactory::WebViewFactory(flutter::PluginRegistrar* registrar,
flutter::TextureRegistrar* texture_registrar)
: PlatformViewFactory(registrar), texture_registrar_(texture_registrar) {
flutter::TextureRegistrar* texture_registrar,
void* platform_window)
: PlatformViewFactory(registrar),
texture_registrar_(texture_registrar),
platform_window_(platform_window) {
char* path = app_get_data_path();
std::string path_string;
if (!path || strlen(path) == 0) {
Expand Down
4 changes: 3 additions & 1 deletion packages/webview_flutter/tizen/src/webview_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
class WebViewFactory : public PlatformViewFactory {
public:
WebViewFactory(flutter::PluginRegistrar* registrar,
flutter::TextureRegistrar* textureRegistrar);
flutter::TextureRegistrar* textureRegistrar,
void* platform_window);
virtual void Dispose() override;
virtual PlatformView* Create(
int viewId, double width, double height,
const std::vector<uint8_t>& createParams) override;

private:
flutter::TextureRegistrar* texture_registrar_;
void* platform_window_;
};

#endif // FLUTTER_PLUGIN_WEBVIEW_FLUTTER_TIZEN_WEVIEW_FACTORY_H_
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <memory>

#include "flutter_tizen.h"
#include "webview_factory.h"

static constexpr char kViewType[] = "plugins.flutter.io/webview";
Expand All @@ -26,7 +27,8 @@ void WebviewFlutterTizenPluginRegisterWithRegistrar(
flutter::PluginRegistrarManager::GetInstance()
->GetRegistrar<flutter::PluginRegistrar>(registrar);
auto factory = std::make_unique<WebViewFactory>(
core_registrar, core_registrar->texture_registrar());
FlutterRegisterViewFactory(registrar, kViewType, std::move(factory));
core_registrar, core_registrar->texture_registrar(),
FlutterDesktopGetWindow(registrar));
FlutterDesktopRegisterViewFactory(registrar, kViewType, std::move(factory));
WebviewFlutterTizenPlugin::RegisterWithRegistrar(core_registrar);
}