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

Unified Diff: cc/test/fake_output_surface.cc

Issue 1985973002: Defer compositor context creation to the thread. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contextfactory: . 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
Index: cc/test/fake_output_surface.cc
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index f1b59b4ee9a75d28b27833236c98cbff703a55ac..5c57e3ac9571910c2b3f0b473def18a55bf02100 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -15,10 +15,11 @@
namespace cc {
FakeOutputSurface::FakeOutputSurface(
- scoped_refptr<ContextProvider> context_provider,
+ std::unique_ptr<ContextProvider::Factory> compositor_context_factory,
scoped_refptr<ContextProvider> worker_context_provider,
bool delegated_rendering)
- : OutputSurface(context_provider, worker_context_provider),
+ : OutputSurface(std::move(compositor_context_factory),
+ std::move(worker_context_provider)),
client_(NULL),
num_sent_frames_(0),
has_external_stencil_test_(false),
@@ -29,9 +30,9 @@ FakeOutputSurface::FakeOutputSurface(
}
FakeOutputSurface::FakeOutputSurface(
- scoped_refptr<ContextProvider> context_provider,
+ std::unique_ptr<ContextProvider::Factory> compositor_context_factory,
bool delegated_rendering)
- : OutputSurface(context_provider),
+ : OutputSurface(std::move(compositor_context_factory)),
client_(NULL),
num_sent_frames_(0),
has_external_stencil_test_(false),
@@ -55,10 +56,11 @@ FakeOutputSurface::FakeOutputSurface(
}
FakeOutputSurface::FakeOutputSurface(
- scoped_refptr<ContextProvider> context_provider,
+ std::unique_ptr<ContextProvider::Factory> compositor_context_factory,
std::unique_ptr<SoftwareOutputDevice> software_device,
bool delegated_rendering)
- : OutputSurface(context_provider, std::move(software_device)),
+ : OutputSurface(std::move(compositor_context_factory),
+ std::move(software_device)),
client_(NULL),
num_sent_frames_(0),
has_external_stencil_test_(false),
@@ -92,11 +94,12 @@ void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) {
}
void FakeOutputSurface::BindFramebuffer() {
- if (framebuffer_)
- context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER,
- framebuffer_);
- else
+ if (framebuffer_) {
+ compositor_context_provider_->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER,
+ framebuffer_);
+ } else {
OutputSurface::BindFramebuffer();
+ }
}
bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) {

Powered by Google App Engine
This is Rietveld 408576698