| Index: components/mus/surfaces/surfaces_context_provider.cc
|
| diff --git a/components/view_manager/surfaces/surfaces_context_provider.cc b/components/mus/surfaces/surfaces_context_provider.cc
|
| similarity index 69%
|
| rename from components/view_manager/surfaces/surfaces_context_provider.cc
|
| rename to components/mus/surfaces/surfaces_context_provider.cc
|
| index 9f2defa4fc9c2795fb6b9f0398ff0fa0ace2b877..0a350def57bf13fde9ade9c138769f62115f441f 100644
|
| --- a/components/view_manager/surfaces/surfaces_context_provider.cc
|
| +++ b/components/mus/surfaces/surfaces_context_provider.cc
|
| @@ -2,16 +2,16 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "components/view_manager/surfaces/surfaces_context_provider.h"
|
| +#include "components/mus/surfaces/surfaces_context_provider.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/synchronization/waitable_event.h"
|
| -#include "components/view_manager/gles2/command_buffer_driver.h"
|
| -#include "components/view_manager/gles2/command_buffer_impl.h"
|
| -#include "components/view_manager/gles2/command_buffer_local.h"
|
| -#include "components/view_manager/gles2/gpu_state.h"
|
| -#include "components/view_manager/surfaces/surfaces_context_provider_delegate.h"
|
| +#include "components/mus/gles2/command_buffer_driver.h"
|
| +#include "components/mus/gles2/command_buffer_impl.h"
|
| +#include "components/mus/gles2/command_buffer_local.h"
|
| +#include "components/mus/gles2/gpu_state.h"
|
| +#include "components/mus/surfaces/surfaces_context_provider_delegate.h"
|
| #include "gpu/command_buffer/client/gles2_cmd_helper.h"
|
| #include "gpu/command_buffer/client/gles2_implementation.h"
|
| #include "gpu/command_buffer/client/transfer_buffer.h"
|
| @@ -23,16 +23,13 @@ const size_t kDefaultCommandBufferSize = 1024 * 1024;
|
| const size_t kDefaultStartTransferBufferSize = 1 * 1024 * 1024;
|
| const size_t kDefaultMinTransferBufferSize = 1 * 256 * 1024;
|
| const size_t kDefaultMaxTransferBufferSize = 16 * 1024 * 1024;
|
| -
|
| }
|
|
|
| SurfacesContextProvider::SurfacesContextProvider(
|
| SurfacesContextProviderDelegate* delegate,
|
| gfx::AcceleratedWidget widget,
|
| const scoped_refptr<gles2::GpuState>& state)
|
| - : delegate_(delegate),
|
| - state_(state),
|
| - widget_(widget) {
|
| + : delegate_(delegate), state_(state), widget_(widget) {
|
| capabilities_.gpu.image = true;
|
| command_buffer_local_.reset(
|
| new gles2::CommandBufferLocal(this, widget_, state_));
|
| @@ -45,9 +42,8 @@ bool SurfacesContextProvider::BindToCurrentThread() {
|
| DCHECK(CalledOnValidThread());
|
| if (!command_buffer_local_->Initialize())
|
| return false;
|
| - gles2_helper_.reset(
|
| - new gpu::gles2::GLES2CmdHelper(
|
| - command_buffer_local_->GetCommandBuffer()));
|
| + gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(
|
| + command_buffer_local_->GetCommandBuffer()));
|
| if (!gles2_helper_->Initialize(kDefaultCommandBufferSize))
|
| return false;
|
| gles2_helper_->SetAutomaticFlushes(false);
|
| @@ -59,18 +55,13 @@ bool SurfacesContextProvider::BindToCurrentThread() {
|
| // this needs to be a public parameter.
|
| bool lose_context_when_out_of_memory = false;
|
| bool support_client_side_arrays = false;
|
| - implementation_.reset(
|
| - new gpu::gles2::GLES2Implementation(gles2_helper_.get(),
|
| - NULL,
|
| - transfer_buffer_.get(),
|
| - bind_generates_resource,
|
| - lose_context_when_out_of_memory,
|
| - support_client_side_arrays,
|
| - command_buffer_local_.get()));
|
| - return implementation_->Initialize(kDefaultStartTransferBufferSize,
|
| - kDefaultMinTransferBufferSize,
|
| - kDefaultMaxTransferBufferSize,
|
| - gpu::gles2::GLES2Implementation::kNoLimit);
|
| + implementation_.reset(new gpu::gles2::GLES2Implementation(
|
| + gles2_helper_.get(), NULL, transfer_buffer_.get(),
|
| + bind_generates_resource, lose_context_when_out_of_memory,
|
| + support_client_side_arrays, command_buffer_local_.get()));
|
| + return implementation_->Initialize(
|
| + kDefaultStartTransferBufferSize, kDefaultMinTransferBufferSize,
|
| + kDefaultMaxTransferBufferSize, gpu::gles2::GLES2Implementation::kNoLimit);
|
| }
|
|
|
| gpu::gles2::GLES2Interface* SurfacesContextProvider::ContextGL() {
|
| @@ -85,16 +76,14 @@ class GrContext* SurfacesContextProvider::GrContext() {
|
| return NULL;
|
| }
|
|
|
| -void SurfacesContextProvider::InvalidateGrContext(uint32_t state) {
|
| -}
|
| +void SurfacesContextProvider::InvalidateGrContext(uint32_t state) {}
|
|
|
| cc::ContextProvider::Capabilities
|
| SurfacesContextProvider::ContextCapabilities() {
|
| return capabilities_;
|
| }
|
|
|
| -void SurfacesContextProvider::SetupLock() {
|
| -}
|
| +void SurfacesContextProvider::SetupLock() {}
|
|
|
| base::Lock* SurfacesContextProvider::GetLock() {
|
| return &context_lock_;
|
|
|