提交 1049105d 编写于 作者: A Adam Barth 提交者: GitHub

Support RGB_x888 on Fuchsia (#3054)

The new boot sequence on Fuchsia now gives us the more accurate RGB_x888 pixel
format, which we should support. Also finish pushing pixels to the screen
before drawing new pixels.
上级 19ff4df8
......@@ -65,6 +65,7 @@ void FramebufferSkia::Bind(mojo::InterfaceHandle<mojo::Framebuffer> framebuffer,
sk_alpha_type = kOpaque_SkAlphaType;
break;
case mojo::FramebufferFormat::ARGB_8888:
case mojo::FramebufferFormat::RGB_x888:
sk_color_type = kRGBA_8888_SkColorType;
sk_alpha_type = kPremul_SkAlphaType;
break;
......@@ -89,7 +90,8 @@ void FramebufferSkia::Bind(mojo::InterfaceHandle<mojo::Framebuffer> framebuffer,
}
void FramebufferSkia::ConvertToCorrectPixelFormatIfNeeded() {
if (info_->format == mojo::FramebufferFormat::ARGB_8888) {
if (info_->format == mojo::FramebufferFormat::ARGB_8888 ||
info_->format == mojo::FramebufferFormat::RGB_x888) {
// we need to convert from RGBA to ARGB
SkPixmap bufferPixmap;
......@@ -103,4 +105,9 @@ void FramebufferSkia::ConvertToCorrectPixelFormatIfNeeded() {
}
}
void FramebufferSkia::Finish() {
framebuffer_->Flush([] {});
framebuffer_.WaitForIncomingResponse();
}
} // namespace flutter_content_handler
......@@ -23,7 +23,7 @@ class FramebufferSkia {
// Needed because Skia does not support drawing to ARGB directly.
void ConvertToCorrectPixelFormatIfNeeded();
mojo::Framebuffer* get() const { return framebuffer_.get(); }
void Finish();
const sk_sp<SkSurface>& surface() { return surface_; }
private:
......
......@@ -36,8 +36,8 @@ void Rasterizer::Draw(std::unique_ptr<flow::LayerTree> layer_tree,
canvas->flush();
framebuffer_.ConvertToCorrectPixelFormatIfNeeded();
framebuffer_.get()->Flush(ftl::MakeRunnable(std::move(callback)));
framebuffer_.Finish();
callback();
}
} // namespace flutter_content_handler
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册