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

Unified Diff: services/ui/common/mus_gpu_memory_buffer_manager.cc

Issue 2532763003: mus: Simplify generation of memory-buffer ids. (Closed)
Patch Set: tot merge Created 4 years, 1 month 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
« no previous file with comments | « services/ui/common/mus_gpu_memory_buffer_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/mus_gpu_memory_buffer_manager.cc
diff --git a/services/ui/common/mus_gpu_memory_buffer_manager.cc b/services/ui/common/mus_gpu_memory_buffer_manager.cc
index bdc89913a5b30233e17a798696eb85768a717cca..eda17128a87cb968ce167c3838b2a190645d5b17 100644
--- a/services/ui/common/mus_gpu_memory_buffer_manager.cc
+++ b/services/ui/common/mus_gpu_memory_buffer_manager.cc
@@ -8,7 +8,6 @@
#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
#include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h"
-#include "services/ui/common/generic_shared_memory_id_generator.h"
#include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
namespace ui {
@@ -26,7 +25,8 @@ MusGpuMemoryBufferManager::CreateGpuMemoryBuffer(
gfx::BufferFormat format,
gfx::BufferUsage usage,
gpu::SurfaceHandle surface_handle) {
- gfx::GpuMemoryBufferId id = GetNextGenericSharedMemoryId();
+ DCHECK(CalledOnValidThread());
+ gfx::GpuMemoryBufferId id(next_gpu_memory_id_++);
const bool is_native =
gpu::IsNativeGpuMemoryBufferConfigurationSupported(format, usage);
if (is_native) {
@@ -61,6 +61,7 @@ MusGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
void MusGpuMemoryBufferManager::SetDestructionSyncToken(
gfx::GpuMemoryBuffer* buffer,
const gpu::SyncToken& sync_token) {
+ DCHECK(CalledOnValidThread());
static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token(
sync_token);
}
@@ -70,6 +71,7 @@ void MusGpuMemoryBufferManager::DestroyGpuMemoryBuffer(
int client_id,
bool is_native,
const gpu::SyncToken& sync_token) {
+ DCHECK(CalledOnValidThread());
if (is_native) {
gpu_service_->DestroyGpuMemoryBuffer(id, client_id, sync_token);
}
« no previous file with comments | « services/ui/common/mus_gpu_memory_buffer_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698