From bb149919a30659dd6a1ad13de508c53612102197 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Mon, 2 Sep 2019 16:53:17 +0000 Subject: [PATCH] Bug 1577916 - Remove using namespace std from gfx/layers r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D44285 --HG-- extra : moz-landing-system : lando --- gfx/layers/client/ContentClient.cpp | 4 +--- gfx/layers/composite/TextRenderer.cpp | 5 ++--- gfx/layers/d3d11/MLGDeviceD3D11.cpp | 1 - gfx/layers/ipc/CompositorBridgeParent.cpp | 5 ++--- gfx/layers/ipc/CompositorVsyncScheduler.cpp | 1 - gfx/layers/ipc/ContentCompositorBridgeParent.cpp | 4 +--- gfx/layers/mlgpu/LayerManagerMLGPU.cpp | 2 -- gfx/layers/mlgpu/SharedBufferMLGPU.cpp | 2 -- gfx/layers/opengl/CompositorOGL.cpp | 1 - gfx/layers/opengl/OGLShaderProgram.cpp | 8 ++++---- 10 files changed, 10 insertions(+), 23 deletions(-) diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 01afaf1ea2e4..48679773fd33 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -39,8 +39,6 @@ #include #include -using namespace std; - namespace mozilla { using namespace gfx; @@ -574,7 +572,7 @@ class RemoteBufferReadbackProcessor : public TextureReadbackSink { private: nsTArray mReadbackUpdates; // This array is used to keep the layers alive until the callback. - vector> mLayerRefs; + std::vector> mLayerRefs; IntRect mBufferRect; nsIntPoint mBufferRotation; diff --git a/gfx/layers/composite/TextRenderer.cpp b/gfx/layers/composite/TextRenderer.cpp index 1dda2cf9d2c5..ea41851bbc97 100644 --- a/gfx/layers/composite/TextRenderer.cpp +++ b/gfx/layers/composite/TextRenderer.cpp @@ -17,7 +17,6 @@ namespace mozilla { namespace layers { using namespace gfx; -using namespace std; const Float sBackgroundOpacity = 0.8f; const SurfaceFormat sTextureFormat = SurfaceFormat::B8G8R8A8; @@ -51,7 +50,7 @@ TextRenderer::~TextRenderer() {} TextRenderer::FontCache::~FontCache() { mGlyphBitmaps->Unmap(); } -void TextRenderer::RenderText(Compositor* aCompositor, const string& aText, +void TextRenderer::RenderText(Compositor* aCompositor, const std::string& aText, const IntPoint& aOrigin, const Matrix4x4& aTransform, uint32_t aTextSize, uint32_t aTargetPixelWidth, FontType aFontType) { @@ -80,7 +79,7 @@ void TextRenderer::RenderText(Compositor* aCompositor, const string& aText, aCompositor->DrawQuad(Rect(drawRect), clip, chain, 1.0f, transform); } -IntSize TextRenderer::ComputeSurfaceSize(const string& aText, +IntSize TextRenderer::ComputeSurfaceSize(const std::string& aText, uint32_t aTargetPixelWidth, FontType aFontType) { if (!EnsureInitialized(aFontType)) { diff --git a/gfx/layers/d3d11/MLGDeviceD3D11.cpp b/gfx/layers/d3d11/MLGDeviceD3D11.cpp index 66fada3e6da0..2644c5b9266f 100644 --- a/gfx/layers/d3d11/MLGDeviceD3D11.cpp +++ b/gfx/layers/d3d11/MLGDeviceD3D11.cpp @@ -30,7 +30,6 @@ namespace layers { using namespace mozilla::gfx; using namespace mozilla::widget; using namespace mozilla::layers::mlg; -using namespace std; // Defined in CompositorD3D11.cpp. bool CanUsePartialPresents(ID3D11Device* aDevice); diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index c58ca1f73919..bcd53db5d60c 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -114,7 +114,6 @@ namespace layers { using namespace mozilla::ipc; using namespace mozilla::gfx; -using namespace std; using base::ProcessId; using base::Thread; @@ -236,7 +235,7 @@ CompositorBridgeParent::LayerTreeState::~LayerTreeState() { } } -typedef map LayerTreeMap; +typedef std::map LayerTreeMap; LayerTreeMap sIndirectLayerTrees; StaticAutoPtr sIndirectLayerTreesLock; @@ -268,7 +267,7 @@ inline void CompositorBridgeParent::ForEachIndirectLayerTree( * compositions without having to keep references to the * compositor */ -typedef map CompositorMap; +typedef std::map CompositorMap; static StaticAutoPtr sCompositorMap; void CompositorBridgeParent::Setup() { diff --git a/gfx/layers/ipc/CompositorVsyncScheduler.cpp b/gfx/layers/ipc/CompositorVsyncScheduler.cpp index f25112b198eb..494566f5f4d5 100644 --- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp +++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp @@ -42,7 +42,6 @@ namespace mozilla { namespace layers { using namespace mozilla::gfx; -using namespace std; CompositorVsyncScheduler::Observer::Observer(CompositorVsyncScheduler* aOwner) : mMutex("CompositorVsyncScheduler.Observer.Mutex"), mOwner(aOwner) {} diff --git a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp index 6e2ebfcafd43..f69b8c6550e9 100644 --- a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp +++ b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp @@ -42,14 +42,12 @@ # include "ProfilerMarkerPayload.h" #endif -using namespace std; - namespace mozilla { namespace layers { // defined in CompositorBridgeParent.cpp -typedef map LayerTreeMap; +typedef std::map LayerTreeMap; extern LayerTreeMap sIndirectLayerTrees; extern StaticAutoPtr sIndirectLayerTreesLock; void UpdateIndirectTree(LayersId aId, Layer* aRoot, diff --git a/gfx/layers/mlgpu/LayerManagerMLGPU.cpp b/gfx/layers/mlgpu/LayerManagerMLGPU.cpp index 0d5d00aa2f70..830d67099a61 100644 --- a/gfx/layers/mlgpu/LayerManagerMLGPU.cpp +++ b/gfx/layers/mlgpu/LayerManagerMLGPU.cpp @@ -32,8 +32,6 @@ # include "mozilla/gfx/DeviceManagerDx.h" #endif -using namespace std; - namespace mozilla { namespace layers { diff --git a/gfx/layers/mlgpu/SharedBufferMLGPU.cpp b/gfx/layers/mlgpu/SharedBufferMLGPU.cpp index bd485653af0b..b6c9978c8054 100644 --- a/gfx/layers/mlgpu/SharedBufferMLGPU.cpp +++ b/gfx/layers/mlgpu/SharedBufferMLGPU.cpp @@ -8,8 +8,6 @@ #include "BufferCache.h" #include "MLGDevice.h" -using namespace std; - namespace mozilla { namespace layers { diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index e38a9439bd6b..0e0c1eed933b 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -62,7 +62,6 @@ namespace mozilla { -using namespace std; using namespace gfx; namespace layers { diff --git a/gfx/layers/opengl/OGLShaderProgram.cpp b/gfx/layers/opengl/OGLShaderProgram.cpp index f89bf4279d95..1fb7af804fe2 100644 --- a/gfx/layers/opengl/OGLShaderProgram.cpp +++ b/gfx/layers/opengl/OGLShaderProgram.cpp @@ -7,7 +7,7 @@ #include "OGLShaderProgram.h" #include // for uint32_t -#include // for ostringstream +#include // for std::ostringstream #include "gfxEnv.h" #include "gfxRect.h" // for gfxRect #include "gfxUtils.h" @@ -21,7 +21,7 @@ namespace mozilla { namespace layers { -using namespace std; +using std::endl; #define GAUSSIAN_KERNEL_HALF_WIDTH 11 #define GAUSSIAN_KERNEL_STEP 0.2 @@ -157,7 +157,7 @@ void ShaderConfigOGL::SetDynamicGeometry(bool aEnabled) { /* static */ ProgramProfileOGL ProgramProfileOGL::GetProfileFor(ShaderConfigOGL aConfig) { ProgramProfileOGL result; - ostringstream fs, vs; + std::ostringstream fs, vs; AddUniforms(result); @@ -854,7 +854,7 @@ bool ShaderProgramOGL::Initialize() { NS_ASSERTION(mProgramState == STATE_NEW, "Shader program has already been initialised"); - ostringstream vs, fs; + std::ostringstream vs, fs; for (uint32_t i = 0; i < mProfile.mDefines.Length(); ++i) { vs << mProfile.mDefines[i] << endl; fs << mProfile.mDefines[i] << endl;