null_platform_view.cc 1.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
// Copyright 2017 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 "flutter/shell/common/null_platform_view.h"

#include "flutter/shell/common/null_rasterizer.h"
#include "flutter/shell/common/shell.h"

namespace shell {

NullPlatformView::NullPlatformView()
    : PlatformView(std::make_unique<NullRasterizer>()), weak_factory_(this) {}

void NullPlatformView::Attach() {
  CreateEngine();
}

NullPlatformView::~NullPlatformView() = default;

fxl::WeakPtr<NullPlatformView> NullPlatformView::GetWeakPtr() {
  return weak_factory_.GetWeakPtr();
}

bool NullPlatformView::ResourceContextMakeCurrent() {
  return false;
}

// Hot-reload of the null platform view is not supported.
void NullPlatformView::RunFromSource(const std::string& assets_directory,
                                     const std::string& main,
                                     const std::string& packages) {}

void NullPlatformView::SetAssetBundlePath(const std::string& assets_directory) {
}

}  // namespace shell