fuchsia: Improve checking/logging for composition (flutter/engine#26166)
This commit is contained in:
@@ -128,7 +128,7 @@ void FuchsiaExternalViewEmbedder::PrerollCompositeEmbeddedView(
|
||||
int view_id,
|
||||
std::unique_ptr<flutter::EmbeddedViewParams> params) {
|
||||
zx_handle_t handle = static_cast<zx_handle_t>(view_id);
|
||||
FML_DCHECK(frame_layers_.count(handle) == 0);
|
||||
FML_CHECK(frame_layers_.count(handle) == 0);
|
||||
|
||||
frame_layers_.emplace(std::make_pair(EmbedderLayerId{handle},
|
||||
EmbedderLayer(frame_size_, *params)));
|
||||
@@ -138,7 +138,7 @@ void FuchsiaExternalViewEmbedder::PrerollCompositeEmbeddedView(
|
||||
SkCanvas* FuchsiaExternalViewEmbedder::CompositeEmbeddedView(int view_id) {
|
||||
zx_handle_t handle = static_cast<zx_handle_t>(view_id);
|
||||
auto found = frame_layers_.find(handle);
|
||||
FML_DCHECK(found != frame_layers_.end());
|
||||
FML_CHECK(found != frame_layers_.end());
|
||||
|
||||
return found->second.canvas_spy->GetSpyingCanvas();
|
||||
}
|
||||
@@ -178,7 +178,7 @@ void FuchsiaExternalViewEmbedder::BeginFrame(
|
||||
scenic_interceptor_rects_.emplace(std::make_pair(
|
||||
rect_hash, scenic::Rectangle(session_.get(), frame_size_.width(),
|
||||
frame_size_.height())));
|
||||
FML_DCHECK(success);
|
||||
FML_CHECK(success);
|
||||
|
||||
found_rect = std::move(emplaced_rect);
|
||||
}
|
||||
@@ -216,10 +216,16 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
|
||||
auto surface =
|
||||
surface_producer_.ProduceSurface(layer.second.surface_size);
|
||||
FML_DCHECK(surface)
|
||||
<< "Embedder did not return a valid render target of size ("
|
||||
<< layer.second.surface_size.width() << ", "
|
||||
<< layer.second.surface_size.height() << ")";
|
||||
if (!surface) {
|
||||
const std::string layer_id_str =
|
||||
layer.first.has_value() ? std::to_string(layer.first.value())
|
||||
: "Background";
|
||||
FML_LOG(ERROR) << "Failed to create surface for layer " << layer_id_str
|
||||
<< "; size (" << layer.second.surface_size.width()
|
||||
<< ", " << layer.second.surface_size.height() << ")";
|
||||
FML_DCHECK(false);
|
||||
continue;
|
||||
}
|
||||
|
||||
frame_surface_indices.emplace(
|
||||
std::make_pair(layer.first, frame_surfaces.size()));
|
||||
@@ -242,11 +248,11 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
bool first_layer = true;
|
||||
for (const auto& layer_id : frame_composition_order_) {
|
||||
const auto& layer = frame_layers_.find(layer_id);
|
||||
FML_DCHECK(layer != frame_layers_.end());
|
||||
FML_CHECK(layer != frame_layers_.end());
|
||||
|
||||
// Draw the PlatformView associated with each layer first.
|
||||
if (layer_id.has_value()) {
|
||||
FML_DCHECK(layer->second.embedded_view_params.has_value());
|
||||
FML_CHECK(layer->second.embedded_view_params.has_value());
|
||||
auto& view_params = layer->second.embedded_view_params.value();
|
||||
|
||||
// Validate the MutatorsStack encodes the same transform as the
|
||||
@@ -256,7 +262,7 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
|
||||
// Get the ScenicView structure corresponding to the platform view.
|
||||
auto found = scenic_views_.find(layer_id.value());
|
||||
FML_DCHECK(found != scenic_views_.end());
|
||||
FML_CHECK(found != scenic_views_.end());
|
||||
auto& view_holder = found->second;
|
||||
|
||||
// Compute offset and size for the platform view.
|
||||
@@ -338,14 +344,28 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
embedded_views_height += kScenicZElevationForPlatformView;
|
||||
}
|
||||
|
||||
// Acquire the surface associated with the layer.
|
||||
SurfaceProducerSurface* surface_for_layer = nullptr;
|
||||
if (layer->second.canvas_spy->DidDrawIntoCanvas()) {
|
||||
const auto& surface_index = frame_surface_indices.find(layer_id);
|
||||
FML_DCHECK(surface_index != frame_surface_indices.end());
|
||||
uint32_t surface_image_id =
|
||||
frame_surfaces[surface_index->second]->GetImageId();
|
||||
if (surface_index != frame_surface_indices.end()) {
|
||||
FML_CHECK(surface_index->second < frame_surfaces.size());
|
||||
surface_for_layer = frame_surfaces[surface_index->second].get();
|
||||
FML_CHECK(surface_for_layer != nullptr);
|
||||
} else {
|
||||
const std::string layer_id_str =
|
||||
layer_id.has_value() ? std::to_string(layer_id.value())
|
||||
: "Background";
|
||||
FML_LOG(ERROR) << "Missing surface for layer " << layer_id_str
|
||||
<< "; skipping scene graph add of layer.";
|
||||
FML_DCHECK(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the layer if we acquired a surface for it successfully.
|
||||
if (surface_for_layer != nullptr) {
|
||||
// Create a new layer if needed for the surface.
|
||||
FML_DCHECK(scenic_layer_index <= scenic_layers_.size());
|
||||
FML_CHECK(scenic_layer_index <= scenic_layers_.size());
|
||||
if (scenic_layer_index == scenic_layers_.size()) {
|
||||
ScenicLayer new_layer{
|
||||
.shape_node = scenic::ShapeNode(session_.get()),
|
||||
@@ -373,11 +393,11 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
if (found_rects == scenic_rects_.end()) {
|
||||
auto [emplaced_rects, success] = scenic_rects_.emplace(
|
||||
std::make_pair(rect_hash, std::vector<scenic::Rectangle>()));
|
||||
FML_DCHECK(success);
|
||||
FML_CHECK(success);
|
||||
|
||||
found_rects = std::move(emplaced_rects);
|
||||
}
|
||||
FML_DCHECK(rect_index <= found_rects->second.size());
|
||||
FML_CHECK(rect_index <= found_rects->second.size());
|
||||
if (rect_index == found_rects->second.size()) {
|
||||
found_rects->second.emplace_back(scenic::Rectangle(
|
||||
session_.get(), layer->second.surface_size.width(),
|
||||
@@ -409,7 +429,7 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
layer->second.surface_size.height() * 0.5f, -layer_elevation);
|
||||
scenic_layer.material.SetColor(SK_AlphaOPAQUE, SK_AlphaOPAQUE,
|
||||
SK_AlphaOPAQUE, layer_opacity);
|
||||
scenic_layer.material.SetTexture(surface_image_id);
|
||||
scenic_layer.material.SetTexture(surface_for_layer->GetImageId());
|
||||
|
||||
// Only the first (i.e. the bottom-most) layer should receive input.
|
||||
// TODO: Workaround for invisible overlays stealing input. Remove when
|
||||
@@ -421,13 +441,13 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
|
||||
// Attach the ScenicLayer to the main scene graph.
|
||||
layer_tree_node_.AddChild(scenic_layer.shape_node);
|
||||
|
||||
// Reset for the next pass:
|
||||
// +The next layer will not be the first layer.
|
||||
// +Account for the current layer's height when positioning the next.
|
||||
first_layer = false;
|
||||
scenic_layer_index++;
|
||||
}
|
||||
|
||||
// Reset for the next pass:
|
||||
// +The next layer will not be the first layer.
|
||||
// +Account for the current layer's height when positioning the next.
|
||||
first_layer = false;
|
||||
scenic_layer_index++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,20 +465,23 @@ void FuchsiaExternalViewEmbedder::SubmitFrame(
|
||||
for (const auto& surface_index : frame_surface_indices) {
|
||||
TRACE_EVENT0("flutter", "RasterizeSurface");
|
||||
|
||||
FML_CHECK(surface_index.second < frame_surfaces.size());
|
||||
SurfaceProducerSurface* surface =
|
||||
frame_surfaces[surface_index.second].get();
|
||||
FML_CHECK(surface != nullptr);
|
||||
|
||||
sk_sp<SkSurface> sk_surface = surface->GetSkiaSurface();
|
||||
FML_CHECK(sk_surface != nullptr);
|
||||
FML_CHECK(SkISize::Make(sk_surface->width(), sk_surface->height()) ==
|
||||
frame_size_);
|
||||
SkCanvas* canvas = sk_surface->getCanvas();
|
||||
FML_CHECK(canvas != nullptr);
|
||||
|
||||
const auto& layer = frame_layers_.find(surface_index.first);
|
||||
FML_DCHECK(layer != frame_layers_.end());
|
||||
FML_CHECK(layer != frame_layers_.end());
|
||||
sk_sp<SkPicture> picture =
|
||||
layer->second.recorder->finishRecordingAsPicture();
|
||||
FML_DCHECK(picture);
|
||||
|
||||
sk_sp<SkSurface> sk_surface =
|
||||
frame_surfaces[surface_index.second]->GetSkiaSurface();
|
||||
FML_DCHECK(sk_surface);
|
||||
FML_DCHECK(SkISize::Make(sk_surface->width(), sk_surface->height()) ==
|
||||
frame_size_);
|
||||
|
||||
SkCanvas* canvas = sk_surface->getCanvas();
|
||||
FML_DCHECK(canvas);
|
||||
FML_CHECK(picture != nullptr);
|
||||
|
||||
canvas->setMatrix(SkMatrix::I());
|
||||
canvas->clear(SK_ColorTRANSPARENT);
|
||||
@@ -486,7 +509,7 @@ void FuchsiaExternalViewEmbedder::EnableWireframe(bool enable) {
|
||||
|
||||
void FuchsiaExternalViewEmbedder::CreateView(int64_t view_id,
|
||||
ViewIdCallback on_view_bound) {
|
||||
FML_DCHECK(scenic_views_.find(view_id) == scenic_views_.end());
|
||||
FML_CHECK(scenic_views_.find(view_id) == scenic_views_.end());
|
||||
|
||||
ScenicView new_view = {
|
||||
.opacity_node = scenic::OpacityNodeHACK(session_.get()),
|
||||
@@ -511,7 +534,7 @@ void FuchsiaExternalViewEmbedder::CreateView(int64_t view_id,
|
||||
void FuchsiaExternalViewEmbedder::DestroyView(int64_t view_id,
|
||||
ViewIdCallback on_view_unbound) {
|
||||
auto scenic_view = scenic_views_.find(view_id);
|
||||
FML_DCHECK(scenic_view != scenic_views_.end());
|
||||
FML_CHECK(scenic_view != scenic_views_.end());
|
||||
scenic::ResourceId resource_id = scenic_view->second.view_holder.id();
|
||||
|
||||
scenic_views_.erase(scenic_view);
|
||||
@@ -524,7 +547,7 @@ void FuchsiaExternalViewEmbedder::SetViewProperties(
|
||||
bool hit_testable,
|
||||
bool focusable) {
|
||||
auto found = scenic_views_.find(view_id);
|
||||
FML_DCHECK(found != scenic_views_.end());
|
||||
FML_CHECK(found != scenic_views_.end());
|
||||
auto& view_holder = found->second;
|
||||
|
||||
view_holder.pending_occlusion_hint = occlusion_hint;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#define LOG_AND_RETURN(cond, msg) \
|
||||
if (cond) { \
|
||||
FML_DLOG(ERROR) << msg; \
|
||||
FML_LOG(ERROR) << msg; \
|
||||
return false; \
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ bool VulkanSurface::CreateVulkanImage(vulkan::VulkanProvider& vulkan_provider,
|
||||
VulkanImage* out_vulkan_image) {
|
||||
TRACE_EVENT0("flutter", "CreateVulkanImage");
|
||||
|
||||
FML_DCHECK(!size.isEmpty());
|
||||
FML_DCHECK(out_vulkan_image != nullptr);
|
||||
FML_CHECK(!size.isEmpty());
|
||||
FML_CHECK(out_vulkan_image != nullptr);
|
||||
|
||||
out_vulkan_image->vk_collection_image_create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA,
|
||||
@@ -108,16 +108,17 @@ VulkanSurface::VulkanSurface(
|
||||
const SkISize& size,
|
||||
uint32_t buffer_id)
|
||||
: vulkan_provider_(vulkan_provider), session_(session), wait_(this) {
|
||||
FML_DCHECK(session_);
|
||||
FML_CHECK(session_ != nullptr);
|
||||
FML_CHECK(context != nullptr);
|
||||
|
||||
if (!AllocateDeviceMemory(sysmem_allocator, std::move(context), size,
|
||||
buffer_id)) {
|
||||
FML_DLOG(INFO) << "Could not allocate device memory.";
|
||||
FML_LOG(ERROR) << "VulkanSurface: Could not allocate device memory.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CreateFences()) {
|
||||
FML_DLOG(INFO) << "Could not create signal fences.";
|
||||
FML_LOG(ERROR) << "VulkanSurface: Could not create signal fences.";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,7 +164,7 @@ vulkan::VulkanHandle<VkSemaphore> VulkanSurface::SemaphoreFromEvent(
|
||||
zx::event semaphore_event;
|
||||
zx_status_t status = event.duplicate(ZX_RIGHT_SAME_RIGHTS, &semaphore_event);
|
||||
if (status != ZX_OK) {
|
||||
FML_DLOG(ERROR) << "failed to duplicate semaphore event";
|
||||
FML_LOG(ERROR) << "VulkanSurface: Failed to duplicate semaphore event";
|
||||
return vulkan::VulkanHandle<VkSemaphore>();
|
||||
}
|
||||
|
||||
@@ -204,16 +205,18 @@ vulkan::VulkanHandle<VkSemaphore> VulkanSurface::SemaphoreFromEvent(
|
||||
|
||||
bool VulkanSurface::CreateFences() {
|
||||
if (zx::event::create(0, &acquire_event_) != ZX_OK) {
|
||||
FML_LOG(ERROR) << "VulkanSurface: Failed to create acquire event";
|
||||
return false;
|
||||
}
|
||||
|
||||
acquire_semaphore_ = SemaphoreFromEvent(acquire_event_);
|
||||
if (!acquire_semaphore_) {
|
||||
FML_DLOG(ERROR) << "failed to create acquire semaphore";
|
||||
FML_LOG(ERROR) << "VulkanSurface: Failed to create acquire semaphore";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (zx::event::create(0, &release_event_) != ZX_OK) {
|
||||
FML_LOG(ERROR) << "VulkanSurface: Failed to create release event";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -234,13 +237,16 @@ bool VulkanSurface::AllocateDeviceMemory(
|
||||
fuchsia::sysmem::BufferCollectionTokenSyncPtr vulkan_token;
|
||||
zx_status_t status =
|
||||
sysmem_allocator->AllocateSharedCollection(vulkan_token.NewRequest());
|
||||
LOG_AND_RETURN(status != ZX_OK, "Failed to allocate collection");
|
||||
LOG_AND_RETURN(status != ZX_OK,
|
||||
"VulkanSurface: Failed to allocate collection");
|
||||
fuchsia::sysmem::BufferCollectionTokenSyncPtr scenic_token;
|
||||
status = vulkan_token->Duplicate(std::numeric_limits<uint32_t>::max(),
|
||||
scenic_token.NewRequest());
|
||||
LOG_AND_RETURN(status != ZX_OK, "Failed to duplicate token");
|
||||
LOG_AND_RETURN(status != ZX_OK,
|
||||
"VulkanSurface: Failed to duplicate collection token");
|
||||
status = vulkan_token->Sync();
|
||||
LOG_AND_RETURN(status != ZX_OK, "Failed to sync token");
|
||||
LOG_AND_RETURN(status != ZX_OK,
|
||||
"VulkanSurface: Failed to sync collection token");
|
||||
|
||||
session_->RegisterBufferCollection(buffer_id, std::move(scenic_token));
|
||||
buffer_id_ = buffer_id;
|
||||
@@ -262,7 +268,7 @@ bool VulkanSurface::AllocateDeviceMemory(
|
||||
|
||||
VulkanImage vulkan_image;
|
||||
LOG_AND_RETURN(!CreateVulkanImage(vulkan_provider_, size, &vulkan_image),
|
||||
"Failed to create VkImage");
|
||||
"VulkanSurface: Failed to create VkImage");
|
||||
|
||||
vulkan_image_ = std::move(vulkan_image);
|
||||
const VkMemoryRequirements& memory_requirements =
|
||||
@@ -328,9 +334,7 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp<GrDirectContext> context,
|
||||
SkColorType color_type,
|
||||
const VkImageCreateInfo& image_create_info,
|
||||
const VkMemoryRequirements& memory_reqs) {
|
||||
if (context == nullptr) {
|
||||
return false;
|
||||
}
|
||||
FML_CHECK(context != nullptr);
|
||||
|
||||
GrVkAlloc alloc;
|
||||
alloc.fMemory = vk_memory_;
|
||||
@@ -408,7 +412,7 @@ bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() {
|
||||
|
||||
void VulkanSurface::SignalWritesFinished(
|
||||
const std::function<void(void)>& on_writes_committed) {
|
||||
FML_DCHECK(on_writes_committed);
|
||||
FML_CHECK(on_writes_committed);
|
||||
|
||||
if (!valid_) {
|
||||
on_writes_committed();
|
||||
|
||||
@@ -35,6 +35,8 @@ VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider,
|
||||
: vulkan_provider_(vulkan_provider),
|
||||
context_(std::move(context)),
|
||||
scenic_session_(scenic_session) {
|
||||
FML_CHECK(context_ != nullptr);
|
||||
|
||||
zx_status_t status = fdio_service_connect(
|
||||
"/svc/fuchsia.sysmem.Allocator",
|
||||
sysmem_allocator_.NewRequest().TakeChannel().release());
|
||||
@@ -50,12 +52,13 @@ std::unique_ptr<VulkanSurface> VulkanSurfacePool::AcquireSurface(
|
||||
auto surface = GetCachedOrCreateSurface(size);
|
||||
|
||||
if (surface == nullptr) {
|
||||
FML_DLOG(ERROR) << "Could not acquire surface";
|
||||
FML_LOG(ERROR) << "VulkanSurfaceProducer: Could not acquire surface";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!surface->FlushSessionAcquireAndReleaseEvents()) {
|
||||
FML_DLOG(ERROR) << "Could not flush acquire/release events for buffer.";
|
||||
FML_LOG(ERROR) << "VulkanSurfaceProducer: Could not flush acquire/release "
|
||||
"events for buffer.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -117,6 +120,7 @@ std::unique_ptr<VulkanSurface> VulkanSurfacePool::CreateSurface(
|
||||
vulkan_provider_, sysmem_allocator_, context_, scenic_session_, size,
|
||||
buffer_id_++);
|
||||
if (!surface->IsValid()) {
|
||||
FML_LOG(ERROR) << "VulkanSurfaceProducer: Created surface is invalid";
|
||||
return nullptr;
|
||||
}
|
||||
trace_surfaces_created_++;
|
||||
@@ -189,7 +193,8 @@ void VulkanSurfacePool::AgeAndCollectOldBuffers() {
|
||||
if (new_surface != nullptr) {
|
||||
available_surfaces_.push_back(std::move(new_surface));
|
||||
} else {
|
||||
FML_DLOG(ERROR) << "Failed to create a new shrunk surface";
|
||||
FML_LOG(ERROR)
|
||||
<< "VulkanSurfaceProducer: Failed to create a new shrunk surface";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +221,8 @@ void VulkanSurfacePool::ShrinkToFit() {
|
||||
if (surface != nullptr) {
|
||||
available_surfaces_.push_back(std::move(surface));
|
||||
} else {
|
||||
FML_DLOG(ERROR) << "Failed to create resized surface";
|
||||
FML_LOG(ERROR)
|
||||
<< "VulkanSurfaceProducer: Failed to create resized surface";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,8 @@ constexpr size_t kGrCacheMaxByteSize = 1024 * 600 * 12 * 4;
|
||||
VulkanSurfaceProducer::VulkanSurfaceProducer(scenic::Session* scenic_session) {
|
||||
valid_ = Initialize(scenic_session);
|
||||
|
||||
if (valid_) {
|
||||
FML_DLOG(INFO)
|
||||
<< "Flutter engine: Vulkan surface producer initialization: Successful";
|
||||
} else {
|
||||
FML_LOG(ERROR)
|
||||
<< "Flutter engine: Vulkan surface producer initialization: Failed";
|
||||
if (!valid_) {
|
||||
FML_LOG(FATAL) << "VulkanSurfaceProducer: Initialization failed";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +71,8 @@ bool VulkanSurfaceProducer::Initialize(scenic::Session* scenic_session) {
|
||||
if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) {
|
||||
// Make certain the application instance was created and it set up the
|
||||
// instance proc table entries.
|
||||
FML_LOG(ERROR) << "Instance proc addresses have not been set up.";
|
||||
FML_LOG(ERROR) << "VulkanSurfaceProducer: Instance proc addresses have not "
|
||||
"been set up.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,30 +84,33 @@ bool VulkanSurfaceProducer::Initialize(scenic::Session* scenic_session) {
|
||||
!vk_->AreDeviceProcsSetup()) {
|
||||
// Make certain the device was created and it set up the device proc table
|
||||
// entries.
|
||||
FML_LOG(ERROR) << "Device proc addresses have not been set up.";
|
||||
FML_LOG(ERROR)
|
||||
<< "VulkanSurfaceProducer: Device proc addresses have not been set up.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!vk_->HasAcquiredMandatoryProcAddresses()) {
|
||||
FML_LOG(ERROR) << "Failed to acquire mandatory proc addresses.";
|
||||
FML_LOG(ERROR)
|
||||
<< "VulkanSurfaceProducer: Failed to acquire mandatory proc addresses.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!vk_->IsValid()) {
|
||||
FML_LOG(ERROR) << "VulkanProcTable invalid";
|
||||
FML_LOG(ERROR) << "VulkanSurfaceProducer: VulkanProcTable invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
auto getProc = vk_->CreateSkiaGetProc();
|
||||
|
||||
if (getProc == nullptr) {
|
||||
FML_LOG(ERROR) << "Failed to create skia getProc.";
|
||||
FML_LOG(ERROR) << "VulkanSurfaceProducer: Failed to create skia getProc.";
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t skia_features = 0;
|
||||
if (!logical_device_->GetPhysicalDeviceFeaturesSkia(&skia_features)) {
|
||||
FML_LOG(ERROR) << "Failed to get physical device features.";
|
||||
FML_LOG(ERROR)
|
||||
<< "VulkanSurfaceProducer: Failed to get physical device features.";
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -141,7 +141,8 @@ bool VulkanSurfaceProducer::Initialize(scenic::Session* scenic_session) {
|
||||
context_ = GrDirectContext::MakeVulkan(backend_context);
|
||||
|
||||
if (context_ == nullptr) {
|
||||
FML_LOG(ERROR) << "Failed to create GrDirectContext.";
|
||||
FML_LOG(ERROR)
|
||||
<< "VulkanSurfaceProducer: Failed to create GrDirectContext.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -260,14 +261,14 @@ bool VulkanSurfaceProducer::TransitionSurfacesToExternal(
|
||||
|
||||
std::unique_ptr<SurfaceProducerSurface> VulkanSurfaceProducer::ProduceSurface(
|
||||
const SkISize& size) {
|
||||
FML_DCHECK(valid_);
|
||||
FML_CHECK(valid_);
|
||||
last_produce_time_ = async::Now(async_get_default_dispatcher());
|
||||
return surface_pool_->AcquireSurface(size);
|
||||
}
|
||||
|
||||
void VulkanSurfaceProducer::SubmitSurface(
|
||||
std::unique_ptr<SurfaceProducerSurface> surface) {
|
||||
FML_DCHECK(valid_ && surface != nullptr);
|
||||
FML_CHECK(valid_);
|
||||
surface_pool_->SubmitSurface(std::move(surface));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user