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

Unified Diff: content/child/child_gpu_memory_buffer_manager.cc

Issue 2514923002: content: Use mus client-lib's gpu-service from renderers. (Closed)
Patch Set: . Created 4 years 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 | « content/child/child_gpu_memory_buffer_manager.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_gpu_memory_buffer_manager.cc
diff --git a/content/child/child_gpu_memory_buffer_manager.cc b/content/child/child_gpu_memory_buffer_manager.cc
deleted file mode 100644
index 6b8042c70b83a467d04bef26ae55bcc123016755..0000000000000000000000000000000000000000
--- a/content/child/child_gpu_memory_buffer_manager.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/child/child_gpu_memory_buffer_manager.h"
-
-#include <memory>
-#include <utility>
-
-#include "content/common/child_process_messages.h"
-#include "content/common/generic_shared_memory_id_generator.h"
-#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
-
-namespace content {
-namespace {
-
-void DeletedGpuMemoryBuffer(ThreadSafeSender* sender,
- gfx::GpuMemoryBufferId id,
- const gpu::SyncToken& sync_token) {
- TRACE_EVENT0("renderer",
- "ChildGpuMemoryBufferManager::DeletedGpuMemoryBuffer");
- sender->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(id, sync_token));
-}
-
-} // namespace
-
-ChildGpuMemoryBufferManager::ChildGpuMemoryBufferManager(
- ThreadSafeSender* sender)
- : sender_(sender) {
-}
-
-ChildGpuMemoryBufferManager::~ChildGpuMemoryBufferManager() {
-}
-
-std::unique_ptr<gfx::GpuMemoryBuffer>
-ChildGpuMemoryBufferManager::CreateGpuMemoryBuffer(
- const gfx::Size& size,
- gfx::BufferFormat format,
- gfx::BufferUsage usage,
- gpu::SurfaceHandle surface_handle) {
- DCHECK_EQ(gpu::kNullSurfaceHandle, surface_handle);
- TRACE_EVENT2("renderer", "ChildGpuMemoryBufferManager::CreateGpuMemoryBuffer",
- "width", size.width(), "height", size.height());
-
- gfx::GpuMemoryBufferHandle handle;
- IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer(
- content::GetNextGenericSharedMemoryId(), size.width(), size.height(),
- format, usage, &handle);
- bool success = sender_->Send(message);
- if (!success || handle.is_null())
- return nullptr;
-
- std::unique_ptr<gpu::GpuMemoryBufferImpl> buffer(
- gpu::GpuMemoryBufferImpl::CreateFromHandle(
- handle, size, format, usage,
- base::Bind(&DeletedGpuMemoryBuffer, base::RetainedRef(sender_),
- handle.id)));
- if (!buffer) {
- sender_->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(
- handle.id, gpu::SyncToken()));
- return nullptr;
- }
-
- return std::move(buffer);
-}
-
-void ChildGpuMemoryBufferManager::SetDestructionSyncToken(
- gfx::GpuMemoryBuffer* buffer,
- const gpu::SyncToken& sync_token) {
- static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token(
- sync_token);
-}
-
-} // namespace content
« no previous file with comments | « content/child/child_gpu_memory_buffer_manager.h ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698