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

Unified Diff: services/ui/surfaces/surfaces_context_provider.cc

Issue 2280723004: services/ui: Remove unwanted gpu dependency from services/ui/surfaces. (Closed)
Patch Set: . Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/surfaces/surfaces_context_provider.h ('k') | services/ui/ws/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/surfaces_context_provider.cc
diff --git a/services/ui/surfaces/surfaces_context_provider.cc b/services/ui/surfaces/surfaces_context_provider.cc
index 0b0e31c228b6e23c8cc820e7ba7c01d246e5ad7e..81bee2c484ec3adf3d1a4af8d908a6f950cd92dc 100644
--- a/services/ui/surfaces/surfaces_context_provider.cc
+++ b/services/ui/surfaces/surfaces_context_provider.cc
@@ -17,16 +17,18 @@
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "gpu/ipc/client/command_buffer_proxy_impl.h"
+#include "gpu/ipc/client/gpu_channel_host.h"
#include "services/ui/common/switches.h"
-#include "services/ui/gpu/gpu_service_internal.h"
#include "services/ui/surfaces/surfaces_context_provider_delegate.h"
#include "ui/gl/gpu_preference.h"
+#include "url/gurl.h"
namespace ui {
-SurfacesContextProvider::SurfacesContextProvider(gfx::AcceleratedWidget widget)
+SurfacesContextProvider::SurfacesContextProvider(
+ gfx::AcceleratedWidget widget,
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel)
: delegate_(nullptr), widget_(widget) {
- GpuServiceInternal* service = GpuServiceInternal::GetInstance();
gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr;
gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT;
gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL;
@@ -42,8 +44,9 @@ SurfacesContextProvider::SurfacesContextProvider(gfx::AcceleratedWidget widget)
scoped_refptr<base::SingleThreadTaskRunner> task_runner =
base::ThreadTaskRunnerHandle::Get();
command_buffer_proxy_impl_ = gpu::CommandBufferProxyImpl::Create(
- service->gpu_channel_local(), widget, shared_command_buffer, stream_id,
+ std::move(gpu_channel), widget, shared_command_buffer, stream_id,
stream_priority, attributes, active_url, task_runner);
+ CHECK(command_buffer_proxy_impl_);
command_buffer_proxy_impl_->SetSwapBuffersCompletionCallback(
base::Bind(&SurfacesContextProvider::OnGpuSwapBuffersCompleted,
base::Unretained(this)));
« no previous file with comments | « services/ui/surfaces/surfaces_context_provider.h ('k') | services/ui/ws/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698