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

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

Issue 1900993002: Move SharedMemoryLimits out of WebGraphicsContext3DCommandBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@limits
Patch Set: move-limits: types Created 4 years, 8 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 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return image_texture_targets_[static_cast<int>(format)]; 235 return image_texture_targets_[static_cast<int>(format)];
236 } 236 }
237 237
238 media::VideoPixelFormat 238 media::VideoPixelFormat
239 RendererGpuVideoAcceleratorFactories::VideoFrameOutputFormat() { 239 RendererGpuVideoAcceleratorFactories::VideoFrameOutputFormat() {
240 DCHECK(task_runner_->BelongsToCurrentThread()); 240 DCHECK(task_runner_->BelongsToCurrentThread());
241 if (CheckContextLost()) 241 if (CheckContextLost())
242 return media::PIXEL_FORMAT_UNKNOWN; 242 return media::PIXEL_FORMAT_UNKNOWN;
243 cc::ContextProvider::ScopedContextLock lock(context_provider_); 243 cc::ContextProvider::ScopedContextLock lock(context_provider_);
244 auto capabilities = context_provider_->ContextCapabilities(); 244 auto capabilities = context_provider_->ContextCapabilities();
245 if (capabilities.gpu.image_ycbcr_420v) 245 if (capabilities.image_ycbcr_420v)
246 return media::PIXEL_FORMAT_NV12; 246 return media::PIXEL_FORMAT_NV12;
247 if (capabilities.gpu.image_ycbcr_422) 247 if (capabilities.image_ycbcr_422)
248 return media::PIXEL_FORMAT_UYVY; 248 return media::PIXEL_FORMAT_UYVY;
249 if (capabilities.gpu.texture_rg) 249 if (capabilities.texture_rg)
250 return media::PIXEL_FORMAT_I420; 250 return media::PIXEL_FORMAT_I420;
251 return media::PIXEL_FORMAT_UNKNOWN; 251 return media::PIXEL_FORMAT_UNKNOWN;
252 } 252 }
253 253
254 namespace { 254 namespace {
255 class ScopedGLContextLockImpl 255 class ScopedGLContextLockImpl
256 : public media::GpuVideoAcceleratorFactories::ScopedGLContextLock { 256 : public media::GpuVideoAcceleratorFactories::ScopedGLContextLock {
257 public: 257 public:
258 ScopedGLContextLockImpl(cc::ContextProvider* context_provider) 258 ScopedGLContextLockImpl(cc::ContextProvider* context_provider)
259 : lock_(context_provider) {} 259 : lock_(context_provider) {}
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 context_provider_refptr_ = nullptr; 306 context_provider_refptr_ = nullptr;
307 } 307 }
308 308
309 scoped_refptr<ContextProviderCommandBuffer> 309 scoped_refptr<ContextProviderCommandBuffer>
310 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() { 310 RendererGpuVideoAcceleratorFactories::ContextProviderMainThread() {
311 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 311 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
312 return context_provider_refptr_; 312 return context_provider_refptr_;
313 } 313 }
314 314
315 } // namespace content 315 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc ('k') | content/renderer/pepper/video_decoder_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698