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

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

Issue 634643002: content: Out-of-process GPU service support for SurfaceTexture backed GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 } 944 }
945 945
946 void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer( 946 void GpuCommandBufferStub::OnRegisterGpuMemoryBuffer(
947 int32 id, 947 int32 id,
948 gfx::GpuMemoryBufferHandle handle, 948 gfx::GpuMemoryBufferHandle handle,
949 uint32 width, 949 uint32 width,
950 uint32 height, 950 uint32 height,
951 uint32 internalformat) { 951 uint32 internalformat) {
952 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterGpuMemoryBuffer"); 952 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterGpuMemoryBuffer");
953 #if defined(OS_ANDROID)
954 // Verify that renderer is not trying to use a surface texture it doesn't own.
955 if (handle.type == gfx::SURFACE_TEXTURE_BUFFER &&
956 handle.surface_texture_id.secondary_id != channel()->client_id()) {
957 LOG(ERROR) << "Illegal surface texture ID for renderer.";
958 return;
959 }
960 #endif
961 953
962 if (!decoder_) 954 if (!decoder_)
963 return; 955 return;
964 956
965 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); 957 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager();
966 DCHECK(image_manager); 958 DCHECK(image_manager);
967 if (image_manager->LookupImage(id)) { 959 if (image_manager->LookupImage(id)) {
968 LOG(ERROR) << "Image already exists with same ID."; 960 LOG(ERROR) << "Image already exists with same ID.";
969 return; 961 return;
970 } 962 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 if (decoder_) 1082 if (decoder_)
1091 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 1083 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
1092 command_buffer_->SetParseError(gpu::error::kLostContext); 1084 command_buffer_->SetParseError(gpu::error::kLostContext);
1093 } 1085 }
1094 1086
1095 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 1087 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
1096 return GetMemoryManager()->GetClientMemoryUsage(this); 1088 return GetMemoryManager()->GetClientMemoryUsage(this);
1097 } 1089 }
1098 1090
1099 } // namespace content 1091 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698