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

Side by Side Diff: content/browser/compositor/reflector_impl.cc

Issue 277713002: ui/compositor: move the browser compositor thread to the ContextFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix includes Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 "content/browser/compositor/reflector_impl.h" 5 #include "content/browser/compositor/reflector_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "content/browser/compositor/browser_compositor_output_surface.h" 9 #include "content/browser/compositor/browser_compositor_output_surface.h"
10 #include "content/browser/compositor/owned_mailbox.h" 10 #include "content/browser/compositor/owned_mailbox.h"
11 #include "content/common/gpu/client/gl_helper.h" 11 #include "content/common/gpu/client/gl_helper.h"
12 #include "ui/compositor/layer.h" 12 #include "ui/compositor/layer.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 ReflectorImpl::ReflectorImpl( 16 ReflectorImpl::ReflectorImpl(
17 ui::Compositor* mirrored_compositor, 17 ui::Compositor* mirrored_compositor,
18 ui::Layer* mirroring_layer, 18 ui::Layer* mirroring_layer,
19 IDMap<BrowserCompositorOutputSurface>* output_surface_map, 19 IDMap<BrowserCompositorOutputSurface>* output_surface_map,
20 base::MessageLoopProxy* compositor_thread_loop,
20 int surface_id) 21 int surface_id)
21 : impl_unsafe_(output_surface_map), 22 : impl_unsafe_(output_surface_map),
22 main_unsafe_(mirrored_compositor, mirroring_layer), 23 main_unsafe_(mirrored_compositor, mirroring_layer),
23 impl_message_loop_(ui::Compositor::GetCompositorMessageLoop()), 24 impl_message_loop_(compositor_thread_loop),
24 main_message_loop_(base::MessageLoopProxy::current()), 25 main_message_loop_(base::MessageLoopProxy::current()),
25 surface_id_(surface_id) { 26 surface_id_(surface_id) {
26 GLHelper* helper = ImageTransportFactory::GetInstance()->GetGLHelper(); 27 GLHelper* helper = ImageTransportFactory::GetInstance()->GetGLHelper();
27 MainThreadData& main = GetMain(); 28 MainThreadData& main = GetMain();
28 main.mailbox = new OwnedMailbox(helper); 29 main.mailbox = new OwnedMailbox(helper);
29 impl_message_loop_->PostTask( 30 impl_message_loop_->PostTask(
30 FROM_HERE, 31 FROM_HERE,
31 base::Bind( 32 base::Bind(
32 &ReflectorImpl::InitOnImplThread, this, main.mailbox->holder())); 33 &ReflectorImpl::InitOnImplThread, this, main.mailbox->holder()));
33 } 34 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height()); 236 gfx::Rect new_rect(rect.x(), y, rect.width(), rect.height());
236 main.mirroring_layer->SchedulePaint(new_rect); 237 main.mirroring_layer->SchedulePaint(new_rect);
237 } 238 }
238 239
239 void ReflectorImpl::FullRedrawContentOnMainThread() { 240 void ReflectorImpl::FullRedrawContentOnMainThread() {
240 MainThreadData& main = GetMain(); 241 MainThreadData& main = GetMain();
241 main.mirrored_compositor->ScheduleFullRedraw(); 242 main.mirrored_compositor->ScheduleFullRedraw();
242 } 243 }
243 244
244 } // namespace content 245 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698