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

Side by Side Diff: services/gles2/command_buffer_impl.cc

Issue 1123623003: Automatically redraw the display on resume. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Response to review Created 5 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
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 "services/gles2/command_buffer_impl.h" 5 #include "services/gles2/command_buffer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "gpu/command_buffer/service/sync_point_manager.h" 9 #include "gpu/command_buffer/service/sync_point_manager.h"
10 #include "services/gles2/command_buffer_driver.h" 10 #include "services/gles2/command_buffer_driver.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 mojo::InterfaceRequest<mojo::CommandBuffer> request, 50 mojo::InterfaceRequest<mojo::CommandBuffer> request,
51 mojo::ViewportParameterListenerPtr listener, 51 mojo::ViewportParameterListenerPtr listener,
52 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner, 52 scoped_refptr<base::SingleThreadTaskRunner> control_task_runner,
53 gpu::SyncPointManager* sync_point_manager, 53 gpu::SyncPointManager* sync_point_manager,
54 scoped_ptr<CommandBufferDriver> driver) 54 scoped_ptr<CommandBufferDriver> driver)
55 : sync_point_manager_(sync_point_manager), 55 : sync_point_manager_(sync_point_manager),
56 driver_task_runner_(base::MessageLoop::current()->task_runner()), 56 driver_task_runner_(base::MessageLoop::current()->task_runner()),
57 driver_(driver.Pass()), 57 driver_(driver.Pass()),
58 viewport_parameter_listener_(listener.Pass()), 58 viewport_parameter_listener_(listener.Pass()),
59 binding_(this), 59 binding_(this),
60 observer_(nullptr),
60 weak_factory_(this) { 61 weak_factory_(this) {
61 driver_->set_client(make_scoped_ptr(new CommandBufferDriverClientImpl( 62 driver_->set_client(make_scoped_ptr(new CommandBufferDriverClientImpl(
62 weak_factory_.GetWeakPtr(), control_task_runner))); 63 weak_factory_.GetWeakPtr(), control_task_runner)));
63 64
64 control_task_runner->PostTask( 65 control_task_runner->PostTask(
65 FROM_HERE, base::Bind(&CommandBufferImpl::BindToRequest, 66 FROM_HERE, base::Bind(&CommandBufferImpl::BindToRequest,
66 base::Unretained(this), base::Passed(&request))); 67 base::Unretained(this), base::Passed(&request)));
67 } 68 }
68 69
69 CommandBufferImpl::~CommandBufferImpl() { 70 CommandBufferImpl::~CommandBufferImpl() {
71 if (observer_) {
72 observer_->OnCommandBufferImplDestroyed();
73 }
70 driver_task_runner_->PostTask( 74 driver_task_runner_->PostTask(
71 FROM_HERE, base::Bind(&DestroyDriver, base::Passed(&driver_))); 75 FROM_HERE, base::Bind(&DestroyDriver, base::Passed(&driver_)));
72 } 76 }
73 77
74 void CommandBufferImpl::Initialize( 78 void CommandBufferImpl::Initialize(
75 mojo::CommandBufferSyncClientPtr sync_client, 79 mojo::CommandBufferSyncClientPtr sync_client,
76 mojo::CommandBufferSyncPointClientPtr sync_point_client, 80 mojo::CommandBufferSyncPointClientPtr sync_point_client,
77 mojo::CommandBufferLostContextObserverPtr loss_observer, 81 mojo::CommandBufferLostContextObserverPtr loss_observer,
78 mojo::ScopedSharedBufferHandle shared_state) { 82 mojo::ScopedSharedBufferHandle shared_state) {
79 sync_point_client_ = sync_point_client.Pass(); 83 sync_point_client_ = sync_point_client.Pass();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 155
152 void CommandBufferImpl::UpdateVSyncParameters(base::TimeTicks timebase, 156 void CommandBufferImpl::UpdateVSyncParameters(base::TimeTicks timebase,
153 base::TimeDelta interval) { 157 base::TimeDelta interval) {
154 if (!viewport_parameter_listener_) 158 if (!viewport_parameter_listener_)
155 return; 159 return;
156 viewport_parameter_listener_->OnVSyncParametersUpdated( 160 viewport_parameter_listener_->OnVSyncParametersUpdated(
157 timebase.ToInternalValue(), interval.ToInternalValue()); 161 timebase.ToInternalValue(), interval.ToInternalValue());
158 } 162 }
159 163
160 } // namespace gles2 164 } // namespace gles2
OLDNEW
« no previous file with comments | « services/gles2/command_buffer_impl.h ('k') | services/native_viewport/onscreen_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698