Back Vulkan Rasterizer with Mozart View (flutter/engine#3568)

This version does not recycle buffers. It is meant only as an initial solution,
and the proper buffer recycling logic has been broken out into a separate change
This commit is contained in:
freiling
2017-04-07 17:22:53 -07:00
committed by Chinmay Garde
parent a01fe0728c
commit 22838a8ebe
3 changed files with 18 additions and 7 deletions

View File

@@ -23,8 +23,8 @@ void SceneUpdateContext::CurrentPaintTask::Clear() {
}
SceneUpdateContext::SceneUpdateContext(mozart::SceneUpdate* update,
mozart::BufferProducer* buffer_producer)
: update_(update), buffer_producer_(buffer_producer) {}
SurfaceProducer* surface_producer)
: update_(update), surface_producer_(surface_producer) {}
SceneUpdateContext::~SceneUpdateContext() = default;
@@ -60,7 +60,7 @@ mozart::NodePtr SceneUpdateContext::FinalizeCurrentPaintTask(
mozart::ImagePtr image;
PaintTask task;
task.surface = mozart::MakeSkSurface(physical_size, buffer_producer_, &image);
task.surface = surface_producer_->ProduceSurface(physical_size, &image);
task.left = bounds.left();
task.top = bounds.top();
task.scaleX = scaleX;

View File

@@ -35,8 +35,15 @@ class SceneUpdateContext;
class SceneUpdateContext {
public:
class SurfaceProducer {
public:
virtual ~SurfaceProducer() {}
virtual sk_sp<SkSurface> ProduceSurface(SkISize size,
mozart::ImagePtr* out_image) = 0;
};
SceneUpdateContext(mozart::SceneUpdate* update,
mozart::BufferProducer* buffer_producer);
SurfaceProducer* surface_producer);
~SceneUpdateContext();
mozart::SceneUpdate* update() const { return update_; }
@@ -71,7 +78,7 @@ class SceneUpdateContext {
};
mozart::SceneUpdate* update_;
mozart::BufferProducer* buffer_producer_;
SurfaceProducer* surface_producer_;
CurrentPaintTask current_paint_task_;
std::vector<PaintTask> paint_tasks_;

View File

@@ -90,8 +90,12 @@ bool VulkanProcTable::SetupInstanceProcAddresses(
#endif // OS_ANDROID
#if OS_FUCHSIA
ACQUIRE_PROC(CreateMagmaSurfaceKHR, handle);
ACQUIRE_PROC(GetPhysicalDeviceMagmaPresentationSupportKHR, handle);
[this, &handle]() -> bool {
ACQUIRE_PROC(CreateMagmaSurfaceKHR, handle);
ACQUIRE_PROC(GetPhysicalDeviceMagmaPresentationSupportKHR, handle);
return true;
}();
#endif // OS_FUCHSIA
// The debug report functions are optional. We don't want proc acquisition to