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

Side by Side Diff: content/renderer/pepper/video_decoder_shim.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 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/renderer/pepper/video_decoder_shim.h" 5 #include "content/renderer/pepper/video_decoder_shim.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 #include <utility> 10 #include <utility>
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 DCHECK(yuv_matrix_loc_ != -1); 309 DCHECK(yuv_matrix_loc_ != -1);
310 310
311 yuv_adjust_loc_ = gl_->GetUniformLocation(program, "yuv_adjust"); 311 yuv_adjust_loc_ = gl_->GetUniformLocation(program, "yuv_adjust");
312 DCHECK(yuv_adjust_loc_ != -1); 312 DCHECK(yuv_adjust_loc_ != -1);
313 313
314 return program; 314 return program;
315 } 315 }
316 316
317 bool VideoDecoderShim::YUVConverter::Initialize() { 317 bool VideoDecoderShim::YUVConverter::Initialize() {
318 // If texture_rg extension is not available, use slower GL_LUMINANCE. 318 // If texture_rg extension is not available, use slower GL_LUMINANCE.
319 if (context_provider_->ContextCapabilities().gpu.texture_rg) { 319 if (context_provider_->ContextCapabilities().texture_rg) {
320 internal_format_ = GL_RED_EXT; 320 internal_format_ = GL_RED_EXT;
321 format_ = GL_RED_EXT; 321 format_ = GL_RED_EXT;
322 } else { 322 } else {
323 internal_format_ = GL_LUMINANCE; 323 internal_format_ = GL_LUMINANCE;
324 format_ = GL_LUMINANCE; 324 format_ = GL_LUMINANCE;
325 } 325 }
326 326
327 if (context_provider_->ContextCapabilities().gpu.max_texture_image_units < 327 if (context_provider_->ContextCapabilities().max_texture_image_units < 4) {
328 4) {
329 // We support YUVA textures and require 4 texture units in the fragment 328 // We support YUVA textures and require 4 texture units in the fragment
330 // stage. 329 // stage.
331 return false; 330 return false;
332 } 331 }
333 332
334 gl_->TraceBeginCHROMIUM("YUVConverter", "YUVConverterContext"); 333 gl_->TraceBeginCHROMIUM("YUVConverter", "YUVConverterContext");
335 gl_->GenFramebuffers(1, &frame_buffer_); 334 gl_->GenFramebuffers(1, &frame_buffer_);
336 335
337 y_texture_ = CreateTexture(); 336 y_texture_ = CreateTexture();
338 u_texture_ = CreateTexture(); 337 u_texture_ = CreateTexture();
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { 1117 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) {
1119 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); 1118 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
1120 gles2->DeleteTextures(1, &texture_id); 1119 gles2->DeleteTextures(1, &texture_id);
1121 } 1120 }
1122 1121
1123 void VideoDecoderShim::FlushCommandBuffer() { 1122 void VideoDecoderShim::FlushCommandBuffer() {
1124 context_provider_->ContextGL()->Flush(); 1123 context_provider_->ContextGL()->Flush();
1125 } 1124 }
1126 1125
1127 } // namespace content 1126 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/renderer_gpu_video_accelerator_factories.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698