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

Side by Side Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock gpu video accelerator factory Created 5 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/media/renderer_gpu_video_accelerator_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 DCHECK(task_runner_->BelongsToCurrentThread()); 157 DCHECK(task_runner_->BelongsToCurrentThread());
158 if (CheckContextLost()) 158 if (CheckContextLost())
159 return; 159 return;
160 160
161 cc::ContextProvider::ScopedContextLock lock(context_provider_); 161 cc::ContextProvider::ScopedContextLock lock(context_provider_);
162 gpu::gles2::GLES2Interface* gles2 = lock.ContextGL(); 162 gpu::gles2::GLES2Interface* gles2 = lock.ContextGL();
163 gles2->DeleteTextures(1, &texture_id); 163 gles2->DeleteTextures(1, &texture_id);
164 DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR)); 164 DCHECK_EQ(gles2->GetError(), static_cast<GLenum>(GL_NO_ERROR));
165 } 165 }
166 166
167 void RendererGpuVideoAcceleratorFactories::WaitSyncPoint(uint32 sync_point) { 167 void RendererGpuVideoAcceleratorFactories::WaitSyncPoint(
168 uint32 sync_point,
169 const gpu::SyncToken& sync_token) {
168 DCHECK(task_runner_->BelongsToCurrentThread()); 170 DCHECK(task_runner_->BelongsToCurrentThread());
169 if (CheckContextLost()) 171 if (CheckContextLost())
170 return; 172 return;
171 173
172 cc::ContextProvider::ScopedContextLock lock(context_provider_); 174 cc::ContextProvider::ScopedContextLock lock(context_provider_);
173 gpu::gles2::GLES2Interface* gles2 = lock.ContextGL(); 175 gpu::gles2::GLES2Interface* gles2 = lock.ContextGL();
174 gles2->WaitSyncPointCHROMIUM(sync_point); 176 gles2->WaitSyncPointCHROMIUM(sync_point, sync_token.GetConstData());
175 177
176 // Callers expect the WaitSyncPoint to affect the next IPCs. Make sure to 178 // Callers expect the WaitSyncPoint to affect the next IPCs. Make sure to
177 // flush the command buffers to ensure that. 179 // flush the command buffers to ensure that.
178 gles2->ShallowFlushCHROMIUM(); 180 gles2->ShallowFlushCHROMIUM();
179 } 181 }
180 182
181 scoped_ptr<gfx::GpuMemoryBuffer> 183 scoped_ptr<gfx::GpuMemoryBuffer>
182 RendererGpuVideoAcceleratorFactories::AllocateGpuMemoryBuffer( 184 RendererGpuVideoAcceleratorFactories::AllocateGpuMemoryBuffer(
183 const gfx::Size& size, 185 const gfx::Size& size,
184 gfx::BufferFormat format, 186 gfx::BufferFormat format,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 gpu_channel_host_->gpu_info() 261 gpu_channel_host_->gpu_info()
260 .video_encode_accelerator_supported_profiles); 262 .video_encode_accelerator_supported_profiles);
261 } 263 }
262 264
263 void RendererGpuVideoAcceleratorFactories::ReleaseContextProvider() { 265 void RendererGpuVideoAcceleratorFactories::ReleaseContextProvider() {
264 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 266 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
265 context_provider_refptr_ = nullptr; 267 context_provider_refptr_ = nullptr;
266 } 268 }
267 269
268 } // namespace content 270 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698