diff options
Diffstat (limited to 'components/mus/gles2')
22 files changed, 59 insertions, 62 deletions
diff --git a/components/mus/gles2/command_buffer_driver.cc b/components/mus/gles2/command_buffer_driver.cc index 97f88bd..350f512 100644 --- a/components/mus/gles2/command_buffer_driver.cc +++ b/components/mus/gles2/command_buffer_driver.cc @@ -32,7 +32,7 @@ #include "ui/gl/gl_image_shared_memory.h" #include "ui/gl/gl_surface.h" -namespace mus { +namespace gles2 { CommandBufferDriver::Client::~Client() {} @@ -131,7 +131,7 @@ bool CommandBufferDriver::DoInitialize( const size_t kSize = sizeof(gpu::CommandBufferSharedState); scoped_ptr<gpu::BufferBacking> backing( - MojoBufferBacking::Create(shared_state.Pass(), kSize)); + gles2::MojoBufferBacking::Create(shared_state.Pass(), kSize)); if (!backing) return false; @@ -167,7 +167,7 @@ void CommandBufferDriver::RegisterTransferBuffer( // Take ownership of the memory and map it into this process. // This validates the size. scoped_ptr<gpu::BufferBacking> backing( - MojoBufferBacking::Create(transfer_buffer.Pass(), size)); + gles2::MojoBufferBacking::Create(transfer_buffer.Pass(), size)); if (!backing) { DVLOG(0) << "Failed to map shared memory."; return; @@ -302,4 +302,4 @@ void CommandBufferDriver::DestroyDecoder() { } } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/command_buffer_driver.h b/components/mus/gles2/command_buffer_driver.h index 4a19d11..09c4c70 100644 --- a/components/mus/gles2/command_buffer_driver.h +++ b/components/mus/gles2/command_buffer_driver.h @@ -28,7 +28,7 @@ class GLContext; class GLSurface; } -namespace mus { +namespace gles2 { class GpuState; @@ -94,6 +94,6 @@ class CommandBufferDriver { DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_H_ diff --git a/components/mus/gles2/command_buffer_impl.cc b/components/mus/gles2/command_buffer_impl.cc index 7944f4c0..2cc4ca7 100644 --- a/components/mus/gles2/command_buffer_impl.cc +++ b/components/mus/gles2/command_buffer_impl.cc @@ -11,14 +11,11 @@ #include "components/mus/gles2/gpu_state.h" #include "gpu/command_buffer/service/sync_point_manager.h" -namespace mus { - +namespace gles2 { namespace { - void RunCallback(const mojo::Callback<void()>& callback) { callback.Run(); } - } // namespace class CommandBufferImpl::CommandBufferDriverClientImpl @@ -170,4 +167,4 @@ void CommandBufferImpl::DidLoseContext() { OnConnectionError(); } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/command_buffer_impl.h b/components/mus/gles2/command_buffer_impl.h index 46f8273..7992391 100644 --- a/components/mus/gles2/command_buffer_impl.h +++ b/components/mus/gles2/command_buffer_impl.h @@ -11,8 +11,7 @@ #include "components/mus/public/interfaces/command_buffer.mojom.h" #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" -namespace mus { - +namespace gles2 { class CommandBufferDriver; class CommandBufferImplObserver; class GpuState; @@ -78,6 +77,6 @@ class CommandBufferImpl : public mojo::CommandBuffer { DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl); }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_IMPL_H_ diff --git a/components/mus/gles2/command_buffer_impl_observer.h b/components/mus/gles2/command_buffer_impl_observer.h index 6ea42de..c39b497 100644 --- a/components/mus/gles2/command_buffer_impl_observer.h +++ b/components/mus/gles2/command_buffer_impl_observer.h @@ -5,7 +5,7 @@ #ifndef COMPONENTS_GLES2_COMMAND_BUFFER_IMPL_OBSERVER_H_ #define COMPONENTS_GLES2_COMMAND_BUFFER_IMPL_OBSERVER_H_ -namespace mus { +namespace gles2 { class CommandBufferImplObserver { public: @@ -15,6 +15,6 @@ class CommandBufferImplObserver { ~CommandBufferImplObserver() {} }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_IMPL_OBSERVER_H_ diff --git a/components/mus/gles2/command_buffer_local.cc b/components/mus/gles2/command_buffer_local.cc index f6e15a0..3d2ac95 100644 --- a/components/mus/gles2/command_buffer_local.cc +++ b/components/mus/gles2/command_buffer_local.cc @@ -22,13 +22,14 @@ #include "ui/gl/gl_image_memory.h" #include "ui/gl/gl_surface.h" -namespace mus { +namespace gles2 { const unsigned int GL_MAP_CHROMIUM = 0x78F1; -CommandBufferLocal::CommandBufferLocal(CommandBufferLocalClient* client, - gfx::AcceleratedWidget widget, - const scoped_refptr<GpuState>& gpu_state) +CommandBufferLocal::CommandBufferLocal( + CommandBufferLocalClient* client, + gfx::AcceleratedWidget widget, + const scoped_refptr<gles2::GpuState>& gpu_state) : widget_(widget), gpu_state_(gpu_state), client_(client), @@ -74,7 +75,7 @@ bool CommandBufferLocal::Initialize() { bool bind_generates_resource = false; scoped_refptr<gpu::gles2::ContextGroup> context_group = new gpu::gles2::ContextGroup( - gpu_state_->mailbox_manager(), new GpuMemoryTracker, + gpu_state_->mailbox_manager(), new gles2::GpuMemoryTracker, new gpu::gles2::ShaderTranslatorCache, new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, nullptr, bind_generates_resource); @@ -127,8 +128,8 @@ int32_t CommandBufferLocal::CreateImage(ClientBuffer buffer, size_t width, size_t height, unsigned internalformat) { - MojoGpuMemoryBufferImpl* gpu_memory_buffer = - MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); + gles2::MojoGpuMemoryBufferImpl* gpu_memory_buffer = + gles2::MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); scoped_refptr<gfx::GLImageMemory> image(new gfx::GLImageMemory( gfx::Size(static_cast<int>(width), static_cast<int>(height)), @@ -159,10 +160,11 @@ int32_t CommandBufferLocal::CreateGpuMemoryBufferImage(size_t width, unsigned internalformat, unsigned usage) { DCHECK_EQ(usage, static_cast<unsigned>(GL_MAP_CHROMIUM)); - scoped_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create( - gfx::Size(static_cast<int>(width), static_cast<int>(height)), - gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), - gpu::ImageFactory::ImageUsageToGpuMemoryBufferUsage(usage))); + scoped_ptr<gfx::GpuMemoryBuffer> buffer( + gles2::MojoGpuMemoryBufferImpl::Create( + gfx::Size(static_cast<int>(width), static_cast<int>(height)), + gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), + gpu::ImageFactory::ImageUsageToGpuMemoryBufferUsage(usage))); if (!buffer) return -1; return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); @@ -257,4 +259,4 @@ void CommandBufferLocal::OnSyncPointRetired() { scheduler_->SetScheduled(true); } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/command_buffer_local.h b/components/mus/gles2/command_buffer_local.h index 14c4821..bc50bdf 100644 --- a/components/mus/gles2/command_buffer_local.h +++ b/components/mus/gles2/command_buffer_local.h @@ -31,10 +31,9 @@ class GLContext; class GLSurface; } -namespace mus { +namespace gles2 { class CommandBufferLocalClient; -class GpuState; // This class provides a thin wrapper around a CommandBufferService and a // GpuControl implementation to allow cc::Display to generate GL directly on @@ -43,7 +42,7 @@ class CommandBufferLocal : public gpu::GpuControl { public: CommandBufferLocal(CommandBufferLocalClient* client, gfx::AcceleratedWidget widget, - const scoped_refptr<GpuState>& gpu_state); + const scoped_refptr<gles2::GpuState>& gpu_state); ~CommandBufferLocal() override; bool Initialize(); @@ -84,7 +83,7 @@ class CommandBufferLocal : public gpu::GpuControl { void OnSyncPointRetired(); gfx::AcceleratedWidget widget_; - scoped_refptr<GpuState> gpu_state_; + scoped_refptr<gles2::GpuState> gpu_state_; scoped_ptr<gpu::CommandBufferService> command_buffer_; scoped_ptr<gpu::GpuScheduler> scheduler_; scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; @@ -97,6 +96,6 @@ class CommandBufferLocal : public gpu::GpuControl { DISALLOW_COPY_AND_ASSIGN(CommandBufferLocal); }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ diff --git a/components/mus/gles2/command_buffer_local_client.h b/components/mus/gles2/command_buffer_local_client.h index b4e237a..ce644ae 100644 --- a/components/mus/gles2/command_buffer_local_client.h +++ b/components/mus/gles2/command_buffer_local_client.h @@ -5,7 +5,7 @@ #ifndef COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_CLIENT_H_ #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_CLIENT_H_ -namespace mus { +namespace gles2 { class CommandBufferLocalClient { public: @@ -16,6 +16,6 @@ class CommandBufferLocalClient { virtual ~CommandBufferLocalClient() {} }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_CLIENT_H_ diff --git a/components/mus/gles2/command_buffer_type_conversions.cc b/components/mus/gles2/command_buffer_type_conversions.cc index 3762e47..2ec6484 100644 --- a/components/mus/gles2/command_buffer_type_conversions.cc +++ b/components/mus/gles2/command_buffer_type_conversions.cc @@ -167,4 +167,4 @@ gpu::Capabilities TypeConverter<gpu::Capabilities, GpuCapabilitiesPtr>::Convert( return result; } -} // namespace mojo +} // namespace gles2 diff --git a/components/mus/gles2/command_buffer_type_conversions.h b/components/mus/gles2/command_buffer_type_conversions.h index 2055c4b..ee1d8e9 100644 --- a/components/mus/gles2/command_buffer_type_conversions.h +++ b/components/mus/gles2/command_buffer_type_conversions.h @@ -62,6 +62,6 @@ struct TypeConverter<gpu::Capabilities, GpuCapabilitiesPtr> { static gpu::Capabilities Convert(const GpuCapabilitiesPtr& input); }; -} // namespace mojo +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_TYPE_CONVERSIONS_H_ diff --git a/components/mus/gles2/gpu_impl.cc b/components/mus/gles2/gpu_impl.cc index b8c3e95..506b3eb 100644 --- a/components/mus/gles2/gpu_impl.cc +++ b/components/mus/gles2/gpu_impl.cc @@ -7,7 +7,7 @@ #include "components/mus/gles2/command_buffer_driver.h" #include "components/mus/gles2/command_buffer_impl.h" -namespace mus { +namespace gles2 { GpuImpl::GpuImpl(mojo::InterfaceRequest<Gpu> request, const scoped_refptr<GpuState>& state) @@ -21,4 +21,4 @@ void GpuImpl::CreateOffscreenGLES2Context( make_scoped_ptr(new CommandBufferDriver(state_))); } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/gpu_impl.h b/components/mus/gles2/gpu_impl.h index 6bc1cdb..f184751 100644 --- a/components/mus/gles2/gpu_impl.h +++ b/components/mus/gles2/gpu_impl.h @@ -15,7 +15,7 @@ #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" #include "ui/mojo/geometry/geometry.mojom.h" -namespace mus { +namespace gles2 { class GpuImpl : public mojo::Gpu { public: @@ -33,6 +33,6 @@ class GpuImpl : public mojo::Gpu { DISALLOW_COPY_AND_ASSIGN(GpuImpl); }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_GPU_IMPL_H_ diff --git a/components/mus/gles2/gpu_memory_tracker.cc b/components/mus/gles2/gpu_memory_tracker.cc index 6048d61..b40e8f1 100644 --- a/components/mus/gles2/gpu_memory_tracker.cc +++ b/components/mus/gles2/gpu_memory_tracker.cc @@ -4,7 +4,7 @@ #include "components/mus/gles2/gpu_memory_tracker.h" -namespace mus { +namespace gles2 { GpuMemoryTracker::GpuMemoryTracker() {} @@ -27,4 +27,4 @@ int GpuMemoryTracker::ClientId() const { GpuMemoryTracker::~GpuMemoryTracker() {} -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/gpu_memory_tracker.h b/components/mus/gles2/gpu_memory_tracker.h index 91b9b982..94e6422 100644 --- a/components/mus/gles2/gpu_memory_tracker.h +++ b/components/mus/gles2/gpu_memory_tracker.h @@ -7,7 +7,7 @@ #include "gpu/command_buffer/service/memory_tracking.h" -namespace mus { +namespace gles2 { // TODO(fsamuel, rjkroege): This is a stub implementation that needs to be // completed for proper memory tracking. @@ -15,7 +15,7 @@ class GpuMemoryTracker : public gpu::gles2::MemoryTracker { public: GpuMemoryTracker(); - // gpu::MemoryTracker implementation: + // gpu::gles2::MemoryTracker implementation: void TrackMemoryAllocatedChange( size_t old_size, size_t new_size, @@ -30,6 +30,6 @@ class GpuMemoryTracker : public gpu::gles2::MemoryTracker { DISALLOW_COPY_AND_ASSIGN(GpuMemoryTracker); }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_GPU_MEMORY_TRACKER_H_ diff --git a/components/mus/gles2/gpu_state.cc b/components/mus/gles2/gpu_state.cc index 48932e6..4553cf7 100644 --- a/components/mus/gles2/gpu_state.cc +++ b/components/mus/gles2/gpu_state.cc @@ -5,7 +5,7 @@ #include "components/mus/gles2/gpu_state.h" -namespace mus { +namespace gles2 { GpuState::GpuState() : control_thread_("gpu_command_buffer_control"), @@ -21,4 +21,4 @@ void GpuState::StopControlThread() { control_thread_.Stop(); } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/gpu_state.h b/components/mus/gles2/gpu_state.h index 59148b7..4864053 100644 --- a/components/mus/gles2/gpu_state.h +++ b/components/mus/gles2/gpu_state.h @@ -13,7 +13,7 @@ #include "gpu/command_buffer/service/sync_point_manager.h" #include "ui/gl/gl_share_group.h" -namespace mus { +namespace gles2 { // We need to share these across all CommandBuffer instances so that contexts // they create can share resources with each other via mailboxes. @@ -50,6 +50,6 @@ class GpuState : public base::RefCounted<GpuState> { scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_GPU_STATE_H_ diff --git a/components/mus/gles2/mojo_buffer_backing.cc b/components/mus/gles2/mojo_buffer_backing.cc index 1beadb32..bdb745b 100644 --- a/components/mus/gles2/mojo_buffer_backing.cc +++ b/components/mus/gles2/mojo_buffer_backing.cc @@ -6,7 +6,7 @@ #include "base/logging.h" -namespace mus { +namespace gles2 { MojoBufferBacking::MojoBufferBacking(mojo::ScopedSharedBufferHandle handle, void* memory, @@ -37,4 +37,4 @@ size_t MojoBufferBacking::GetSize() const { return size_; } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/mojo_buffer_backing.h b/components/mus/gles2/mojo_buffer_backing.h index 730dd33..04da87b 100644 --- a/components/mus/gles2/mojo_buffer_backing.h +++ b/components/mus/gles2/mojo_buffer_backing.h @@ -10,7 +10,7 @@ #include "gpu/command_buffer/common/buffer.h" #include "third_party/mojo/src/mojo/public/cpp/system/core.h" -namespace mus { +namespace gles2 { class MojoBufferBacking : public gpu::BufferBacking { public: @@ -34,6 +34,6 @@ class MojoBufferBacking : public gpu::BufferBacking { DISALLOW_COPY_AND_ASSIGN(MojoBufferBacking); }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_MOJO_BUFFER_BACKING_H_ diff --git a/components/mus/gles2/mojo_gpu_memory_buffer.cc b/components/mus/gles2/mojo_gpu_memory_buffer.cc index fac4629..c5aaef1 100644 --- a/components/mus/gles2/mojo_gpu_memory_buffer.cc +++ b/components/mus/gles2/mojo_gpu_memory_buffer.cc @@ -9,7 +9,7 @@ #include "base/numerics/safe_conversions.h" #include "ui/gfx/buffer_format_util.h" -namespace mus { +namespace gles2 { MojoGpuMemoryBufferImpl::MojoGpuMemoryBufferImpl( const gfx::Size& size, @@ -97,4 +97,4 @@ ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() { return reinterpret_cast<ClientBuffer>(this); } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/mojo_gpu_memory_buffer.h b/components/mus/gles2/mojo_gpu_memory_buffer.h index cf16ebd0..691c6fc 100644 --- a/components/mus/gles2/mojo_gpu_memory_buffer.h +++ b/components/mus/gles2/mojo_gpu_memory_buffer.h @@ -9,7 +9,7 @@ #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" -namespace mus { +namespace gles2 { class MojoGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { public: @@ -45,6 +45,6 @@ class MojoGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferImpl); }; -} // namespace mus +} // gles2 #endif // COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_H_ diff --git a/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc b/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc index a48594f..3ef2293 100644 --- a/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc +++ b/components/mus/gles2/mojo_gpu_memory_buffer_manager.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "components/mus/gles2/mojo_gpu_memory_buffer.h" -namespace mus { +namespace gles2 { MojoGpuMemoryBufferManager::MojoGpuMemoryBufferManager() {} @@ -32,4 +32,4 @@ void MojoGpuMemoryBufferManager::SetDestructionSyncPoint( NOTIMPLEMENTED(); } -} // namespace mus +} // namespace gles2 diff --git a/components/mus/gles2/mojo_gpu_memory_buffer_manager.h b/components/mus/gles2/mojo_gpu_memory_buffer_manager.h index 37133b3..2779135 100644 --- a/components/mus/gles2/mojo_gpu_memory_buffer_manager.h +++ b/components/mus/gles2/mojo_gpu_memory_buffer_manager.h @@ -7,7 +7,7 @@ #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" -namespace mus { +namespace gles2 { class MojoGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { public: @@ -28,6 +28,6 @@ class MojoGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { DISALLOW_COPY_AND_ASSIGN(MojoGpuMemoryBufferManager); }; -} // namespace mus +} // namespace gles2 #endif // COMPONENTS_MUS_GLES2_MOJO_GPU_MEMORY_BUFFER_MANAGER_H_ |