Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 1971003003: Setup BFS for Vulkan Output Surface on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 0b7968802969fd5486832b46cf041edb11420e3c..935b46d62fecf92bf17444ecedbb3489e59f376c 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -235,11 +235,13 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface,
class VulkanOutputSurface : public cc::OutputSurface {
public:
VulkanOutputSurface(
- scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider)
+ scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider,
+ std::unique_ptr<ExternalBeginFrameSource> begin_frame_source)
: OutputSurface(nullptr,
nullptr,
std::move(vulkan_context_provider),
- nullptr) {}
+ nullptr),
+ begin_frame_source_(std::move(begin_frame_source)) {}
~VulkanOutputSurface() override { Destroy(); }
@@ -256,6 +258,13 @@ class VulkanOutputSurface : public cc::OutputSurface {
return true;
}
+ bool BindToClient(cc::OutputSurfaceClient* client) override {
+ if (!OutputSurface::BindToClient(client))
+ return false;
+ client->SetBeginFrameSource(begin_frame_source_.get());
+ return true;
+ }
+
void SwapBuffers(cc::CompositorFrame* frame) override {
surface_->SwapBuffers();
PostSwapBuffersComplete();
@@ -277,6 +286,7 @@ class VulkanOutputSurface : public cc::OutputSurface {
private:
std::unique_ptr<gpu::VulkanSurface> surface_;
+ std::unique_ptr<ExternalBeginFrameSource> begin_frame_source_;
DISALLOW_COPY_AND_ASSIGN(VulkanOutputSurface);
};
@@ -592,8 +602,9 @@ void CompositorImpl::CreateOutputSurface() {
#if defined(ENABLE_VULKAN)
std::unique_ptr<VulkanOutputSurface> vulkan_surface;
if (vulkan_context_provider) {
- vulkan_surface.reset(
- new VulkanOutputSurface(std::move(vulkan_context_provider)));
+ vulkan_surface.reset(new VulkanOutputSurface(
+ std::move(vulkan_context_provider),
+ base::WrapUnique(new ExternalBeginFrameSource(this))));
if (!vulkan_surface->Initialize(window_)) {
vulkan_surface->Destroy();
vulkan_surface.reset();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698