| OLD | NEW |
| 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/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 OnRetireSyncPoint) | 231 OnRetireSyncPoint) |
| 232 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncPoint, | 232 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncPoint, |
| 233 OnSignalSyncPoint) | 233 OnSignalSyncPoint) |
| 234 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery, | 234 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery, |
| 235 OnSignalQuery) | 235 OnSignalQuery) |
| 236 IPC_MESSAGE_HANDLER( | 236 IPC_MESSAGE_HANDLER( |
| 237 GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback, | 237 GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback, |
| 238 OnSetClientHasMemoryAllocationChangedCallback) | 238 OnSetClientHasMemoryAllocationChangedCallback) |
| 239 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterGpuMemoryBuffer, | 239 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterGpuMemoryBuffer, |
| 240 OnRegisterGpuMemoryBuffer); | 240 OnRegisterGpuMemoryBuffer); |
| 241 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyGpuMemoryBuffer, | 241 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_UnregisterGpuMemoryBuffer, |
| 242 OnDestroyGpuMemoryBuffer); | 242 OnUnregisterGpuMemoryBuffer); |
| 243 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture, | 243 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture, |
| 244 OnCreateStreamTexture) | 244 OnCreateStreamTexture) |
| 245 IPC_MESSAGE_UNHANDLED(handled = false) | 245 IPC_MESSAGE_UNHANDLED(handled = false) |
| 246 IPC_END_MESSAGE_MAP() | 246 IPC_END_MESSAGE_MAP() |
| 247 | 247 |
| 248 CheckCompleteWaits(); | 248 CheckCompleteWaits(); |
| 249 | 249 |
| 250 if (have_context) { | 250 if (have_context) { |
| 251 // Ensure that any delayed work that was created will be handled. | 251 // Ensure that any delayed work that was created will be handled. |
| 252 ScheduleDelayedWork(kHandleMoreWorkPeriodMs); | 252 ScheduleDelayedWork(kHandleMoreWorkPeriodMs); |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 if (context_group_->feature_info()->workarounds().release_image_after_use) | 943 if (context_group_->feature_info()->workarounds().release_image_after_use) |
| 944 image->SetReleaseAfterUse(); | 944 image->SetReleaseAfterUse(); |
| 945 | 945 |
| 946 if (decoder_) { | 946 if (decoder_) { |
| 947 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 947 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| 948 DCHECK(image_manager); | 948 DCHECK(image_manager); |
| 949 image_manager->AddImage(image.get(), id); | 949 image_manager->AddImage(image.get(), id); |
| 950 } | 950 } |
| 951 } | 951 } |
| 952 | 952 |
| 953 void GpuCommandBufferStub::OnDestroyGpuMemoryBuffer(int32 id) { | 953 void GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer(int32 id) { |
| 954 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyGpuMemoryBuffer"); | 954 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnUnregisterGpuMemoryBuffer"); |
| 955 | 955 |
| 956 if (decoder_) { | 956 if (decoder_) { |
| 957 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); | 957 gpu::gles2::ImageManager* image_manager = decoder_->GetImageManager(); |
| 958 DCHECK(image_manager); | 958 DCHECK(image_manager); |
| 959 image_manager->RemoveImage(id); | 959 image_manager->RemoveImage(id); |
| 960 } | 960 } |
| 961 } | 961 } |
| 962 | 962 |
| 963 void GpuCommandBufferStub::SendConsoleMessage( | 963 void GpuCommandBufferStub::SendConsoleMessage( |
| 964 int32 id, | 964 int32 id, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 if (decoder_) | 1052 if (decoder_) |
| 1053 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 1053 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
| 1054 command_buffer_->SetParseError(gpu::error::kLostContext); | 1054 command_buffer_->SetParseError(gpu::error::kLostContext); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 1057 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
| 1058 return GetMemoryManager()->GetClientMemoryUsage(this); | 1058 return GetMemoryManager()->GetClientMemoryUsage(this); |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 } // namespace content | 1061 } // namespace content |
| OLD | NEW |