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

Side by Side Diff: components/view_manager/gles2/command_buffer_impl.cc

Issue 1181013010: Support impl-side painting in Mandoline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit warning Created 5 years, 6 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 "components/view_manager/gles2/command_buffer_impl.h" 5 #include "components/view_manager/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 "components/view_manager/gles2/command_buffer_driver.h" 9 #include "components/view_manager/gles2/command_buffer_driver.h"
10 #include "components/view_manager/gles2/command_buffer_impl_observer.h" 10 #include "components/view_manager/gles2/command_buffer_impl_observer.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 driver_task_runner_->PostTask( 130 driver_task_runner_->PostTask(
131 FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint, 131 FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint,
132 sync_point_manager_, sync_point)); 132 sync_point_manager_, sync_point));
133 } 133 }
134 134
135 void CommandBufferImpl::Echo(const mojo::Callback<void()>& callback) { 135 void CommandBufferImpl::Echo(const mojo::Callback<void()>& callback) {
136 driver_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind(&base::DoNothing), 136 driver_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind(&base::DoNothing),
137 base::Bind(&RunCallback, callback)); 137 base::Bind(&RunCallback, callback));
138 } 138 }
139 139
140 void CommandBufferImpl::CreateImage(int32_t id,
141 mojo::ScopedHandle memory_handle,
142 int32 type,
143 mojo::SizePtr size,
144 int32_t format,
145 int32_t internal_format) {
146 driver_task_runner_->PostTask(
147 FROM_HERE, base::Bind(&CommandBufferDriver::CreateImage,
148 base::Unretained(driver_.get()), id,
149 base::Passed(&memory_handle), type,
150 base::Passed(&size), format, internal_format));
151 }
152
153 void CommandBufferImpl::DestroyImage(int32_t id) {
154 driver_task_runner_->PostTask(
155 FROM_HERE, base::Bind(&CommandBufferDriver::DestroyImage,
156 base::Unretained(driver_.get()), id));
157 }
158
140 CommandBufferImpl::~CommandBufferImpl() { 159 CommandBufferImpl::~CommandBufferImpl() {
141 if (observer_) 160 if (observer_)
142 observer_->OnCommandBufferImplDestroyed(); 161 observer_->OnCommandBufferImplDestroyed();
143 driver_task_runner_->PostTask( 162 driver_task_runner_->PostTask(
144 FROM_HERE, base::Bind(&DestroyDriver, base::Passed(&driver_))); 163 FROM_HERE, base::Bind(&DestroyDriver, base::Passed(&driver_)));
145 } 164 }
146 165
147 void CommandBufferImpl::BindToRequest( 166 void CommandBufferImpl::BindToRequest(
148 mojo::InterfaceRequest<mojo::CommandBuffer> request) { 167 mojo::InterfaceRequest<mojo::CommandBuffer> request) {
149 binding_.Bind(request.Pass()); 168 binding_.Bind(request.Pass());
(...skipping 13 matching lines...) Expand all
163 182
164 void CommandBufferImpl::UpdateVSyncParameters(base::TimeTicks timebase, 183 void CommandBufferImpl::UpdateVSyncParameters(base::TimeTicks timebase,
165 base::TimeDelta interval) { 184 base::TimeDelta interval) {
166 if (!viewport_parameter_listener_) 185 if (!viewport_parameter_listener_)
167 return; 186 return;
168 viewport_parameter_listener_->OnVSyncParametersUpdated( 187 viewport_parameter_listener_->OnVSyncParametersUpdated(
169 timebase.ToInternalValue(), interval.ToInternalValue()); 188 timebase.ToInternalValue(), interval.ToInternalValue());
170 } 189 }
171 190
172 } // namespace gles2 191 } // namespace gles2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698