mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
With the update to HEAD of the Fuchsia buildtools repo, the new clang toolchain picked up caused link-time breakage in android x86_64 libFlutter.so builds. Sample log: https://build.chromium.org/p/client.flutter/builders/Linux%20Engine/builds/1974/steps/build%20android_debug_x64/logs/stdio Sample failure: FAILED: libflutter.so libflutter.so.TOC lib.stripped/libflutter.so ../../third_party/android_tools/ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld.gold: error: obj/flutter/shell/platform/android/libflutter/android_context_gl.o: unsupported reloc 42 against global symbol std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id This reverts commit fecc7aa281821e01037089846744b5331e3cbd22.
52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
// 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.
|
|
|
|
#include "flutter/shell/gpu/gpu_surface_vulkan.h"
|
|
#include "lib/fxl/logging.h"
|
|
|
|
namespace shell {
|
|
|
|
GPUSurfaceVulkan::GPUSurfaceVulkan(
|
|
fxl::RefPtr<vulkan::VulkanProcTable> proc_table,
|
|
std::unique_ptr<vulkan::VulkanNativeSurface> native_surface)
|
|
: window_(std::move(proc_table), std::move(native_surface)),
|
|
weak_factory_(this) {}
|
|
|
|
GPUSurfaceVulkan::~GPUSurfaceVulkan() = default;
|
|
|
|
bool GPUSurfaceVulkan::IsValid() {
|
|
return window_.IsValid();
|
|
}
|
|
|
|
std::unique_ptr<SurfaceFrame> GPUSurfaceVulkan::AcquireFrame(
|
|
const SkISize& size) {
|
|
auto surface = window_.AcquireSurface();
|
|
|
|
if (surface == nullptr) {
|
|
return nullptr;
|
|
}
|
|
|
|
SurfaceFrame::SubmitCallback callback = [weak_this =
|
|
weak_factory_.GetWeakPtr()](
|
|
const SurfaceFrame&,
|
|
SkCanvas* canvas)
|
|
->bool {
|
|
// Frames are only ever acquired on the GPU thread. This is also the thread
|
|
// on which the weak pointer factory is collected (as this instance is owned
|
|
// by the rasterizer). So this use of weak pointers is safe.
|
|
if (canvas == nullptr || !weak_this) {
|
|
return false;
|
|
}
|
|
return weak_this->window_.SwapBuffers();
|
|
};
|
|
return std::make_unique<SurfaceFrame>(std::move(surface),
|
|
std::move(callback));
|
|
}
|
|
|
|
GrContext* GPUSurfaceVulkan::GetContext() {
|
|
return window_.GetSkiaGrContext();
|
|
}
|
|
|
|
} // namespace shell
|