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

Unified Diff: gpu/command_buffer/service/texture_manager.cc

Issue 7518016: Revert 94743 - Allow the renderer process to map textures from one context into another. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/texture_manager.cc
===================================================================
--- gpu/command_buffer/service/texture_manager.cc (revision 94807)
+++ gpu/command_buffer/service/texture_manager.cc (working copy)
@@ -68,7 +68,7 @@
while (!texture_infos_.empty()) {
if (have_context) {
TextureInfo* info = texture_infos_.begin()->second;
- if (!info->IsDeleted() && info->owner_.get() == this) {
+ if (!info->IsDeleted() && info->owned_) {
GLuint service_id = info->service_id();
glDeleteTextures(1, &service_id);
info->MarkAsDeleted();
@@ -556,10 +556,14 @@
TextureManager::TextureInfo* TextureManager::CreateTextureInfo(
const FeatureInfo* feature_info,
GLuint client_id, GLuint service_id) {
- TextureInfo* texture_info = new TextureInfo(service_id);
- texture_info->owner_ = AsWeakPtr();
- AddTextureInfo(feature_info, client_id, texture_info);
- return texture_info;
+ TextureInfo::Ref info(new TextureInfo(service_id));
+ std::pair<TextureInfoMap::iterator, bool> result =
+ texture_infos_.insert(std::make_pair(client_id, info));
+ DCHECK(result.second);
+ if (!info->CanRender(feature_info)) {
+ ++num_unrenderable_textures_;
+ }
+ return info.get();
}
TextureManager::TextureInfo* TextureManager::GetTextureInfo(
@@ -568,26 +572,15 @@
return it != texture_infos_.end() ? it->second : NULL;
}
-void TextureManager::AddTextureInfo(
- const FeatureInfo* feature_info,
- GLuint client_id, TextureInfo* texture_info) {
- std::pair<TextureInfoMap::iterator, bool> result =
- texture_infos_.insert(std::make_pair(client_id, texture_info));
- DCHECK(result.second);
- if (!texture_info->CanRender(feature_info)) {
- ++num_unrenderable_textures_;
- }
-}
-
void TextureManager::RemoveTextureInfo(
const FeatureInfo* feature_info, GLuint client_id) {
TextureInfoMap::iterator it = texture_infos_.find(client_id);
if (it != texture_infos_.end()) {
TextureInfo* info = it->second;
- if (!info->CanRender(feature_info))
+ if (!info->CanRender(feature_info)) {
--num_unrenderable_textures_;
- if (info->owner_.get() == this)
- info->MarkAsDeleted();
+ }
+ info->MarkAsDeleted();
texture_infos_.erase(it);
}
}
Property changes on: gpu/command_buffer/service/texture_manager.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/o3d/gpu/command_buffer/service/texture_manager.cc:r69-2775
Merged /trunk/src/o3d/gpu/command_buffer/service/texture_manager.cc:r32866-32958
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698