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

Side by Side Diff: media/gpu/avda_picture_buffer_manager.cc

Issue 2351293003: Relocate SurfaceTexture usage from AVDA GLImage into shared state. (Closed)
Patch Set: Unflip default matrix. Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "media/gpu/avda_picture_buffer_manager.h" 5 #include "media/gpu/avda_picture_buffer_manager.h"
6 6
7 #include <EGL/egl.h> 7 #include <EGL/egl.h>
8 #include <EGL/eglext.h> 8 #include <EGL/eglext.h>
9 9
10 #include "base/android/build_info.h" 10 #include "base/android/build_info.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 MaybeRenderEarly(); 284 MaybeRenderEarly();
285 } 285 }
286 286
287 void AVDAPictureBufferManager::AssignOnePictureBuffer( 287 void AVDAPictureBufferManager::AssignOnePictureBuffer(
288 const PictureBuffer& picture_buffer, 288 const PictureBuffer& picture_buffer,
289 bool have_context) { 289 bool have_context) {
290 // Attach a GLImage to each texture that will use the surface texture. 290 // Attach a GLImage to each texture that will use the surface texture.
291 // We use a refptr here in case SetImageForPicture fails. 291 // We use a refptr here in case SetImageForPicture fails.
292 scoped_refptr<gpu::gles2::GLStreamTextureImage> gl_image = 292 scoped_refptr<gpu::gles2::GLStreamTextureImage> gl_image =
293 new AVDACodecImage(picture_buffer.id(), shared_state_, media_codec_, 293 new AVDACodecImage(picture_buffer.id(), shared_state_, media_codec_,
294 state_provider_->GetGlDecoder(), surface_texture_); 294 state_provider_->GetGlDecoder());
295 SetImageForPicture(picture_buffer, gl_image); 295 SetImageForPicture(picture_buffer, gl_image);
296 296
297 if (!surface_texture_ && have_context) { 297 if (!surface_texture_ && have_context) {
298 // To make devtools work, we're using a 2D texture. Make it transparent, 298 // To make devtools work, we're using a 2D texture. Make it transparent,
299 // so that it draws a hole for the SV to show through. This is only 299 // so that it draws a hole for the SV to show through. This is only
300 // because devtools draws and reads back, which skips overlay processing. 300 // because devtools draws and reads back, which skips overlay processing.
301 // It's unclear why devtools renders twice -- once normally, and once 301 // It's unclear why devtools renders twice -- once normally, and once
302 // including a readback layer. The result is that the device screen 302 // including a readback layer. The result is that the device screen
303 // flashes as we alternately draw the overlay hole and this texture, 303 // flashes as we alternately draw the overlay hole and this texture,
304 // unless we make the texture transparent. 304 // unless we make the texture transparent.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 shared_state_->CodecChanged(codec); 400 shared_state_->CodecChanged(codec);
401 } 401 }
402 402
403 bool AVDAPictureBufferManager::ArePicturesOverlayable() { 403 bool AVDAPictureBufferManager::ArePicturesOverlayable() {
404 // SurfaceView frames are always overlayable because that's the only way to 404 // SurfaceView frames are always overlayable because that's the only way to
405 // display them. 405 // display them.
406 return !surface_texture_; 406 return !surface_texture_;
407 } 407 }
408 408
409 } // namespace media 409 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698