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

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 2005103004: AVDACodecImages keep their backing SurfaceTexture alive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@neverdetach
Patch Set: Created 4 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 DCHECK_GE(level, 0); 1480 DCHECK_GE(level, 0);
1481 size_t face_index = GLES2Util::GLTargetToFaceIndex(target); 1481 size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
1482 DCHECK_LT(static_cast<size_t>(face_index), 1482 DCHECK_LT(static_cast<size_t>(face_index),
1483 face_infos_.size()); 1483 face_infos_.size());
1484 DCHECK_LT(static_cast<size_t>(level), 1484 DCHECK_LT(static_cast<size_t>(level),
1485 face_infos_[face_index].level_infos.size()); 1485 face_infos_[face_index].level_infos.size());
1486 Texture::LevelInfo& info = 1486 Texture::LevelInfo& info =
1487 face_infos_[face_index].level_infos[level]; 1487 face_infos_[face_index].level_infos[level];
1488 DCHECK_EQ(info.target, target); 1488 DCHECK_EQ(info.target, target);
1489 DCHECK_EQ(info.level, level); 1489 DCHECK_EQ(info.level, level);
1490 bool image_previously_bound = !!info.image;
1490 info.image = image; 1491 info.image = image;
1491 info.stream_texture_image = stream_texture_image; 1492 info.stream_texture_image = stream_texture_image;
1492 info.image_state = state; 1493 info.image_state = state;
1493 1494
1495
1496 // Clear the unowned service id because the previous image might own it, in
1497 // which case it's no longer valid.
1498 if (image_previously_bound && level == 0)
liberato (no reviews please) 2016/05/26 16:59:19 i don't think that one needs to check if an image
1499 SetUnownedServiceId(0);
1500
1494 UpdateCanRenderCondition(); 1501 UpdateCanRenderCondition();
1495 UpdateHasImages(); 1502 UpdateHasImages();
1496 UpdateEmulatingRGB(); 1503 UpdateEmulatingRGB();
1497 } 1504 }
1498 1505
1499 void Texture::SetLevelImage(GLenum target, 1506 void Texture::SetLevelImage(GLenum target,
1500 GLint level, 1507 GLint level,
1501 gl::GLImage* image, 1508 gl::GLImage* image,
1502 ImageState state) { 1509 ImageState state) {
1503 SetLevelImageInternal(target, level, image, nullptr, state); 1510 SetLevelImageInternal(target, level, image, nullptr, state);
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
3309 uint32_t TextureManager::GetServiceIdGeneration() const { 3316 uint32_t TextureManager::GetServiceIdGeneration() const {
3310 return current_service_id_generation_; 3317 return current_service_id_generation_;
3311 } 3318 }
3312 3319
3313 void TextureManager::IncrementServiceIdGeneration() { 3320 void TextureManager::IncrementServiceIdGeneration() {
3314 current_service_id_generation_++; 3321 current_service_id_generation_++;
3315 } 3322 }
3316 3323
3317 } // namespace gles2 3324 } // namespace gles2
3318 } // namespace gpu 3325 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | media/gpu/android_copying_backing_strategy.cc » ('j') | media/gpu/android_video_decode_accelerator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698