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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 604833005: gpu: Remove release-after-use workaround. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-in-process-support-for-images
Patch Set: update bug list version Created 6 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 GpuChannelManager* manager = channel_->gpu_channel_manager(); 977 GpuChannelManager* manager = channel_->gpu_channel_manager();
978 scoped_refptr<gfx::GLImage> image = 978 scoped_refptr<gfx::GLImage> image =
979 manager->gpu_memory_buffer_factory()->CreateImageForGpuMemoryBuffer( 979 manager->gpu_memory_buffer_factory()->CreateImageForGpuMemoryBuffer(
980 handle, 980 handle,
981 gfx::Size(width, height), 981 gfx::Size(width, height),
982 internalformat, 982 internalformat,
983 channel()->client_id()); 983 channel()->client_id());
984 if (!image.get()) 984 if (!image.get())
985 return; 985 return;
986 986
987 // For Android specific workaround.
988 if (context_group_->feature_info()->workarounds().release_image_after_use)
989 image->SetReleaseAfterUse();
990
991 image_manager->AddImage(image.get(), id); 987 image_manager->AddImage(image.get(), id);
992 } 988 }
993 989
994 void GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer(int32 id) { 990 void GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer(int32 id) {
995 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer"); 991 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer");
996 992
997 if (!decoder_) 993 if (!decoder_)
998 return; 994 return;
999 995
1000 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); 996 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 if (decoder_) 1095 if (decoder_)
1100 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 1096 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
1101 command_buffer_->SetParseError(gpu::error::kLostContext); 1097 command_buffer_->SetParseError(gpu::error::kLostContext);
1102 } 1098 }
1103 1099
1104 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 1100 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
1105 return GetMemoryManager()->GetClientMemoryUsage(this); 1101 return GetMemoryManager()->GetClientMemoryUsage(this);
1106 } 1102 }
1107 1103
1108 } // namespace content 1104 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698