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

Side by Side Diff: ui/compositor/test/in_process_context_factory.cc

Issue 1317533003: Revert of cc: Move worker context BindToCurrentThread/SetupLock calls out of cc::OutputSurface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/compositor/test/in_process_context_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/compositor/test/in_process_context_factory.h" 5 #include "ui/compositor/test/in_process_context_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 attribs.fail_if_major_perf_caveat = false; 108 attribs.fail_if_major_perf_caveat = false;
109 attribs.bind_generates_resource = false; 109 attribs.bind_generates_resource = false;
110 110
111 scoped_refptr<InProcessContextProvider> context_provider = 111 scoped_refptr<InProcessContextProvider> context_provider =
112 InProcessContextProvider::Create(attribs, &gpu_memory_buffer_manager_, 112 InProcessContextProvider::Create(attribs, &gpu_memory_buffer_manager_,
113 &image_factory_, 113 &image_factory_,
114 compositor->widget(), "UICompositor"); 114 compositor->widget(), "UICompositor");
115 scoped_refptr<InProcessContextProvider> worker_context_provider = 115 scoped_refptr<InProcessContextProvider> worker_context_provider =
116 InProcessContextProvider::CreateOffscreen(&gpu_memory_buffer_manager_, 116 InProcessContextProvider::CreateOffscreen(&gpu_memory_buffer_manager_,
117 &image_factory_); 117 &image_factory_);
118 if (worker_context_provider &&
119 !worker_context_provider->BindToCurrentThread())
120 worker_context_provider = nullptr;
121 if (worker_context_provider) {
122 worker_context_provider->SetupLock();
123 // Detach from thread to allow context to be destroyed on a different
124 // thread without being used.
125 worker_context_provider->DetachFromThread();
126 }
127 118
128 scoped_ptr<cc::OutputSurface> real_output_surface; 119 scoped_ptr<cc::OutputSurface> real_output_surface;
129 120
130 if (use_test_surface_) { 121 if (use_test_surface_) {
131 bool flipped_output_surface = false; 122 bool flipped_output_surface = false;
132 real_output_surface = make_scoped_ptr(new cc::PixelTestOutputSurface( 123 real_output_surface = make_scoped_ptr(new cc::PixelTestOutputSurface(
133 context_provider, worker_context_provider, flipped_output_surface)); 124 context_provider, worker_context_provider, flipped_output_surface));
134 } else { 125 } else {
135 real_output_surface = make_scoped_ptr( 126 real_output_surface = make_scoped_ptr(
136 new DirectOutputSurface(context_provider, worker_context_provider)); 127 new DirectOutputSurface(context_provider, worker_context_provider));
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 212 }
222 213
223 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, 214 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor,
224 const gfx::Size& size) { 215 const gfx::Size& size) {
225 if (!per_compositor_data_.count(compositor)) 216 if (!per_compositor_data_.count(compositor))
226 return; 217 return;
227 per_compositor_data_[compositor]->display()->Resize(size); 218 per_compositor_data_[compositor]->display()->Resize(size);
228 } 219 }
229 220
230 } // namespace ui 221 } // namespace ui
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | ui/compositor/test/in_process_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698