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

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

Issue 2481943003: Enforce no uncleared OES external textures. Clear in AVDA, not GVD. (Closed)
Patch Set: Fix mismerge. Created 4 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 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 auto image_state = gpu::gles2::Texture::UNBOUND; 168 auto image_state = gpu::gles2::Texture::UNBOUND;
169 // For SurfaceView we set the state to BOUND because ScheduleOverlayPlane 169 // For SurfaceView we set the state to BOUND because ScheduleOverlayPlane
170 // requires it. If something tries to sample from this texture it won't work, 170 // requires it. If something tries to sample from this texture it won't work,
171 // but there's no way to sample from a SurfaceView anyway, so it doesn't 171 // but there's no way to sample from a SurfaceView anyway, so it doesn't
172 // matter. 172 // matter.
173 if (image && !surface_texture_) 173 if (image && !surface_texture_)
174 image_state = gpu::gles2::Texture::BOUND; 174 image_state = gpu::gles2::Texture::BOUND;
175 texture_manager->SetLevelStreamTextureImage(texture_ref, GetTextureTarget(), 175 texture_manager->SetLevelStreamTextureImage(texture_ref, GetTextureTarget(),
176 0, image, image_state, 176 0, image, image_state,
177 stream_texture_service_id); 177 stream_texture_service_id);
178 texture_manager->SetLevelCleared(texture_ref, GetTextureTarget(), 0, true);
178 } 179 }
179 180
180 AVDACodecImage* AVDAPictureBufferManager::GetImageForPicture( 181 AVDACodecImage* AVDAPictureBufferManager::GetImageForPicture(
181 int picture_buffer_id) const { 182 int picture_buffer_id) const {
182 auto it = codec_images_.find(picture_buffer_id); 183 auto it = codec_images_.find(picture_buffer_id);
183 return it == codec_images_.end() ? nullptr : it->second.get(); 184 return it == codec_images_.end() ? nullptr : it->second.get();
184 } 185 }
185 186
186 void AVDAPictureBufferManager::UseCodecBufferForPictureBuffer( 187 void AVDAPictureBufferManager::UseCodecBufferForPictureBuffer(
187 int32_t codec_buf_index, 188 int32_t codec_buf_index,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 shared_state_->clear_release_time(); 320 shared_state_->clear_release_time();
320 } 321 }
321 322
322 bool AVDAPictureBufferManager::ArePicturesOverlayable() { 323 bool AVDAPictureBufferManager::ArePicturesOverlayable() {
323 // SurfaceView frames are always overlayable because that's the only way to 324 // SurfaceView frames are always overlayable because that's the only way to
324 // display them. 325 // display them.
325 return !surface_texture_; 326 return !surface_texture_;
326 } 327 }
327 328
328 } // namespace media 329 } // namespace media
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | media/gpu/ipc/service/gpu_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698