| Index: ui/compositor/test/in_process_context_provider.cc
|
| diff --git a/ui/compositor/test/in_process_context_provider.cc b/ui/compositor/test/in_process_context_provider.cc
|
| index 0ec09c4c104bb982af786814e1e7a504a5981049..e6435e077eb3b8ae21d9fd555ea4f6f3529c5dfa 100644
|
| --- a/ui/compositor/test/in_process_context_provider.cc
|
| +++ b/ui/compositor/test/in_process_context_provider.cc
|
| @@ -23,19 +23,22 @@ namespace ui {
|
| // static
|
| scoped_refptr<InProcessContextProvider> InProcessContextProvider::Create(
|
| const gpu::gles2::ContextCreationAttribHelper& attribs,
|
| + InProcessContextProvider* shared_context,
|
| gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
|
| gpu::ImageFactory* image_factory,
|
| gfx::AcceleratedWidget window,
|
| const std::string& debug_name) {
|
| - return new InProcessContextProvider(
|
| - attribs, gpu_memory_buffer_manager, image_factory, window, debug_name);
|
| + return new InProcessContextProvider(attribs, shared_context,
|
| + gpu_memory_buffer_manager, image_factory,
|
| + window, debug_name);
|
| }
|
|
|
| // static
|
| scoped_refptr<InProcessContextProvider>
|
| InProcessContextProvider::CreateOffscreen(
|
| gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
|
| - gpu::ImageFactory* image_factory) {
|
| + gpu::ImageFactory* image_factory,
|
| + InProcessContextProvider* shared_context) {
|
| gpu::gles2::ContextCreationAttribHelper attribs;
|
| attribs.alpha_size = 8;
|
| attribs.blue_size = 8;
|
| @@ -47,18 +50,20 @@ InProcessContextProvider::CreateOffscreen(
|
| attribs.sample_buffers = 0;
|
| attribs.fail_if_major_perf_caveat = false;
|
| attribs.bind_generates_resource = false;
|
| - return new InProcessContextProvider(attribs, gpu_memory_buffer_manager,
|
| - image_factory,
|
| + return new InProcessContextProvider(attribs, shared_context,
|
| + gpu_memory_buffer_manager, image_factory,
|
| gfx::kNullAcceleratedWidget, "Offscreen");
|
| }
|
|
|
| InProcessContextProvider::InProcessContextProvider(
|
| const gpu::gles2::ContextCreationAttribHelper& attribs,
|
| + InProcessContextProvider* shared_context,
|
| gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
|
| gpu::ImageFactory* image_factory,
|
| gfx::AcceleratedWidget window,
|
| const std::string& debug_name)
|
| : attribs_(attribs),
|
| + shared_context_(shared_context),
|
| gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
|
| image_factory_(image_factory),
|
| window_(window),
|
| @@ -81,19 +86,16 @@ bool InProcessContextProvider::BindToCurrentThread() {
|
| if (!context_) {
|
| gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
|
| context_.reset(gpu::GLInProcessContext::Create(
|
| - nullptr, /* service */
|
| - nullptr, /* surface */
|
| - !window_, /* is_offscreen */
|
| - window_, gfx::Size(1, 1), nullptr, /* share_context */
|
| - true, /* share_resources */
|
| - attribs_, gpu_preference, gpu::GLInProcessContextSharedMemoryLimits(),
|
| + nullptr, /* service */
|
| + nullptr, /* surface */
|
| + !window_, /* is_offscreen */
|
| + window_, gfx::Size(1, 1),
|
| + (shared_context_ ? shared_context_->context_.get() : nullptr), attribs_,
|
| + gpu_preference, gpu::GLInProcessContextSharedMemoryLimits(),
|
| gpu_memory_buffer_manager_, image_factory_));
|
|
|
| if (!context_)
|
| return false;
|
| -
|
| - context_->SetContextLostCallback(base::Bind(
|
| - &InProcessContextProvider::OnLostContext, base::Unretained(this)));
|
| }
|
|
|
| capabilities_.gpu = context_->GetImplementation()->capabilities();
|
| @@ -168,15 +170,7 @@ void InProcessContextProvider::DeleteCachedResources() {
|
|
|
| void InProcessContextProvider::SetLostContextCallback(
|
| const LostContextCallback& lost_context_callback) {
|
| - lost_context_callback_ = lost_context_callback;
|
| -}
|
| -
|
| -void InProcessContextProvider::OnLostContext() {
|
| - DCHECK(context_thread_checker_.CalledOnValidThread());
|
| - if (!lost_context_callback_.is_null())
|
| - base::ResetAndReturn(&lost_context_callback_).Run();
|
| - if (gr_context_)
|
| - gr_context_->abandonContext();
|
| + // Pixel tests do not test lost context.
|
| }
|
|
|
| } // namespace ui
|
|
|