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

Unified Diff: ui/compositor/test/in_process_context_factory.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really revert task runner changes Created 4 years, 8 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
« ui/compositor/compositor.cc ('K') | « ui/compositor/compositor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/test/in_process_context_factory.cc
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index 6d842554ae4d179ad5d8567fb45c6981ffe4f1ec..822ab72f02f2bac7ff63e1b95af9eeaacdfcc7da 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -46,13 +46,22 @@ class DirectOutputSurface : public cc::OutputSurface {
public:
DirectOutputSurface(
const scoped_refptr<cc::ContextProvider>& context_provider,
- const scoped_refptr<cc::ContextProvider>& worker_context_provider)
+ const scoped_refptr<cc::ContextProvider>& worker_context_provider,
+ scoped_ptr<cc::BeginFrameSource> begin_frame_source)
: cc::OutputSurface(context_provider, worker_context_provider),
+ begin_frame_source_(std::move(begin_frame_source)),
weak_ptr_factory_(this) {}
~DirectOutputSurface() override {}
// cc::OutputSurface implementation
+ 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 {
DCHECK(context_provider_.get());
DCHECK(frame->gl_frame_data);
@@ -77,6 +86,8 @@ class DirectOutputSurface : public cc::OutputSurface {
}
private:
+ scoped_ptr<cc::BeginFrameSource> begin_frame_source_;
+
base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DirectOutputSurface);
@@ -140,15 +151,19 @@ void InProcessContextFactory::CreateOutputSurface(
}
scoped_ptr<cc::OutputSurface> real_output_surface;
+ scoped_ptr<cc::SyntheticBeginFrameSource> begin_frame_source(
+ new cc::SyntheticBeginFrameSource(compositor->task_runner().get(),
+ cc::BeginFrameArgs::DefaultInterval()));
if (use_test_surface_) {
bool flipped_output_surface = false;
real_output_surface = make_scoped_ptr(new cc::PixelTestOutputSurface(
context_provider, shared_worker_context_provider_,
- flipped_output_surface));
+ flipped_output_surface, std::move(begin_frame_source)));
} else {
real_output_surface = make_scoped_ptr(new DirectOutputSurface(
- context_provider, shared_worker_context_provider_));
+ context_provider, shared_worker_context_provider_,
+ std::move(begin_frame_source)));
}
if (surface_manager_) {
@@ -156,7 +171,8 @@ void InProcessContextFactory::CreateOutputSurface(
new cc::OnscreenDisplayClient(
std::move(real_output_surface), surface_manager_,
GetSharedBitmapManager(), GetGpuMemoryBufferManager(),
- compositor->GetRendererSettings(), compositor->task_runner()));
+ compositor->GetRendererSettings(), compositor->task_runner(),
+ compositor->surface_id_allocator()->id_namespace()));
scoped_ptr<cc::SurfaceDisplayOutputSurface> surface_output_surface(
new cc::SurfaceDisplayOutputSurface(
surface_manager_, compositor->surface_id_allocator(),
« ui/compositor/compositor.cc ('K') | « ui/compositor/compositor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698