From ca162bee2055514fc610c6e0506d60b4f858214d Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Wed, 28 Nov 2018 09:16:55 +0000 Subject: [PATCH] Bug 1508472 - Part 4: Fourth batch of comment fix-ups in preparation for the tree reformat r=sylvestre This is a best effort attempt at ensuring that the adverse impact of reformatting the entire tree over the comments would be minimal. I've used a combination of strategies including disabling of formatting, some manual formatting and some changes to formatting to work around some clang-format limitations. Differential Revision: https://phabricator.services.mozilla.com/D13193 --HG-- extra : moz-landing-system : lando --- gfx/gl/GLContextSymbols.h | 2 +- gfx/gl/GLContextTypes.cpp | 2 +- gfx/gl/GLScreenBuffer.cpp | 2 +- gfx/gl/GLScreenBuffer.h | 2 +- gfx/gl/GLTextureImage.cpp | 2 +- gfx/gl/GLTextureImage.h | 2 +- gfx/gl/GLUploadHelpers.cpp | 2 +- gfx/gl/GLUploadHelpers.h | 2 +- gfx/gl/MozFramebuffer.cpp | 2 +- gfx/gl/MozFramebuffer.h | 2 +- gfx/gl/SharedSurface.cpp | 2 +- gfx/gl/SharedSurface.h | 2 +- gfx/gl/SharedSurfaceANGLE.cpp | 2 +- gfx/gl/SharedSurfaceANGLE.h | 2 +- gfx/gl/SharedSurfaceD3D11Interop.cpp | 28 ++++---- gfx/gl/SharedSurfaceD3D11Interop.h | 2 +- gfx/gl/SharedSurfaceEGL.cpp | 2 +- gfx/gl/SharedSurfaceEGL.h | 2 +- gfx/gl/SharedSurfaceGL.cpp | 2 +- gfx/gl/SharedSurfaceGL.h | 2 +- gfx/gl/SharedSurfaceGLX.cpp | 2 +- gfx/gl/SharedSurfaceGLX.h | 2 +- gfx/gl/SharedSurfaceIO.cpp | 2 +- gfx/gl/SharedSurfaceIO.h | 2 +- gfx/gl/SkiaGLGlue.cpp | 2 +- gfx/gl/SkiaGLGlue.h | 2 +- gfx/gl/SurfaceTypes.cpp | 2 +- gfx/gl/SurfaceTypes.h | 2 +- gfx/gl/WGLLibrary.h | 9 ++- gfx/layers/Layers.cpp | 24 ++++--- gfx/layers/Layers.h | 18 +++-- gfx/layers/TextureSync.cpp | 7 +- gfx/layers/apz/src/APZCTreeManager.h | 37 ++++++---- gfx/layers/apz/src/Axis.h | 5 +- gfx/layers/apz/src/FocusState.h | 29 ++++---- gfx/layers/apz/src/InputBlockState.h | 5 +- gfx/layers/apz/test/gtest/TestHitTesting.cpp | 12 ++-- .../composite/AsyncCompositionManager.cpp | 19 +++--- gfx/layers/composite/Diagnostics.cpp | 3 +- gfx/layers/composite/FPSCounter.h | 3 +- gfx/layers/composite/LayerManagerComposite.h | 19 +++--- gfx/layers/composite/TiledContentHost.cpp | 2 + gfx/layers/ipc/ImageBridgeChild.h | 31 +++++---- .../ipc/UiCompositorControllerMessageTypes.h | 8 ++- gfx/layers/opengl/GLBlitTextureImageHelper.h | 3 +- gfx/layers/wr/ClipManager.cpp | 8 ++- gfx/layers/wr/WebRenderCommandBuilder.cpp | 15 +++-- gfx/src/nsRect.h | 17 +++-- gfx/src/nsRegion.cpp | 6 +- gfx/thebes/gfxASurface.cpp | 3 +- gfx/thebes/gfxAlphaRecovery.h | 17 ++--- gfx/thebes/gfxBlur.h | 6 +- gfx/thebes/gfxCoreTextShaper.cpp | 6 +- gfx/thebes/gfxFont.cpp | 3 +- gfx/thebes/gfxFontUtils.cpp | 3 +- gfx/thebes/gfxLineSegment.h | 4 +- gfx/thebes/gfxPlatform.cpp | 18 +++-- gfx/thebes/gfxPrefs.h | 13 ++-- gfx/thebes/gfxTextRun.cpp | 9 ++- gfx/thebes/gfxTextRun.h | 26 ++++--- gfx/thebes/gfxTypes.h | 5 +- gfx/vr/external_api/moz_external_vr.h | 4 +- .../RenderCompositorANGLE.cpp | 3 +- gfx/webrender_bindings/WebRenderAPI.cpp | 8 ++- image/Decoder.h | 3 +- image/RasterImage.h | 6 +- image/SurfaceCache.h | 4 +- intl/unicharutil/util/nsBidiUtils.h | 27 +++++--- intl/unicharutil/util/nsUnicodeProperties.cpp | 4 ++ ipc/glue/CrossProcessMutex.h | 3 +- ipc/glue/GeckoChildProcessHost.cpp | 3 +- ipc/glue/MessageChannel.cpp | 9 +-- ipc/glue/MessageChannel.h | 13 ++-- js/xpconnect/loader/AutoMemMap.h | 2 +- js/xpconnect/loader/PrecompiledScript.h | 2 +- js/xpconnect/loader/ScriptCacheActors.h | 2 +- js/xpconnect/loader/ScriptPreloader-inl.h | 2 +- js/xpconnect/loader/ScriptPreloader.h | 2 +- js/xpconnect/loader/URLPreloader.h | 2 +- js/xpconnect/wrappers/XrayWrapper.cpp | 12 ++-- media/gmp-clearkey/0.1/WMFH264Decoder.cpp | 3 +- media/webrtc/signaling/src/common/Wrapper.h | 40 ++++++----- .../src/media-conduit/AudioConduit.h | 59 +++++++++------- .../src/media-conduit/MediaConduitInterface.h | 67 +++++++++++-------- .../src/media-conduit/VideoConduit.h | 14 ++-- .../signaling/src/mediapipeline/RtpLogger.h | 3 +- .../src/peerconnection/PeerConnectionCtx.cpp | 3 +- .../src/peerconnection/PeerConnectionImpl.cpp | 3 +- mfbt/Attributes.h | 63 ++++++++--------- mfbt/Move.h | 3 +- mfbt/Span.h | 7 +- mfbt/ThreadSafeWeakPtr.h | 3 +- mfbt/WrappingOperations.h | 12 ++-- 93 files changed, 520 insertions(+), 346 deletions(-) diff --git a/gfx/gl/GLContextSymbols.h b/gfx/gl/GLContextSymbols.h index 415a12abb71a..b1047c02b766 100644 --- a/gfx/gl/GLContextSymbols.h +++ b/gfx/gl/GLContextSymbols.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/GLContextTypes.cpp b/gfx/gl/GLContextTypes.cpp index 2cca59dc96aa..3e4d01a7b50c 100644 --- a/gfx/gl/GLContextTypes.cpp +++ b/gfx/gl/GLContextTypes.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/GLScreenBuffer.cpp b/gfx/gl/GLScreenBuffer.cpp index bffe4891c988..f0c24c478dbd 100644 --- a/gfx/gl/GLScreenBuffer.cpp +++ b/gfx/gl/GLScreenBuffer.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/GLScreenBuffer.h b/gfx/gl/GLScreenBuffer.h index 50961f5e68f1..e1840c5d6c98 100644 --- a/gfx/gl/GLScreenBuffer.h +++ b/gfx/gl/GLScreenBuffer.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index 84726e5934fd..8e6e76d8d343 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/GLTextureImage.h b/gfx/gl/GLTextureImage.h index d7dd78a1ef6f..84818e431efc 100644 --- a/gfx/gl/GLTextureImage.h +++ b/gfx/gl/GLTextureImage.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/GLUploadHelpers.cpp b/gfx/gl/GLUploadHelpers.cpp index a3d2a03e7c11..733e4a53c65b 100644 --- a/gfx/gl/GLUploadHelpers.cpp +++ b/gfx/gl/GLUploadHelpers.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/GLUploadHelpers.h b/gfx/gl/GLUploadHelpers.h index f732d2b3834f..038f11482639 100644 --- a/gfx/gl/GLUploadHelpers.h +++ b/gfx/gl/GLUploadHelpers.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/MozFramebuffer.cpp b/gfx/gl/MozFramebuffer.cpp index 987350a01e2e..a7a1f18c6410 100644 --- a/gfx/gl/MozFramebuffer.cpp +++ b/gfx/gl/MozFramebuffer.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/MozFramebuffer.h b/gfx/gl/MozFramebuffer.h index 20b0cfb19b33..8762c0b54a40 100644 --- a/gfx/gl/MozFramebuffer.h +++ b/gfx/gl/MozFramebuffer.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurface.cpp b/gfx/gl/SharedSurface.cpp index 663c5e823059..735345ddf40b 100644 --- a/gfx/gl/SharedSurface.cpp +++ b/gfx/gl/SharedSurface.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurface.h b/gfx/gl/SharedSurface.h index 01d772f745e0..8ffcebed5edd 100644 --- a/gfx/gl/SharedSurface.h +++ b/gfx/gl/SharedSurface.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceANGLE.cpp b/gfx/gl/SharedSurfaceANGLE.cpp index 9fca7b251d76..bdb9a1849051 100644 --- a/gfx/gl/SharedSurfaceANGLE.cpp +++ b/gfx/gl/SharedSurfaceANGLE.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceANGLE.h b/gfx/gl/SharedSurfaceANGLE.h index 5e7fe32f341a..f4cda993802e 100644 --- a/gfx/gl/SharedSurfaceANGLE.h +++ b/gfx/gl/SharedSurfaceANGLE.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceD3D11Interop.cpp b/gfx/gl/SharedSurfaceD3D11Interop.cpp index cd4c6d8258ec..31b5964c32a3 100644 --- a/gfx/gl/SharedSurfaceD3D11Interop.cpp +++ b/gfx/gl/SharedSurfaceD3D11Interop.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -29,18 +29,20 @@ DXGI_SWAP_CHAIN_DESC scd; -hr = D3D11CreateDeviceAndSwapChain(NULL, // pAdapter - D3D_DRIVER_TYPE_HARDWARE, // DriverType - NULL, // Software - 0, // Flags (Do not set D3D11_CREATE_DEVICE_SINGLETHREADED) - NULL, // pFeatureLevels - 0, // FeatureLevels - D3D11_SDK_VERSION, // SDKVersion - &scd, // pSwapChainDesc - &swapChain, // ppSwapChain - &device, // ppDevice - NULL, // pFeatureLevel - &devCtx); // ppImmediateContext +hr = D3D11CreateDeviceAndSwapChain( + NULL, // pAdapter + D3D_DRIVER_TYPE_HARDWARE, // DriverType + NULL, // Software + 0, // Flags (Do not set + // D3D11_CREATE_DEVICE_SINGLETHREADED) + NULL, // pFeatureLevels + 0, // FeatureLevels + D3D11_SDK_VERSION, // SDKVersion + &scd, // pSwapChainDesc + &swapChain, // ppSwapChain + &device, // ppDevice + NULL, // pFeatureLevel + &devCtx); // ppImmediateContext // Fetch the swapchain backbuffer ID3D11Texture2D *dxColorbuffer; diff --git a/gfx/gl/SharedSurfaceD3D11Interop.h b/gfx/gl/SharedSurfaceD3D11Interop.h index 273fc9efc21e..f9ba806eed03 100644 --- a/gfx/gl/SharedSurfaceD3D11Interop.h +++ b/gfx/gl/SharedSurfaceD3D11Interop.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceEGL.cpp b/gfx/gl/SharedSurfaceEGL.cpp index 5038db44b3b6..b3e014f9d782 100644 --- a/gfx/gl/SharedSurfaceEGL.cpp +++ b/gfx/gl/SharedSurfaceEGL.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceEGL.h b/gfx/gl/SharedSurfaceEGL.h index 5fade4e6d3b2..11f16d2b5fe1 100644 --- a/gfx/gl/SharedSurfaceEGL.h +++ b/gfx/gl/SharedSurfaceEGL.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceGL.cpp b/gfx/gl/SharedSurfaceGL.cpp index a98649dd1253..b98345d8b7c1 100644 --- a/gfx/gl/SharedSurfaceGL.cpp +++ b/gfx/gl/SharedSurfaceGL.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceGL.h b/gfx/gl/SharedSurfaceGL.h index 75744527101b..2435b504d129 100644 --- a/gfx/gl/SharedSurfaceGL.h +++ b/gfx/gl/SharedSurfaceGL.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceGLX.cpp b/gfx/gl/SharedSurfaceGLX.cpp index 2851903bb1c5..ebe2d7062656 100644 --- a/gfx/gl/SharedSurfaceGLX.cpp +++ b/gfx/gl/SharedSurfaceGLX.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceGLX.h b/gfx/gl/SharedSurfaceGLX.h index 19a0338b2674..5e0a5d24d035 100644 --- a/gfx/gl/SharedSurfaceGLX.h +++ b/gfx/gl/SharedSurfaceGLX.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceIO.cpp b/gfx/gl/SharedSurfaceIO.cpp index f13f5755933e..69df62484260 100644 --- a/gfx/gl/SharedSurfaceIO.cpp +++ b/gfx/gl/SharedSurfaceIO.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SharedSurfaceIO.h b/gfx/gl/SharedSurfaceIO.h index 16e0cbbb7f7b..81d4988bf293 100644 --- a/gfx/gl/SharedSurfaceIO.h +++ b/gfx/gl/SharedSurfaceIO.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SkiaGLGlue.cpp b/gfx/gl/SkiaGLGlue.cpp index 84ae52d059dd..4f949a2af1ba 100644 --- a/gfx/gl/SkiaGLGlue.cpp +++ b/gfx/gl/SkiaGLGlue.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SkiaGLGlue.h b/gfx/gl/SkiaGLGlue.h index b3ed9d1c102a..274a58e9fc32 100644 --- a/gfx/gl/SkiaGLGlue.h +++ b/gfx/gl/SkiaGLGlue.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SurfaceTypes.cpp b/gfx/gl/SurfaceTypes.cpp index 9c3e8a2e140f..6143cb3044ae 100644 --- a/gfx/gl/SurfaceTypes.cpp +++ b/gfx/gl/SurfaceTypes.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/SurfaceTypes.h b/gfx/gl/SurfaceTypes.h index fd2f1a65a163..82b6663cd202 100644 --- a/gfx/gl/SurfaceTypes.h +++ b/gfx/gl/SurfaceTypes.h @@ -1,4 +1,4 @@ -/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ +/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/gfx/gl/WGLLibrary.h b/gfx/gl/WGLLibrary.h index 42a4f00d9a89..ac229048311b 100644 --- a/gfx/gl/WGLLibrary.h +++ b/gfx/gl/WGLLibrary.h @@ -66,9 +66,12 @@ public: const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats); - //BOOL (GLAPIENTRY * fGetPixelFormatAttribiv) (HDC hdc, int iPixelFormat, - // int iLayerPlane, UINT nAttributes, - // int* piAttributes, int* piValues); + //BOOL (GLAPIENTRY * fGetPixelFormatAttribiv) (HDC hdc, + // int iPixelFormat, + // int iLayerPlane, + // UINT nAttributes, + // int* piAttributes, + // int* piValues); const char* (GLAPIENTRY * fGetExtensionsStringARB) (HDC hdc); HGLRC (GLAPIENTRY * fCreateContextAttribsARB) (HDC hdc, HGLRC hShareContext, const int* attribList); diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 96a71f8aac1a..9ebc17d53c21 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -1469,17 +1469,19 @@ RefLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs) * To determine availability of the data upon StopFrameTimeRecording: * - mRecording.mNextIndex increases on each RecordFrame, and never resets. * - Cyclic buffer position is realized as mNextIndex % bufferSize. - * - StartFrameTimeRecording returns mNextIndex. When StopFrameTimeRecording is called, - * the required start index is passed as an arg, and we're able to calculate the required - * length. If this length is bigger than bufferSize, it means data was overwritten. - * otherwise, we can return the entire sequence. - * - To determine if we need to pause, mLatestStartIndex is updated to mNextIndex - * on each call to StartFrameTimeRecording. If this index gets overwritten, - * it means that all earlier start indices obtained via StartFrameTimeRecording - * were also overwritten, hence, no point in recording, so pause. - * - mCurrentRunStartIndex indicates the oldest index of the recording after which - * the recording was not paused. If StopFrameTimeRecording is invoked with a start index - * older than this, it means that some frames were not recorded, so data is invalid. + * - StartFrameTimeRecording returns mNextIndex. When StopFrameTimeRecording is + * called, the required start index is passed as an arg, and we're able to + * calculate the required length. If this length is bigger than bufferSize, it + * means data was overwritten. otherwise, we can return the entire sequence. + * - To determine if we need to pause, mLatestStartIndex is updated to + * mNextIndex on each call to StartFrameTimeRecording. If this index gets + * overwritten, it means that all earlier start indices obtained via + * StartFrameTimeRecording were also overwritten, hence, no point in + * recording, so pause. + * - mCurrentRunStartIndex indicates the oldest index of the recording after + * which the recording was not paused. If StopFrameTimeRecording is invoked + * with a start index older than this, it means that some frames were not + * recorded, so data is invalid. */ uint32_t FrameRecorder::StartFrameTimeRecording(int32_t aBufferSize) diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 713fc6b8fb81..e7ba7d0264b2 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -131,12 +131,18 @@ public: * Record (and return) frame-intervals and paint-times for frames which were presented * between calling StartFrameTimeRecording and StopFrameTimeRecording. * - * - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late - * (elements were overwritten since Start), result is considered invalid and hence empty. - * - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent). - * Can be changed (up to 1 hour) via pref: toolkit.framesRecording.bufferSize. - * - Note: the first frame-interval may be longer than expected because last frame - * might have been presented some time before calling StartFrameTimeRecording. + * - Uses a cyclic buffer and serves concurrent consumers, so if Stop is + * called too late + * (elements were overwritten since Start), result is considered invalid + * and hence empty.) + * - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were + * less frequent). + * Can be changed (up to 1 hour) via pref: + * toolkit.framesRecording.bufferSize. + * - Note: the first frame-interval may be longer than expected because last + * frame + * might have been presented some time before calling + * StartFrameTimeRecording. */ /** diff --git a/gfx/layers/TextureSync.cpp b/gfx/layers/TextureSync.cpp index 316f9c2fe2bc..182b739c7d62 100644 --- a/gfx/layers/TextureSync.cpp +++ b/gfx/layers/TextureSync.cpp @@ -89,8 +89,9 @@ WaitForTextureIdsToUnlock(pid_t pid, const Span& textureIds) return false; } - // In case the monitor gets signaled multiple times, each less than kTextureLockTimeout. - // This ensures that the total time we wait is < 2 * kTextureLockTimeout + // In case the monitor gets signaled multiple times, each less than + // kTextureLockTimeout. This ensures that the total time we wait is + // < 2 * kTextureLockTimeout if ((TimeStamp::Now() - start).ToMilliseconds() > (double)kTextureLockTimeout) { return false; } @@ -285,4 +286,4 @@ TextureSync::CleanupForPid(base::ProcessId aProcessId) } // namespace layers -} // namespace mozilla \ No newline at end of file +} // namespace mozilla diff --git a/gfx/layers/apz/src/APZCTreeManager.h b/gfx/layers/apz/src/APZCTreeManager.h index 88e0288f3ce5..5e8d65886d89 100644 --- a/gfx/layers/apz/src/APZCTreeManager.h +++ b/gfx/layers/apz/src/APZCTreeManager.h @@ -121,7 +121,8 @@ struct ScrollThumbData; * Note that the ClearTree function MUST be called when this class is no longer needed; * see the method documentation for details. * - * Behaviour of APZ is controlled by a number of preferences shown \ref APZCPrefs "here". + * Behaviour of APZ is controlled by a number of preferences shown + * \ref APZCPrefs "here". */ class APZCTreeManager : public IAPZCTreeManager , public APZInputBridge { @@ -185,12 +186,13 @@ public: * @param aRootLayerTreeId The layer tree ID of the root layer corresponding * to this APZCTreeManager * @param aRoot The root of the (full) layer tree - * @param aFirstPaintLayersId The layers id of the subtree to which aIsFirstPaint - * applies. - * @param aIsFirstPaint True if the layers update that this is called in response - * to included a first-paint. If this is true, the part of - * the tree that is affected by the first-paint flag is - * indicated by the aFirstPaintLayersId parameter. + * @param aFirstPaintLayersId The layers id of the subtree to which + * aIsFirstPaint applies. + * @param aIsFirstPaint True if the layers update that this is called in + * response to included a first-paint. If this is true, + * the part of the tree that is affected by the + * first-paint flag is indicated by the + * aFirstPaintLayersId parameter. * @param aPaintSequenceNumber The sequence number of the paint that triggered * this layer update. Note that every layer child * process' layer subtree has its own sequence @@ -425,13 +427,20 @@ public: * to the tree manager object as TM. * Here's what happens when C receives a touch-move event: * - C.TrackTouch() calls TM.DispatchScroll() with index = 0. - * - TM.DispatchScroll() calls B.AttemptScroll() (since B is at index 0 in the chain). - * - B.AttemptScroll() scrolls B. If there is overscroll, it calls TM.DispatchScroll() with index = 1. - * - TM.DispatchScroll() calls C.AttemptScroll() (since C is at index 1 in the chain) - * - C.AttemptScroll() scrolls C. If there is overscroll, it calls TM.DispatchScroll() with index = 2. - * - TM.DispatchScroll() calls A.AttemptScroll() (since A is at index 2 in the chain) - * - A.AttemptScroll() scrolls A. If there is overscroll, it calls TM.DispatchScroll() with index = 3. - * - TM.DispatchScroll() discards the rest of the scroll as there are no more elements in the chain. + * - TM.DispatchScroll() calls B.AttemptScroll() (since B is at index 0 in + * the chain). + * - B.AttemptScroll() scrolls B. If there is overscroll, it calls + * TM.DispatchScroll() with index = 1. + * - TM.DispatchScroll() calls C.AttemptScroll() (since C is at index 1 in + * the chain) + * - C.AttemptScroll() scrolls C. If there is overscroll, it calls + * TM.DispatchScroll() with index = 2. + * - TM.DispatchScroll() calls A.AttemptScroll() (since A is at index 2 in + * the chain) + * - A.AttemptScroll() scrolls A. If there is overscroll, it calls + * TM.DispatchScroll() with index = 3. + * - TM.DispatchScroll() discards the rest of the scroll as there are no + * more elements in the chain. * * Note: this should be used for panning only. For handing off overscroll for * a fling, use DispatchFling(). diff --git a/gfx/layers/apz/src/Axis.h b/gfx/layers/apz/src/Axis.h index cb30cd5b89eb..7da97eff310f 100644 --- a/gfx/layers/apz/src/Axis.h +++ b/gfx/layers/apz/src/Axis.h @@ -255,8 +255,9 @@ public: * relative. * * Note: Unlike most other functions in Axis, this functions operates in - * CSS coordinates so there is no confusion as to whether the ParentLayer - * coordinates it operates in are before or after the scale is applied. + * CSS coordinates so there is no confusion as to whether the + * ParentLayer coordinates it operates in are before or after the scale + * is applied. */ CSSCoord ScaleWillOverscrollAmount(float aScale, CSSCoord aFocus) const; diff --git a/gfx/layers/apz/src/FocusState.h b/gfx/layers/apz/src/FocusState.h index 7066fe512f02..bfdd78d3b1cc 100644 --- a/gfx/layers/apz/src/FocusState.h +++ b/gfx/layers/apz/src/FocusState.h @@ -18,17 +18,17 @@ namespace mozilla { namespace layers { /** - * This class is used for tracking chrome and content focus targets and calculating - * global focus information from them for use by APZCTreeManager for async keyboard - * scrolling. + * This class is used for tracking chrome and content focus targets and + * calculating global focus information from them for use by APZCTreeManager + * for async keyboard scrolling. * * # Calculating the element to scroll * - * Chrome and content processes have independently focused elements. This makes it - * difficult to calculate the global focused element and its scrollable frame from - * the chrome or content side. So instead we send the local focus information from - * each process to here and then calculate the global focus information. This - * local information resides in a `focus target`. + * Chrome and content processes have independently focused elements. This makes + * it difficult to calculate the global focused element and its scrollable + * frame from the chrome or content side. So instead we send the local focus + * information from each process to here and then calculate the global focus + * information. This local information resides in a `focus target`. * * A focus target indicates that either: * 1. The focused element is a remote browser along with its layer tree ID @@ -54,12 +54,13 @@ namespace layers { * here is that `setTimeout` and others are already non-deterministic and so it * might not be as breaking to web content. * - * To maintain deterministic focus changes for a given stream of user inputs, we - * invalidate our focus state whenever we receive a user input that may trigger - * event listeners. We then attach a new sequence number to these events and - * dispatch them to content. Content will then include the latest sequence number - * it has processed to every focus update. Using this we can determine whether - * any potentially focus changing events have yet to be handled by content. + * To maintain deterministic focus changes for a given stream of user inputs, + * we invalidate our focus state whenever we receive a user input that may + * trigger event listeners. We then attach a new sequence number to these + * events and dispatch them to content. Content will then include the latest + * sequence number it has processed to every focus update. Using this we can + * determine whether any potentially focus changing events have yet to be + * handled by content. * * Once we have received the latest focus sequence number from content, we know * that all event listeners triggered by user inputs, and their resulting focus diff --git a/gfx/layers/apz/src/InputBlockState.h b/gfx/layers/apz/src/InputBlockState.h index b01545470f2b..ece7aa4212a4 100644 --- a/gfx/layers/apz/src/InputBlockState.h +++ b/gfx/layers/apz/src/InputBlockState.h @@ -465,8 +465,9 @@ public: */ bool TouchActionAllowsDoubleTapZoom() const; /** - * @return false iff touch-action is enabled and the allowed touch behaviors for - * the first touch point do not allow panning in the specified direction(s). + * @return false iff touch-action is enabled and the allowed touch behaviors + * for the first touch point do not allow panning in the specified + * direction(s). */ bool TouchActionAllowsPanningX() const; bool TouchActionAllowsPanningY() const; diff --git a/gfx/layers/apz/test/gtest/TestHitTesting.cpp b/gfx/layers/apz/test/gtest/TestHitTesting.cpp index c084ca8ffbb5..024f8e8fcace 100644 --- a/gfx/layers/apz/test/gtest/TestHitTesting.cpp +++ b/gfx/layers/apz/test/gtest/TestHitTesting.cpp @@ -180,10 +180,14 @@ TEST_F(APZHitTestingTester, HitTesting2) { manager->UpdateHitTestingTree(LayersId{0}, root, false, LayersId{0}, 0); // At this point, the following holds (all coordinates in screen pixels): - // layers[0] has content from (0,0)-(200,200), clipped by composition bounds (0,0)-(100,100) - // layers[1] has content from (10,10)-(90,90), clipped by composition bounds (10,10)-(50,50) - // layers[2] has content from (20,60)-(100,100). no clipping as it's not a scrollable layer - // layers[3] has content from (20,60)-(180,140), clipped by composition bounds (20,60)-(100,100) + // layers[0] has content from (0,0)-(200,200), clipped by composition bounds + // (0,0)-(100,100) + // layers[1] has content from (10,10)-(90,90), clipped by composition bounds + // (10,10)-(50,50) + // layers[2] has content from (20,60)-(100,100). no clipping as it's not a + // scrollable layer + // layers[3] has content from (20,60)-(180,140), clipped by composition + // bounds (20,60)-(100,100) RefPtr apzcroot = ApzcOf(root); TestAsyncPanZoomController* apzc1 = ApzcOf(layers[1]); diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 754a84cfb877..08822181a0a6 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -936,17 +936,20 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer, ScreenMargin fixedLayerMargins; // Each layer has multiple clips: - // - Its local clip, which is fixed to the layer contents, i.e. it moves - // with those async transforms which the layer contents move with. + // - Its local clip, which is fixed to the layer contents, i.e. it + // moves with those async transforms which the layer contents move + // with. // - Its scrolled clip, which moves with all async transforms. - // - For each ScrollMetadata on the layer, a scroll clip. This includes - // the composition bounds and any other clips induced by layout. This - // moves with async transforms from ScrollMetadatas above it. - // In this function, these clips are combined into two shadow clip parts: + // - For each ScrollMetadata on the layer, a scroll clip. This + // includes the composition bounds and any other clips induced by + // layout. This moves with async transforms from ScrollMetadatas + // above it. + // In this function, these clips are combined into two shadow clip + // parts: // - The fixed clip, which consists of the local clip only, initially // transformed by all async transforms. - // - The scrolled clip, which consists of the other clips, transformed by - // the appropriate transforms. + // - The scrolled clip, which consists of the other clips, transformed + // by the appropriate transforms. // These two parts are kept separate for now, because for fixed layers, we // need to adjust the fixed clip (to cancel out some async transforms). // The parts are kept in a cache which is cleared at the beginning of every diff --git a/gfx/layers/composite/Diagnostics.cpp b/gfx/layers/composite/Diagnostics.cpp index b81bcd87c035..a7763fc565be 100644 --- a/gfx/layers/composite/Diagnostics.cpp +++ b/gfx/layers/composite/Diagnostics.cpp @@ -79,7 +79,8 @@ Diagnostics::GetFrameOverlayString(const GPUStats& aStats) // R = ClientLayerManager::EndTransaction // CP = ShadowLayerForwarder::EndTransaction (txn build) // TX = LayerTransactionChild::SendUpdate (IPDL serialize+send) - // UP = LayerTransactionParent::RecvUpdate (IPDL deserialize, update, APZ update) + // UP = LayerTransactionParent::RecvUpdate (IPDL deserialize, update, APZ + // update) // CC_BUILD = Container prepare/composite frame building // CC_EXEC = Container render/composite drawing nsPrintfCString line1("FPS: %d (TXN: %d)", fps, txnFps); diff --git a/gfx/layers/composite/FPSCounter.h b/gfx/layers/composite/FPSCounter.h index 2697c6eca451..7014075e765d 100644 --- a/gfx/layers/composite/FPSCounter.h +++ b/gfx/layers/composite/FPSCounter.h @@ -38,7 +38,8 @@ const int kMaxFrames = 2400; * absolute frame composite times to a file on the device. * The FPS counters displayed on screen are based on how many frames we * composited within the last ~1 second. The more accurate measurement is to - * grab the histogram from stderr or grab the FPS timestamp dumps written to file. + * grab the histogram from stderr or grab the FPS timestamp dumps written to + * file. * * To enable dumping to file, enable * layers.acceleration.draw-fps.write-to-file pref. diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index bc35cade325b..44f849f1ec88 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -322,21 +322,22 @@ public: /** * Post-processes layers before composition. This performs the following: * - * - Applies occlusion culling. This restricts the shadow visible region - * of layers that are covered with opaque content. - * |aOpaqueRegion| is the region already known to be covered with opaque - * content, in the post-transform coordinate space of aLayer. + * - Applies occlusion culling. This restricts the shadow visible region of + * layers that are covered with opaque content. |aOpaqueRegion| is the + * region already known to be covered with opaque content, in the + * post-transform coordinate space of aLayer. * * - Recomputes visible regions to account for async transforms. * Each layer accumulates into |aVisibleRegion| its post-transform * (including async transforms) visible region. * - * - aRenderTargetClip is the exact clip required for aLayer, in the coordinates - * of the nearest render target (the same as GetEffectiveTransform). + * - aRenderTargetClip is the exact clip required for aLayer, in the + * coordinates of the nearest render target (the same as + * GetEffectiveTransform). * - * - aClipFromAncestors is the approximate combined clip from all ancestors, in - * the coordinate space of our parent, but maybe be an overestimate in the - * presence of complex transforms. + * - aClipFromAncestors is the approximate combined clip from all + * ancestors, in the coordinate space of our parent, but maybe be an + * overestimate in the presence of complex transforms. */ void PostProcessLayers(nsIntRegion& aOpaqueRegion); void PostProcessLayers(Layer* aLayer, diff --git a/gfx/layers/composite/TiledContentHost.cpp b/gfx/layers/composite/TiledContentHost.cpp index 25b30413b3f6..af0a2690cdb6 100644 --- a/gfx/layers/composite/TiledContentHost.cpp +++ b/gfx/layers/composite/TiledContentHost.cpp @@ -11,7 +11,9 @@ #include "mozilla/gfx/Matrix.h" // for Matrix4x4 #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/layers/Compositor.h" // for Compositor +// clang-format off //#include "mozilla/layers/CompositorBridgeParent.h" // for CompositorBridgeParent +// clang-format on #include "mozilla/layers/Effects.h" // for TexturedEffect, Effect, etc #include "mozilla/layers/LayerMetricsWrapper.h" // for LayerMetricsWrapper #include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL diff --git a/gfx/layers/ipc/ImageBridgeChild.h b/gfx/layers/ipc/ImageBridgeChild.h index 2898a90a2af9..f6b980ea5c22 100644 --- a/gfx/layers/ipc/ImageBridgeChild.h +++ b/gfx/layers/ipc/ImageBridgeChild.h @@ -79,26 +79,29 @@ bool InImageBridgeChildThread(); * - When an ImageContainer calls its method SetCurrentImage: * - (A) The image is sent directly to the compositor process through the * ImageBridge IPDL protocol. - * On the compositor side the image is stored in a global table that associates - * the image with an ID corresponding to the ImageContainer, and a composition is - * triggered. + * On the compositor side the image is stored in a global table that + * associates the image with an ID corresponding to the ImageContainer, and a + * composition is triggered. * - (B) Since it does not have an ImageBridge, the image is not sent yet. - * instead the will be sent to the compositor during the next layer transaction - * (on the main thread). + * instead the will be sent to the compositor during the next layer + * transaction (on the main thread). * * - During a Layer transaction: - * - (A) The ImageContainer uses ImageBridge. The image is already available to the - * compositor process because it has been sent with SetCurrentImage. Yet, the - * CompositableHost on the compositor side will needs the ID referring to the - * ImageContainer to access the Image. So during the Swap operation that happens - * in the transaction, we swap the container ID rather than the image data. - * - (B) Since the ImageContainer does not use ImageBridge, the image data is swaped. + * - (A) The ImageContainer uses ImageBridge. The image is already available + * to the compositor process because it has been sent with SetCurrentImage. + * Yet, the CompositableHost on the compositor side will needs the ID + * referring to the ImageContainer to access the Image. So during the Swap + * operation that happens in the transaction, we swap the container ID rather + * than the image data. + * - (B) Since the ImageContainer does not use ImageBridge, the image data is + * swaped. * * - During composition: * - (A) The CompositableHost has an AsyncID, it looks up the ID in the - * global table to see if there is an image. If there is no image, nothing is rendered. - * - (B) The CompositableHost has image data rather than an ID (meaning it is not - * using ImageBridge), then it just composites the image data normally. + * global table to see if there is an image. If there is no image, nothing is + * rendered. + * - (B) The CompositableHost has image data rather than an ID (meaning it is + * not using ImageBridge), then it just composites the image data normally. * * This means that there might be a possibility for the ImageBridge to send the first * frame before the first layer transaction that will pass the container ID to the diff --git a/gfx/layers/ipc/UiCompositorControllerMessageTypes.h b/gfx/layers/ipc/UiCompositorControllerMessageTypes.h index 3335cec9e98c..c77a168f305a 100644 --- a/gfx/layers/ipc/UiCompositorControllerMessageTypes.h +++ b/gfx/layers/ipc/UiCompositorControllerMessageTypes.h @@ -11,10 +11,13 @@ namespace mozilla { namespace layers { // -// NOTE: These values are also defined in mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/LayerView.java -// and must be kept in sync. Any new message added here must also be added there to the AnimatorMessageType enum. +// NOTE: These values are also defined in +// mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/LayerView.java +// and must be kept in sync. Any new message added here must also be added +// there to the AnimatorMessageType enum. // +// clang-format off enum UiCompositorControllerMessageTypes { STATIC_TOOLBAR_NEEDS_UPDATE = 0, // Sent from compositor when the static toolbar wants to hide. STATIC_TOOLBAR_READY = 1, // Sent from compositor when the static toolbar image has been updated and is ready to animate. @@ -31,6 +34,7 @@ enum UiCompositorControllerMessageTypes { COMPOSITOR_CONTROLLER_OPEN = 20, // Compositor controller IPC is open IS_COMPOSITOR_CONTROLLER_OPEN = 21 // Special message sent from controller to query if the compositor controller is open }; +// clang-format on } // namespace layers } // namespace mozilla diff --git a/gfx/layers/opengl/GLBlitTextureImageHelper.h b/gfx/layers/opengl/GLBlitTextureImageHelper.h index 7af3a0906f29..fd469aed44cc 100644 --- a/gfx/layers/opengl/GLBlitTextureImageHelper.h +++ b/gfx/layers/opengl/GLBlitTextureImageHelper.h @@ -56,7 +56,8 @@ public: * - viewport * - blend state (will be enabled at end) * - scissor state (will be enabled at end) - * - vertex attrib 0 and 1 (pointer and enable state [enable state will be disabled at exit]) + * - vertex attrib 0 and 1 (pointer and enable state [enable state will + * be disabled at exit]) * - array buffer binding (will be 0) * - active texture (will be 0) * - texture 0 binding diff --git a/gfx/layers/wr/ClipManager.cpp b/gfx/layers/wr/ClipManager.cpp index 7ba6fd818cd8..e61a57cca5e5 100644 --- a/gfx/layers/wr/ClipManager.cpp +++ b/gfx/layers/wr/ClipManager.cpp @@ -17,8 +17,12 @@ #include "UnitTransforms.h" #define CLIP_LOG(...) -//#define CLIP_LOG(...) printf_stderr("CLIP: " __VA_ARGS__) -//#define CLIP_LOG(...) if (XRE_IsContentProcess()) printf_stderr("CLIP: " __VA_ARGS__) +/* +#define CLIP_LOG(...) printf_stderr("CLIP: " __VA_ARGS__) +#define CLIP_LOG(...) if (XRE_IsContentProcess()) { \ + printf_stderr("CLIP: " __VA_ARGS__) \ + } +*/ namespace mozilla { namespace layers { diff --git a/gfx/layers/wr/WebRenderCommandBuilder.cpp b/gfx/layers/wr/WebRenderCommandBuilder.cpp index 91bc7ab8f644..296c993d0448 100644 --- a/gfx/layers/wr/WebRenderCommandBuilder.cpp +++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp @@ -285,7 +285,8 @@ UpdateContainerLayerPropertiesAndDetectChange(nsDisplayItem* aItem, BlobItemData if (changed) { std::stringstream ss; //ss << trans << ' ' << aData->mTransform; - //GP("UpdateContainerLayerPropertiesAndDetectChange Matrix %d %s\n", changed, ss.str().c_str()); + //GP("UpdateContainerLayerPropertiesAndDetectChange Matrix %d %s\n", + // changed, ss.str().c_str()); } aData->mTransform = trans; @@ -437,9 +438,13 @@ struct DIGroup UniquePtr geometry(aItem->AllocateGeometry(aBuilder)); /* Instead of doing this dance, let's just invalidate the old rect and the * new rect. - combined = aData->mClip.ApplyNonRoundedIntersection(aData->mGeometry->ComputeInvalidationRegion()); + combined = + aData->mClip.ApplyNonRoundedIntersection( + aData->mGeometry->ComputeInvalidationRegion()); combined.MoveBy(shift); - combined.Or(combined, clip.ApplyNonRoundedIntersection(geometry->ComputeInvalidationRegion())); + combined.Or(combined, + clip.ApplyNonRoundedIntersection( + geometry->ComputeInvalidationRegion())); aData->mGeometry = std::move(geometry); */ combined = clip.ApplyNonRoundedIntersection(geometry->ComputeInvalidationRegion()); @@ -678,7 +683,9 @@ struct DIGroup PaintItemRange(aGrouper, aStartItem, aEndItem, context, recorder); - // XXX: set this correctly perhaps using aItem->GetOpaqueRegion(aDisplayListBuilder, &snapped).Contains(paintBounds);? + // XXX: set this correctly perhaps using + // aItem->GetOpaqueRegion(aDisplayListBuilder, &snapped). + // Contains(paintBounds);? wr::OpacityType opacity = wr::OpacityType::HasAlphaChannel; TakeExternalSurfaces(recorder, mExternalSurfaces, aWrManager, aResources); diff --git a/gfx/src/nsRect.h b/gfx/src/nsRect.h index 55120b62b8de..085542739489 100644 --- a/gfx/src/nsRect.h +++ b/gfx/src/nsRect.h @@ -142,8 +142,10 @@ struct nsRect : __m128i resultRect = _mm_max_epi32(rect1, rect2); // xr, yr, zz, zz - // result.width = std::min(x - result.x + width, aRect.x - result.x + aRect.width); - // result.height = std::min(y - result.y + height, aRect.y - result.y + aRect.height); + // result.width = std::min(x - result.x + width, + // aRect.x - result.x + aRect.width); + // result.height = std::min(y - result.y + height, + // aRect.y - result.y + aRect.height); __m128i widthheight = _mm_min_epi32(_mm_add_epi32(_mm_sub_epi32(rect1, resultRect), _mm_srli_si128(rect1, 8)), _mm_add_epi32(_mm_sub_epi32(rect2, resultRect), _mm_srli_si128(rect2, 8))); // w, h, zz, zz widthheight = _mm_slli_si128(widthheight, 8); // 00, 00, wr, hr @@ -178,8 +180,10 @@ struct nsRect : __m128i rect2 = _mm_loadu_si128((__m128i*)&aRect2); // x2, y2, w2, h2 __m128i resultRect = _mm_max_epi32(rect1, rect2); // xr, yr, zz, zz - // result.width = std::min(x - result.x + width, aRect.x - result.x + aRect.width); - // result.height = std::min(y - result.y + height, aRect.y - result.y + aRect.height); + // result.width = std::min(x - result.x + width, + // aRect.x - result.x + aRect.width); + // result.height = std::min(y - result.y + height, + // aRect.y - result.y + aRect.height); __m128i widthheight = _mm_min_epi32(_mm_add_epi32(_mm_sub_epi32(rect1, resultRect), _mm_srli_si128(rect1, 8)), _mm_add_epi32(_mm_sub_epi32(rect2, resultRect), _mm_srli_si128(rect2, 8))); // w, h, zz, zz widthheight = _mm_slli_si128(widthheight, 8); // 00, 00, wr, hr @@ -395,7 +399,8 @@ nsRect::ScaleToOutsidePixels(float aXScale, float aYScale, __m128 rectFloat = _mm_cvtepi32_ps(rectPacked); - // Scale i.e. ([ x y xmost ymost ] / aAppUnitsPerPixel) * [ aXScale aYScale aXScale aYScale ] + // Scale i.e. ([ x y xmost ymost ] / aAppUnitsPerPixel) * + // [ aXScale aYScale aXScale aYScale ] rectFloat = _mm_mul_ps(_mm_div_ps(rectFloat, appUnitsPacked), scalesPacked); rectPacked = ceil_ps2epi32(rectFloat); // xx, xx, XMost(), YMost() __m128i tmp = floor_ps2epi32(rectFloat); // x, y, xx, xx @@ -409,7 +414,9 @@ nsRect::ScaleToOutsidePixels(float aXScale, float aYScale, // Avoid negative width/height due to overflow. __m128i mask = _mm_or_si128(_mm_cmpgt_epi32(rectPacked, _mm_setzero_si128()), _mm_set_epi32(0, 0, 0xFFFFFFFF, 0xFFFFFFFF)); + // clang-format off // Mask will now contain [ 0xFFFFFFFF 0xFFFFFFFF (width <= 0 ? 0 : 0xFFFFFFFF) (height <= 0 ? 0 : 0xFFFFFFFF) ] + // clang-format on rectPacked = _mm_and_si128(rectPacked, mask); _mm_storeu_si128((__m128i*)&rect, rectPacked); diff --git a/gfx/src/nsRegion.cpp b/gfx/src/nsRegion.cpp index 037e17a553d6..5fd522efbd2a 100644 --- a/gfx/src/nsRegion.cpp +++ b/gfx/src/nsRegion.cpp @@ -341,7 +341,8 @@ void nsRegion::VisitEdges (visit_fn visit, void *closure) const // a change away from 0. int lastX = std::min(topStrip->left, bottomStrip->left) - 1; - // Current edge being considered for top and bottom, 0 - left, 1 - right. + // Current edge being considered for top and bottom, + // 0 - left, 1 - right. bool topEdgeIsLeft = true; bool bottomEdgeIsLeft = true; while (topStrip != std::end(topBand.mStrips) && bottomStrip != std::end(bottomBand.mStrips)) { @@ -728,7 +729,8 @@ nsIntRegion nsRegion::ScaleToInsidePixels (float aScaleX, float aScaleY, // S = array(m+1,n+1) // S[0][i] = 0 for i in [0,n] // S[j][0] = 0 for j in [0,m] -// S[j][i] = (if A[j-1][i-1] = 0 then some large negative value else A[j-1][i-1]) +// S[j][i] = (if A[j-1][i-1] = 0 then some large negative value +// else A[j-1][i-1]) // + S[j-1][n] + S[j][i-1] - S[j-1][i-1] // // // top, bottom, left, right, area diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp index b3e2f423ed29..08d6d8b785df 100644 --- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -113,7 +113,8 @@ gfxASurface::Release(void) void gfxASurface::SurfaceDestroyFunc(void *data) { gfxASurface *surf = (gfxASurface*) data; - // fprintf (stderr, "Deleting wrapper for %p (wrapper: %p)\n", surf->mSurface, data); + // fprintf (stderr, "Deleting wrapper for %p (wrapper: %p)\n", surf->mSurface, + // data); delete surf; } diff --git a/gfx/thebes/gfxAlphaRecovery.h b/gfx/thebes/gfxAlphaRecovery.h index 9fed1681e954..f46e15f98663 100644 --- a/gfx/thebes/gfxAlphaRecovery.h +++ b/gfx/thebes/gfxAlphaRecovery.h @@ -89,17 +89,18 @@ public: const uint32_t GREEN_MASK = 0x0000FF00; const uint32_t ALPHA_MASK = 0xFF000000; - /* |diff| here is larger when the source image pixel is more transparent. - If both renderings are from the same source image composited with OVER, - then the color values on white will always be greater than those on - black, so |diff| would not overflow. However, overflow may happen, for - example, when a plugin plays a video and the image is rapidly changing. - If there is overflow, then behave as if we limit to the difference to + /* |diff| here is larger when the source image pixel is more + transparent. If both renderings are from the same source image + composited with OVER, then the color values on white will always be + greater than those on black, so |diff| would not overflow. However, + overflow may happen, for example, when a plugin plays a video and + the image is rapidly changing. If there is overflow, then behave as + if we limit to the difference to >= 0, which will make the rendering opaque. (Without this overflow will make the rendering transparent.) */ uint32_t diff = (white & GREEN_MASK) - (black & GREEN_MASK); - /* |diff| is 0xFFFFxx00 on overflow and 0x0000xx00 otherwise, so use this - to limit the transparency. */ + /* |diff| is 0xFFFFxx00 on overflow and 0x0000xx00 otherwise, so use + this to limit the transparency. */ uint32_t limit = diff & ALPHA_MASK; /* The alpha bits of the result */ uint32_t alpha = (ALPHA_MASK - (diff << 16)) | limit; diff --git a/gfx/thebes/gfxBlur.h b/gfx/thebes/gfxBlur.h index c166fd83a758..7dad15e6c034 100644 --- a/gfx/thebes/gfxBlur.h +++ b/gfx/thebes/gfxBlur.h @@ -159,8 +159,10 @@ public: * inset path in device pixels. * @param aBlurRadius The standard deviation of the blur. * @param aShadowColor The color of the blur. - * @param aInnerClipRadii Corner radii for the inside rect if it is a rounded rect. - * @param aSkipRect An area in device pixels we don't have to paint in. + * @param aInnerClipRadii Corner radii for the inside rect if it is a + * rounded rect. + * @param aSkipRect An area in device pixels we don't have to + * paint in. */ void BlurInsetBox(gfxContext* aDestinationCtx, const mozilla::gfx::Rect& aDestinationRect, diff --git a/gfx/thebes/gfxCoreTextShaper.cpp b/gfx/thebes/gfxCoreTextShaper.cpp index ad8f7f3b6c00..1d270f4cafa9 100644 --- a/gfx/thebes/gfxCoreTextShaper.cpp +++ b/gfx/thebes/gfxCoreTextShaper.cpp @@ -252,8 +252,10 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText, // character offsets get really confusing here, as we have to keep track of // (a) the text in the actual textRun we're constructing - // (c) the string that was handed to CoreText, which contains the text of the font run - // (d) the CTRun currently being processed, which may be a sub-run of the CoreText line + // (c) the string that was handed to CoreText, which contains the text of + // the font run + // (d) the CTRun currently being processed, which may be a sub-run of the + // CoreText line // get the source string range within the CTLine's text CFRange stringRange = ::CTRunGetStringRange(aCTRun); diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index 7ed3d03d0474..1d56364048b3 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -3901,7 +3901,8 @@ gfxFont::SanitizeMetrics(gfxFont::Metrics *aMetrics, bool aIsBadUnderlineFont) * However, if this is system font, we should not do this for the rendering compatibility with * another application's UI on the platform. * XXX Should not use this hack if the font size is too small? - * Such text cannot be read, this might be used for tight CSS rendering? (E.g., Acid2) + * Such text cannot be read, this might be used for tight CSS + * rendering? (E.g., Acid2) */ if (!mStyle.systemFont && aIsBadUnderlineFont) { // First, we need 2 pixels between baseline and underline at least. Because many CJK characters diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index ec5fa529eb69..4e44a71bb1c2 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -270,7 +270,8 @@ gfxFontUtils::ReadCMAPTableFormat4(const uint8_t *aBuf, uint32_t aLength, endCount); } } else { - // const uint16_t idDelta = ReadShortAt16(idDeltas, i); // Unused: self-documenting. + // Unused: self-documenting. + // const uint16_t idDelta = ReadShortAt16(idDeltas, i); for (uint32_t c = startCount; c <= endCount; ++c) { if (c == 0xFFFF) break; diff --git a/gfx/thebes/gfxLineSegment.h b/gfx/thebes/gfxLineSegment.h index a217fb309f8f..879f12fb030f 100644 --- a/gfx/thebes/gfxLineSegment.h +++ b/gfx/thebes/gfxLineSegment.h @@ -17,7 +17,9 @@ struct gfxLineSegment { bool PointsOnSameSide(const gfxPoint& aOne, const gfxPoint& aTwo) { - // Solve the equation y - mStart.y - ((mEnd.y - mStart.y)/(mEnd.x - mStart.x))(x - mStart.x) for both points + // Solve the equation + // y - mStart.y - ((mEnd.y - mStart.y)/(mEnd.x - mStart.x))(x - mStart.x) + // for both points gfxFloat deltaY = (mEnd.y - mStart.y); gfxFloat deltaX = (mEnd.x - mStart.x); diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 5404fb47cbd7..1f547c7757fb 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2262,9 +2262,9 @@ gfxPlatform::CreateCMSOutputProfile() /* Determine if we're using the internal override to force sRGB as an output profile for reftests. See Bug 452125. - Note that we don't normally (outside of tests) set a - default value of this preference, which means nsIPrefBranch::GetBoolPref - will typically throw (and leave its out-param untouched). + Note that we don't normally (outside of tests) set a default value + of this preference, which means nsIPrefBranch::GetBoolPref will + typically throw (and leave its out-param untouched). */ if (Preferences::GetBool(GFX_PREF_CMS_FORCE_SRGB, false)) { gCMSOutputProfile = GetCMSsRGBProfile(); @@ -2882,10 +2882,13 @@ gfxPlatform::InitWebRenderConfig() // On Nightly: // WR? WR+ => means WR was enabled via gfx.webrender.all.qualified - // WR! WR+ => means WR was enabled via gfx.webrender.{all,enabled} or envvar + // WR! WR+ => means WR was enabled via gfx.webrender.{all,enabled} or + // envvar // On Beta/Release: - // WR? WR+ => means WR was enabled via gfx.webrender.all.qualified on qualified hardware - // WR! WR+ => means WR was enabled via envvar, possibly on unqualified hardware. + // WR? WR+ => means WR was enabled via gfx.webrender.all.qualified on + // qualified hardware + // WR! WR+ => means WR was enabled via envvar, possibly on unqualified + // hardware. // In all cases WR- means WR was not enabled, for one of many possible reasons. ScopedGfxFeatureReporter reporter("WR", prefEnabled || envvarEnabled); if (!XRE_IsParentProcess()) { @@ -3186,7 +3189,8 @@ gfxPlatform::ContentUsesTiling() const /*** * The preference "layout.frame_rate" has 3 meanings depending on the value: * - * -1 = Auto (default), use hardware vsync or software vsync @ 60 hz if hw vsync fails. + * -1 = Auto (default), use hardware vsync or software vsync @ 60 hz if hw + * vsync fails. * 0 = ASAP mode - used during talos testing. * X = Software vsync at a rate of X times per second. */ diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index cdb792599e8e..8c1e4c34cfd5 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -285,9 +285,11 @@ private: } }; - // This is where DECL_GFX_PREF for each of the preferences should go. - // We will keep these in an alphabetical order to make it easier to see if - // a method accessing a pref already exists. Just add yours in the list. + // clang-format off + + // This is where DECL_GFX_PREF for each of the preferences should go. We + // will keep these in an alphabetical order to make it easier to see if a + // method accessing a pref already exists. Just add yours in the list. DECL_GFX_PREF(Live, "accessibility.browsewithcaret", AccessibilityBrowseWithCaret, bool, false); @@ -814,9 +816,12 @@ private: DECL_GFX_PREF(Live, "widget.window-transforms.disabled", WindowTransformsDisabled, bool, false); // WARNING: - // Please make sure that you've added your new preference to the list above in alphabetical order. + // Please make sure that you've added your new preference to the list above + // in alphabetical order. // Please do not just append it to the end of the list. + // clang-format on + public: // Manage the singleton: static gfxPrefs& GetSingleton() diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index d6540a63d607..33d12b9f4536 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -1129,8 +1129,10 @@ gfxTextRun::BreakAndMeasureText(uint32_t aStart, uint32_t aMaxLength, // There are three possibilities: // 1) all the text fit (width <= aWidth) - // 2) some of the text fit up to a break opportunity (width > aWidth && lastBreak >= 0) - // 3) none of the text fits before a break opportunity (width > aWidth && lastBreak < 0) + // 2) some of the text fit up to a break opportunity (width > aWidth && + // lastBreak >= 0) + // 3) none of the text fits before a break opportunity (width > aWidth && + // lastBreak < 0) uint32_t charsFit; bool usedHyphenation = false; if (width - trimmableAdvance <= aWidth) { @@ -3094,7 +3096,8 @@ gfxFontGroup::FindFontForChar(uint32_t aCh, uint32_t aPrevCh, uint32_t aNextCh, } // 3. use fallback fonts - // -- before searching for something else check the font used for the previous character + // -- before searching for something else check the font used for the + // previous character if (aPrevMatchedFont && aPrevMatchedFont->HasCharacter(aCh)) { *aMatchType = gfxTextRange::MatchType::kSystemFallback; return aPrevMatchedFont; diff --git a/gfx/thebes/gfxTextRun.h b/gfx/thebes/gfxTextRun.h index a97ea401cfa7..25386e49d63b 100644 --- a/gfx/thebes/gfxTextRun.h +++ b/gfx/thebes/gfxTextRun.h @@ -381,18 +381,24 @@ public: * Guarantees the following: * -- 0 <= result <= aMaxLength * -- result is the maximal value of N such that either - * N < aMaxLength && line break at N && GetAdvanceWidth(Range(aStart, N), aProvider) <= aWidth - * OR N < aMaxLength && hyphen break at N && GetAdvanceWidth(Range(aStart, N), aProvider) + GetHyphenWidth() <= aWidth - * OR N == aMaxLength && GetAdvanceWidth(Range(aStart, N), aProvider) <= aWidth + * N < aMaxLength && line break at N && + * GetAdvanceWidth(Range(aStart, N), aProvider) <= aWidth + * OR N < aMaxLength && hyphen break at N && + * GetAdvanceWidth(Range(aStart, N), aProvider) + + * GetHyphenWidth() <= aWidth + * OR N == aMaxLength && + * GetAdvanceWidth(Range(aStart, N), aProvider) <= aWidth * where GetAdvanceWidth assumes the effect of - * SetLineBreaks(Range(aStart, N), aLineBreakBefore, N < aMaxLength, aProvider) + * SetLineBreaks(Range(aStart, N), + * aLineBreakBefore, N < aMaxLength, aProvider) * -- if no such N exists, then result is the smallest N such that * N < aMaxLength && line break at N * OR N < aMaxLength && hyphen break at N * OR N == aMaxLength * * The call has the effect of - * SetLineBreaks(Range(aStart, result), aLineBreakBefore, result < aMaxLength, aProvider) + * SetLineBreaks(Range(aStart, result), aLineBreakBefore, + * result < aMaxLength, aProvider) * and the returned metrics and the invariants above reflect this. * * @param aMaxLength this can be UINT32_MAX, in which case the length used @@ -416,11 +422,15 @@ public: * @param aUsedHyphenation if non-null, records if we selected a hyphenation break * @param aLastBreak if non-null and result is aMaxLength, we set this to * the maximal N such that - * N < aMaxLength && line break at N && GetAdvanceWidth(Range(aStart, N), aProvider) <= aWidth - * OR N < aMaxLength && hyphen break at N && GetAdvanceWidth(Range(aStart, N), aProvider) + GetHyphenWidth() <= aWidth + * N < aMaxLength && line break at N && + * GetAdvanceWidth(Range(aStart, N), aProvider) <= aWidth + * OR N < aMaxLength && hyphen break at N && + * GetAdvanceWidth(Range(aStart, N), aProvider) + + * GetHyphenWidth() <= aWidth * or UINT32_MAX if no such N exists, where GetAdvanceWidth assumes * the effect of - * SetLineBreaks(Range(aStart, N), aLineBreakBefore, N < aMaxLength, aProvider) + * SetLineBreaks(Range(aStart, N), aLineBreakBefore, + * N < aMaxLength, aProvider) * * @param aCanWordWrap true if we can break between any two grapheme * clusters. This is set by overflow-wrap|word-wrap: break-word diff --git a/gfx/thebes/gfxTypes.h b/gfx/thebes/gfxTypes.h index 6702d2dfc7ca..bd0590a44566 100644 --- a/gfx/thebes/gfxTypes.h +++ b/gfx/thebes/gfxTypes.h @@ -24,8 +24,9 @@ typedef double gfxFloat; * * eNoBreak The line has no break opportunities * eWordWrapBreak The line has a break opportunity only within a word. With - * overflow-wrap|word-wrap: break-word we will break at this point only if - * there are no other break opportunities in the line. + * overflow-wrap|word-wrap: break-word we will break at this + * point only if there are no other break opportunities in the + * line. * eNormalBreak The line has a break opportunity determined by the standard * line-breaking algorithm. * diff --git a/gfx/vr/external_api/moz_external_vr.h b/gfx/vr/external_api/moz_external_vr.h index 649b1a73d231..acda40049589 100644 --- a/gfx/vr/external_api/moz_external_vr.h +++ b/gfx/vr/external_api/moz_external_vr.h @@ -276,7 +276,9 @@ struct VRDisplayState uint32_t mMinRestartInterval; char mDisplayName[kVRDisplayNameMaxLen]; // eight byte character code identifier - // LSB first, so "ABCDEFGH" -> ('H'<<56) + ('G'<<48) + ('F'<<40) + ('E'<<32) + ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). + // LSB first, so "ABCDEFGH" -> ('H'<<56) + ('G'<<48) + ('F'<<40) + + // ('E'<<32) + ('D'<<24) + ('C'<<16) + + // ('B'<<8) + 'A'). uint64_t mEightCC; VRDisplayCapabilityFlags mCapabilityFlags; VRFieldOfView mEyeFOV[VRDisplayState::NumEyes]; diff --git a/gfx/webrender_bindings/RenderCompositorANGLE.cpp b/gfx/webrender_bindings/RenderCompositorANGLE.cpp index fd5404f53c94..cb573dcb0ee0 100644 --- a/gfx/webrender_bindings/RenderCompositorANGLE.cpp +++ b/gfx/webrender_bindings/RenderCompositorANGLE.cpp @@ -163,7 +163,8 @@ RenderCompositorANGLE::Initialize() desc.SampleDesc.Count = 1; desc.SampleDesc.Quality = 0; desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; - // Do not use DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, since it makes HWND unreusable. + // Do not use DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, since it makes HWND + // unreusable. //desc.BufferCount = 2; //desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; desc.BufferCount = 1; diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp index 57d9b7a57ed3..38cf26e3d778 100644 --- a/gfx/webrender_bindings/WebRenderAPI.cpp +++ b/gfx/webrender_bindings/WebRenderAPI.cpp @@ -17,8 +17,12 @@ #include "TextDrawTarget.h" #define WRDL_LOG(...) -//#define WRDL_LOG(...) printf_stderr("WRDL(%p): " __VA_ARGS__) -//#define WRDL_LOG(...) if (XRE_IsContentProcess()) printf_stderr("WRDL(%p): " __VA_ARGS__) +/* +#define WRDL_LOG(...) printf_stderr("WRDL(%p): " __VA_ARGS__) +#define WRDL_LOG(...) if (XRE_IsContentProcess()) { \ + printf_stderr("WRDL(%p): " __VA_ARGS__); \ + } +*/ namespace mozilla { namespace wr { diff --git a/image/Decoder.h b/image/Decoder.h index c6300c9700fa..04374a359e8e 100644 --- a/image/Decoder.h +++ b/image/Decoder.h @@ -134,7 +134,8 @@ public: * @return a LexerResult which may indicate: * - the image has been successfully decoded (TerminalState::SUCCESS), or * - the image has failed to decode (TerminalState::FAILURE), or - * - the decoder is yielding until it gets more data (Yield::NEED_MORE_DATA), or + * - the decoder is yielding until it gets more data + * (Yield::NEED_MORE_DATA), or * - the decoder is yielding to allow the caller to access intermediate * output (Yield::OUTPUT_AVAILABLE). */ diff --git a/image/RasterImage.h b/image/RasterImage.h index 832f5bcdc819..56110fe92ed4 100644 --- a/image/RasterImage.h +++ b/image/RasterImage.h @@ -188,9 +188,9 @@ public: * @param aProgress The progress notifications to send. * @param aInvalidRect An invalidation rect to send. * @param aFrameCount If Some(), an updated count of the number of frames of - * animation the decoder has finished decoding so far. This - * is a lower bound for the total number of animation - * frames this image has. + * animation the decoder has finished decoding so far. + * This is a lower bound for the total number of + * animation frames this image has. * @param aDecoderFlags The decoder flags used by the decoder that generated * these notifications, or DefaultDecoderFlags() if the * notifications don't come from a decoder. diff --git a/image/SurfaceCache.h b/image/SurfaceCache.h index c1d2cec37416..25dded7a3e52 100644 --- a/image/SurfaceCache.h +++ b/image/SurfaceCache.h @@ -287,8 +287,8 @@ struct SurfaceCache * need to check the result of Insert() at all. * * @param aProvider The new cache entry to insert into the cache. - * @return SUCCESS if the cache entry was inserted successfully. (But see above - * for more information about when you should check this.) + * @return SUCCESS if the cache entry was inserted successfully. (But see + * above for more information about when you should check this.) * FAILURE if the cache entry could not be inserted, e.g. for capacity * reasons. (But see above for more information about when you * should check this.) diff --git a/intl/unicharutil/util/nsBidiUtils.h b/intl/unicharutil/util/nsBidiUtils.h index 81962acbd971..010d4ccf2c56 100644 --- a/intl/unicharutil/util/nsBidiUtils.h +++ b/intl/unicharutil/util/nsBidiUtils.h @@ -88,27 +88,36 @@ typedef enum nsCharType nsCharType; || ( ( (val) > eCharType_ArabicNumber) && ( (val) != eCharType_RightToLeftArabic) ) ) /** - * Inspects a Unichar, converting numbers to Arabic or Hindi forms and returning them + * Inspects a Unichar, converting numbers to Arabic or Hindi forms and + * returning them * @param aChar is the character - * @param aPrevCharArabic is true if the previous character in the string is an Arabic char + * @param aPrevCharArabic is true if the previous character in the string is + * an Arabic char * @param aNumFlag specifies the conversion to perform: * IBMBIDI_NUMERAL_NOMINAL: don't do any conversion - * IBMBIDI_NUMERAL_HINDI: convert to Hindi forms (Unicode 0660-0669) - * IBMBIDI_NUMERAL_ARABIC: convert to Arabic forms (Unicode 0030-0039) - * IBMBIDI_NUMERAL_HINDICONTEXT: convert numbers in Arabic text to Hindi, otherwise to Arabic + * IBMBIDI_NUMERAL_HINDI: convert to Hindi forms + * (Unicode 0660-0669) + * IBMBIDI_NUMERAL_ARABIC: convert to Arabic forms + * (Unicode 0030-0039) + * IBMBIDI_NUMERAL_HINDICONTEXT: convert numbers in Arabic text to + * Hindi, otherwise to Arabic * @return the converted Unichar */ char16_t HandleNumberInChar(char16_t aChar, bool aPrevCharArabic, uint32_t aNumFlag); /** - * Scan a Unichar string, converting numbers to Arabic or Hindi forms in place + * Scan a Unichar string, converting numbers to Arabic or Hindi forms in + * place * @param aBuffer is the string * @param aSize is the size of aBuffer * @param aNumFlag specifies the conversion to perform: * IBMBIDI_NUMERAL_NOMINAL: don't do any conversion - * IBMBIDI_NUMERAL_HINDI: convert to Hindi forms (Unicode 0660-0669) - * IBMBIDI_NUMERAL_ARABIC: convert to Arabic forms (Unicode 0030-0039) - * IBMBIDI_NUMERAL_HINDICONTEXT: convert numbers in Arabic text to Hindi, otherwise to Arabic + * IBMBIDI_NUMERAL_HINDI: convert to Hindi forms + * (Unicode 0660-0669) + * IBMBIDI_NUMERAL_ARABIC: convert to Arabic forms + * (Unicode 0030-0039) + * IBMBIDI_NUMERAL_HINDICONTEXT: convert numbers in Arabic text to + * Hindi, otherwise to Arabic */ nsresult HandleNumbers(char16_t* aBuffer, uint32_t aSize, uint32_t aNumFlag); diff --git a/intl/unicharutil/util/nsUnicodeProperties.cpp b/intl/unicharutil/util/nsUnicodeProperties.cpp index 171508a2052a..4c4710b1d37b 100644 --- a/intl/unicharutil/util/nsUnicodeProperties.cpp +++ b/intl/unicharutil/util/nsUnicodeProperties.cpp @@ -64,6 +64,7 @@ of values. */ const nsUGenCategory sDetailedToGeneralCategory[] = { + // clang-format off /* * The order here corresponds to the HB_UNICODE_GENERAL_CATEGORY_* constants * of the hb_unicode_general_category_t enum in gfx/harfbuzz/src/hb-unicode.h. @@ -98,9 +99,11 @@ const nsUGenCategory sDetailedToGeneralCategory[] = { /* LINE_SEPARATOR */ nsUGenCategory::kSeparator, /* PARAGRAPH_SEPARATOR */ nsUGenCategory::kSeparator, /* SPACE_SEPARATOR */ nsUGenCategory::kSeparator + // clang-format on }; const hb_unicode_general_category_t sICUtoHBcategory[U_CHAR_CATEGORY_COUNT] = { + // clang-format off HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED, // U_GENERAL_OTHER_TYPES = 0, HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER, // U_UPPERCASE_LETTER = 1, HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER, // U_LOWERCASE_LETTER = 2, @@ -131,6 +134,7 @@ const hb_unicode_general_category_t sICUtoHBcategory[U_CHAR_CATEGORY_COUNT] = { HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL, // U_OTHER_SYMBOL = 27, HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION, // U_INITIAL_PUNCTUATION = 28, HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION, // U_FINAL_PUNCTUATION = 29, + // clang-format on }; #define DEFINE_BMP_1PLANE_MAPPING_GET_FUNC(prefix_) \ diff --git a/ipc/glue/CrossProcessMutex.h b/ipc/glue/CrossProcessMutex.h index 74feabc0fb73..e62d3a129445 100644 --- a/ipc/glue/CrossProcessMutex.h +++ b/ipc/glue/CrossProcessMutex.h @@ -24,7 +24,8 @@ struct ParamTraits; // // Provides: // -// - CrossProcessMutex, a non-recursive mutex that can be shared across processes +// - CrossProcessMutex, a non-recursive mutex that can be shared across +// processes // - CrossProcessMutexAutoLock, an RAII class for ensuring that Mutexes are // properly locked and unlocked // diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index 99a4ee1cb16b..c62bf2127f3b 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -781,7 +781,8 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector aExtraOpts) // "false" == crash reporting disabled childArgv.push_back("false"); } -#elif defined(MOZ_WIDGET_COCOA) // defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) +#elif defined(MOZ_WIDGET_COCOA) /* defined(OS_LINUX) || defined(OS_BSD) || \ + defined(OS_SOLARIS) */ childArgv.push_back(CrashReporter::GetChildNotificationPipe()); #endif // defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) } diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp index d092ab07b3ef..2c833091c2a7 100644 --- a/ipc/glue/MessageChannel.cpp +++ b/ipc/glue/MessageChannel.cpp @@ -1730,8 +1730,9 @@ MessageChannel::Call(Message* aMsg, Message* aReply) // plugin. { NeuteredWindowRegion neuteredRgn(mFlags & REQUIRE_DEFERRED_MESSAGE_PROTECTION); - /* We should pump messages at this point to ensure that the IPC peer - does not become deadlocked on a pending inter-thread SendMessage() */ + /* We should pump messages at this point to ensure that the IPC + peer does not become deadlocked on a pending inter-thread + SendMessage() */ neuteredRgn.PumpOnce(); } #endif @@ -1928,8 +1929,8 @@ MessageChannel::ShouldRunMessage(const Message& aMsg) // 1. child sends a NOT_NESTED sync message S // 2. parent sends a NESTED_INSIDE_SYNC sync message H at the same time // 3. parent times out H - // 4. child starts processing H and sends a NESTED_INSIDE_SYNC message H' nested - // within the same transaction + // 4. child starts processing H and sends a NESTED_INSIDE_SYNC message H' + // nested within the same transaction // 5. parent dispatches S and sends reply // 6. child asserts because it instead expected a reply to H'. // diff --git a/ipc/glue/MessageChannel.h b/ipc/glue/MessageChannel.h index 99385e936cd1..c40c593c409a 100644 --- a/ipc/glue/MessageChannel.h +++ b/ipc/glue/MessageChannel.h @@ -757,12 +757,13 @@ private: // |mRemoteStackDepth|, and races don't matter to the queue.) // // Final case, the other side replied to our most recent out-call |R<|. - // If that was the *only* out-call on our stack, |?{mInterruptStack.size() == 1}|, - // then other side "finished with us," and went back to its own business. - // That business might have included sending any number of async message - // |A<*| until sending a blocking message |(S< | C<)|. If we had more than - // one Interrupt call on our stack, the other side *better* not have sent us - // another blocking message, because it's blocked on a reply from us. + // If that was the *only* out-call on our stack, + // |?{mInterruptStack.size() == 1}|, then other side "finished with us," + // and went back to its own business. That business might have included + // sending any number of async message |A<*| until sending a blocking + // message |(S< | C<)|. If we had more than one Interrupt call on our + // stack, the other side *better* not have sent us another blocking + // message, because it's blocked on a reply from us. // MessageQueue mPending; diff --git a/js/xpconnect/loader/AutoMemMap.h b/js/xpconnect/loader/AutoMemMap.h index 9d1f02255ac2..d7d6eb82d544 100644 --- a/js/xpconnect/loader/AutoMemMap.h +++ b/js/xpconnect/loader/AutoMemMap.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/xpconnect/loader/PrecompiledScript.h b/js/xpconnect/loader/PrecompiledScript.h index 7c07bd850fb4..459ec8828cbd 100644 --- a/js/xpconnect/loader/PrecompiledScript.h +++ b/js/xpconnect/loader/PrecompiledScript.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/xpconnect/loader/ScriptCacheActors.h b/js/xpconnect/loader/ScriptCacheActors.h index 3db95f257a8c..58ddfba12d41 100644 --- a/js/xpconnect/loader/ScriptCacheActors.h +++ b/js/xpconnect/loader/ScriptCacheActors.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/xpconnect/loader/ScriptPreloader-inl.h b/js/xpconnect/loader/ScriptPreloader-inl.h index 427860555b8f..f7f45a31e206 100644 --- a/js/xpconnect/loader/ScriptPreloader-inl.h +++ b/js/xpconnect/loader/ScriptPreloader-inl.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/xpconnect/loader/ScriptPreloader.h b/js/xpconnect/loader/ScriptPreloader.h index 320155053433..2e271091bda0 100644 --- a/js/xpconnect/loader/ScriptPreloader.h +++ b/js/xpconnect/loader/ScriptPreloader.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/xpconnect/loader/URLPreloader.h b/js/xpconnect/loader/URLPreloader.h index 6421e1a9a313..648ef40807f7 100644 --- a/js/xpconnect/loader/URLPreloader.h +++ b/js/xpconnect/loader/URLPreloader.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index f8dde6d0015e..c31d59ced798 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -763,12 +763,14 @@ JSXrayTraits::defineProperty(JSContext* cx, HandleObject wrapper, HandleId id, } - // Object and Array instances are special. For those cases, we forward property - // definitions to the underlying object if the following conditions are met: + // Object and Array instances are special. For those cases, we forward + // property definitions to the underlying object if the following + // conditions are met: // * The property being defined is a value-prop. - // * The property being defined is either a primitive or subsumed by the target. - // * As seen from the Xray, any existing property that we would overwrite is an - // |own| value-prop. + // * The property being defined is either a primitive or subsumed by the + // target. + // * As seen from the Xray, any existing property that we would overwrite + // is an |own| value-prop. // // To avoid confusion, we disallow expandos on Object and Array instances, and // therefore raise an exception here if the above conditions aren't met. diff --git a/media/gmp-clearkey/0.1/WMFH264Decoder.cpp b/media/gmp-clearkey/0.1/WMFH264Decoder.cpp index 63fa9113ba10..e88c823619b6 100644 --- a/media/gmp-clearkey/0.1/WMFH264Decoder.cpp +++ b/media/gmp-clearkey/0.1/WMFH264Decoder.cpp @@ -274,7 +274,8 @@ WMFH264Decoder::GetOutputSample(IMFSample** aOutSample) DWORD status = 0; hr = mDecoder->ProcessOutput(0, 1, &output, &status); - //LOG(L"WMFH264Decoder::GetOutputSample() ProcessOutput returned 0x%x\n", hr); + // LOG(L"WMFH264Decoder::GetOutputSample() ProcessOutput returned 0x%x\n", + // hr); CComPtr events = output.pEvents; // Ensure this is released. if (hr == MF_E_TRANSFORM_STREAM_CHANGE) { diff --git a/media/webrtc/signaling/src/common/Wrapper.h b/media/webrtc/signaling/src/common/Wrapper.h index a88cbd4bf08c..ed86e7be77a1 100644 --- a/media/webrtc/signaling/src/common/Wrapper.h +++ b/media/webrtc/signaling/src/common/Wrapper.h @@ -11,28 +11,38 @@ * (The handle could be a pointer to some low-level type, a conventional C handle, an int ID, a GUID, etc.) * * Usage: - * To obtain a FooPtr from a foo_handle_t, call FooPtr Foo::wrap(foo_handle_t); + * To obtain a FooPtr from a foo_handle_t, call + * FooPtr Foo::wrap(foo_handle_t); * - * To implement Foo using Wrapper, Foo needs to include this macro in its class definition: + * To implement Foo using Wrapper, Foo needs to include this macro in its class + * definition: * CSF_DECLARE_WRAP(Foo, foo_handle_t); - * It also needs to include this in the cpp file, to provide the wrap() implementation and define the static Wrapper. + * It also needs to include this in the cpp file, to provide the wrap() + * implementation and define the static Wrapper. * CSF_IMPLEMENT_WRAP(Foo, foo_handle_t); - * These are all declared in common/Wrapper.h - Foo.h needs to include this too. - * The client needs to declare Foo(foo_handle_t) as private, and provide a suitable implementation, as well as - * implementing wrappers for any other functions to be exposed. + * These are all declared in common/Wrapper.h - Foo.h needs to include this + * too. + * The client needs to declare Foo(foo_handle_t) as private, and provide a + * suitable implementation, as well as implementing wrappers for any other + * functions to be exposed. * The client needs to implement ~Foo() to perform any cleanup as usual. * - * wrap() will always return the same FooPtr for a given foo_handle_t, it will not construct additional objects - * if a suitable one already exists. - * changeHandle() is used in rare cases where the underlying handle is changed, but the wrapper object is intended - * to remain. This is the case for the "fake" CC_DPCall generated on CC_DPLine::CreateCall(), where - * the correct IDPCall* is provided later. - * reset() is a cleanup step to wipe the handle map and allow memory to be reclaimed. + * wrap() will always return the same FooPtr for a given foo_handle_t, it will + * not construct additional objects if a suitable one already exists. + * changeHandle() is used in rare cases where the underlying handle is changed, + * but the wrapper object is intended to remain. This is the + * case for the "fake" CC_DPCall generated on + * CC_DPLine::CreateCall(), where the correct IDPCall* is + * provided later. + * reset() is a cleanup step to wipe the handle map and allow memory to be + * reclaimed. * * Future enhancements: - * - For now, objects remain in the map forever. Better would be to add a releaseHandle() function which would - * allow the map to be emptied as underlying handles expired. While we can't force the client to give up its - * shared_ptr objects, we can remove our own copy, for instance on a call ended event. + * - For now, objects remain in the map forever. Better would be to add a + * releaseHandle() function which would allow the map to be emptied as + * underlying handles expired. While we can't force the client to give up + * its shared_ptr objects, we can remove our own copy, for instance on a + * call ended event. */ #include diff --git a/media/webrtc/signaling/src/media-conduit/AudioConduit.h b/media/webrtc/signaling/src/media-conduit/AudioConduit.h index 7749774ded12..cc91dc49f648 100644 --- a/media/webrtc/signaling/src/media-conduit/AudioConduit.h +++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.h @@ -99,20 +99,24 @@ public: MediaConduitErrorCode SetReceiverTransport(RefPtr aTransport) override; /** - * Function to deliver externally captured audio sample for encoding and transport + * Function to deliver externally captured audio sample for encoding and + * transport * @param audioData [in]: Pointer to array containing a frame of audio - * @param lengthSamples [in]: Length of audio frame in samples in multiple of 10 milliseconds - * Ex: Frame length is 160, 320, 440 for 16, 32, 44 kHz sampling rates - respectively. - audioData[] should be of lengthSamples in size - say, for 16kz sampling rate, audioData[] should contain 160 - samples of 16-bits each for a 10m audio frame. - * @param samplingFreqHz [in]: Frequency/rate of the sampling in Hz ( 16000, 32000 ...) - * @param capture_delay [in]: Approx Delay from recording until it is delivered to VoiceEngine - in milliseconds. - * NOTE: ConfigureSendMediaCodec() SHOULD be called before this function can be invoked - * This ensures the inserted audio-samples can be transmitted by the conduit - * + * @param lengthSamples [in]: Length of audio frame in samples in multiple of + * 10 milliseconds + * Ex: Frame length is 160, 320, 440 for 16, 32, + * 44 kHz sampling rates respectively. + * audioData[] should be of lengthSamples in + * size say, for 16kz sampling rate, + * audioData[] should contain 160 samples of + * 16-bits each for a 10m audio frame. + * @param samplingFreqHz [in]: Frequency/rate of the sampling in Hz + * ( 16000, 32000 ...) + * @param capture_delay [in]: Approx Delay from recording until it is + * delivered to VoiceEngine in milliseconds. + * NOTE: ConfigureSendMediaCodec() SHOULD be called before this function can + * be invoked. This ensures the inserted audio-samples can be transmitted by + * the conduit */ MediaConduitErrorCode SendAudioFrame(const int16_t speechData[], int32_t lengthSamples, @@ -121,21 +125,26 @@ public: int32_t capture_time) override; /** - * Function to grab a decoded audio-sample from the media engine for rendering - * / playoutof length 10 milliseconds. + * Function to grab a decoded audio-sample from the media engine for + * rendering / playoutof length 10 milliseconds. * - * @param speechData [in]: Pointer to a array to which a 10ms frame of audio will be copied - * @param samplingFreqHz [in]: Frequency of the sampling for playback in Hertz (16000, 32000,..) - * @param capture_delay [in]: Estimated Time between reading of the samples to rendering/playback + * @param speechData [in]: Pointer to a array to which a 10ms frame of audio + * will be copied + * @param samplingFreqHz [in]: Frequency of the sampling for playback in + * Hertz (16000, 32000,..) + * @param capture_delay [in]: Estimated Time between reading of the samples + * to rendering/playback * @param lengthSamples [in]: Contain maximum length of speechData array. - * @param lengthSamples [out]: Will contain length of the audio frame in samples at return. - Ex: A value of 160 implies 160 samples each of 16-bits was copied - into speechData + * @param lengthSamples [out]: Will contain length of the audio frame in + * samples at return. + * Ex: A value of 160 implies 160 samples each of + * 16-bits was copied into speechData * NOTE: This function should be invoked every 10 milliseconds for the best - * peformance - * NOTE: ConfigureRecvMediaCodec() SHOULD be called before this function can be invoked - * This ensures the decoded samples are ready for reading and playout is enabled. - * + * peformance + * NOTE: ConfigureRecvMediaCodec() SHOULD be called before this function can + * be invoked + * This ensures the decoded samples are ready for reading and playout is + * enabled. */ MediaConduitErrorCode GetAudioFrame(int16_t speechData[], int32_t samplingFreqHz, diff --git a/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h b/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h index 307685f30ad4..72da7a079f76 100644 --- a/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h +++ b/media/webrtc/signaling/src/media-conduit/MediaConduitInterface.h @@ -204,7 +204,8 @@ public: * @param aDirection the local direction to set the RTP header extensions for * @param aExtensions the RTP header extensions to set * @return if all extensions were set it returns a success code, - * if an extension fails to set it may immediately return an error code + * if an extension fails to set it may immediately return an error + * code * TODO webrtc.org 64 update: make return type void again */ virtual MediaConduitErrorCode @@ -457,10 +458,11 @@ public: /** * Function to configure send codec for the video session * @param sendSessionConfig: CodecConfiguration - * @result: On Success, the video engine is configured with passed in codec for send - * On failure, video engine transmit functionality is disabled. - * NOTE: This API can be invoked multiple time. Invoking this API may involve restarting - * transmission sub-system on the engine + * @result: On Success, the video engine is configured with passed in codec + * for send. On failure, video engine transmit functionality is + * disabled. + * NOTE: This API can be invoked multiple time. Invoking this API may involve + * restarting transmission sub-system on the engine * */ virtual MediaConduitErrorCode ConfigureSendMediaCodec(const VideoCodecConfig* sendSessionConfig) = 0; @@ -468,8 +470,8 @@ public: /** * Function to configurelist of receive codecs for the video session * @param sendSessionConfig: CodecConfiguration - * NOTE: This API can be invoked multiple time. Invoking this API may involve restarting - * reception sub-system on the engine + * NOTE: This API can be invoked multiple time. Invoking this API may involve + * restarting reception sub-system on the engine * */ virtual MediaConduitErrorCode ConfigureRecvMediaCodecs( @@ -530,19 +532,24 @@ public: SetLocalRTPExtensions(MediaSessionConduitLocalDirection aDirection, const RtpExtList& extensions) override = 0; /** - * Function to deliver externally captured audio sample for encoding and transport + * Function to deliver externally captured audio sample for encoding and + * transport * @param audioData [in]: Pointer to array containing a frame of audio - * @param lengthSamples [in]: Length of audio frame in samples in multiple of 10 milliseconds - * Ex: Frame length is 160, 320, 440 for 16, 32, 44 kHz sampling rates - respectively. - audioData[] is lengthSamples in size - say, for 16kz sampling rate, audioData[] should contain 160 - samples of 16-bits each for a 10m audio frame. - * @param samplingFreqHz [in]: Frequency/rate of the sampling in Hz ( 16000, 32000 ...) - * @param capture_delay [in]: Approx Delay from recording until it is delivered to VoiceEngine - in milliseconds. - * NOTE: ConfigureSendMediaCodec() SHOULD be called before this function can be invoked - * This ensures the inserted audio-samples can be transmitted by the conduit + * @param lengthSamples [in]: Length of audio frame in samples in multiple of + * 10 milliseconds + * Ex: Frame length is 160, 320, 440 for 16, 32, + * 44 kHz sampling rates respectively. + * audioData[] is lengthSamples in size + * say, for 16kz sampling rate, audioData[] + * should contain 160 samples of 16-bits each + * for a 10m audio frame. + * @param samplingFreqHz [in]: Frequency/rate of the sampling in Hz ( 16000, + * 32000 ...) + * @param capture_delay [in]: Approx Delay from recording until it is + * delivered to VoiceEngine in milliseconds. + * NOTE: ConfigureSendMediaCodec() SHOULD be called before this function can + * be invoked. This ensures the inserted audio-samples can be transmitted by + * the conduit. * */ virtual MediaConduitErrorCode SendAudioFrame(const int16_t audioData[], @@ -555,16 +562,20 @@ public: * Function to grab a decoded audio-sample from the media engine for rendering * / playoutof length 10 milliseconds. * - * @param speechData [in]: Pointer to a array to which a 10ms frame of audio will be copied - * @param samplingFreqHz [in]: Frequency of the sampling for playback in Hertz (16000, 32000,..) - * @param capture_delay [in]: Estimated Time between reading of the samples to rendering/playback - * @param lengthSamples [out]: Will contain length of the audio frame in samples at return. - Ex: A value of 160 implies 160 samples each of 16-bits was copied - into speechData + * @param speechData [in]: Pointer to a array to which a 10ms frame of audio + * will be copied + * @param samplingFreqHz [in]: Frequency of the sampling for playback in + * Hertz (16000, 32000,..) + * @param capture_delay [in]: Estimated Time between reading of the samples + * to rendering/playback + * @param lengthSamples [out]: Will contain length of the audio frame in + * samples at return. + * Ex: A value of 160 implies 160 samples each of + * 16-bits was copied into speechData * NOTE: This function should be invoked every 10 milliseconds for the best - * peformance - * NOTE: ConfigureRecvMediaCodec() SHOULD be called before this function can be invoked - * This ensures the decoded samples are ready for reading. + * peformance + * NOTE: ConfigureRecvMediaCodec() SHOULD be called before this function can + * be invoked. This ensures the decoded samples are ready for reading. * */ virtual MediaConduitErrorCode GetAudioFrame(int16_t speechData[], diff --git a/media/webrtc/signaling/src/media-conduit/VideoConduit.h b/media/webrtc/signaling/src/media-conduit/VideoConduit.h index d114f2b43d94..6a4c3c6f255f 100644 --- a/media/webrtc/signaling/src/media-conduit/VideoConduit.h +++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.h @@ -125,21 +125,23 @@ public: /** * Function to configure send codec for the video session * @param sendSessionConfig: CodecConfiguration - * @result: On Success, the video engine is configured with passed in codec for send + * @result: On Success, the video engine is configured with passed in codec + * for send * On failure, video engine transmit functionality is disabled. - * NOTE: This API can be invoked multiple time. Invoking this API may involve restarting - * transmission sub-system on the engine. + * NOTE: This API can be invoked multiple time. Invoking this API may involve + * restarting transmission sub-system on the engine. */ MediaConduitErrorCode ConfigureSendMediaCodec(const VideoCodecConfig* codecInfo) override; /** * Function to configure list of receive codecs for the video session * @param sendSessionConfig: CodecConfiguration - * @result: On Success, the video engine is configured with passed in codec for send + * @result: On Success, the video engine is configured with passed in codec + * for send * Also the playout is enabled. * On failure, video engine transmit functionality is disabled. - * NOTE: This API can be invoked multiple time. Invoking this API may involve restarting - * transmission sub-system on the engine. + * NOTE: This API can be invoked multiple time. Invoking this API may involve + * restarting transmission sub-system on the engine. */ MediaConduitErrorCode ConfigureRecvMediaCodecs( const std::vector>& codecConfigList) override; diff --git a/media/webrtc/signaling/src/mediapipeline/RtpLogger.h b/media/webrtc/signaling/src/mediapipeline/RtpLogger.h index b65deb06dab8..5353e31a9786 100644 --- a/media/webrtc/signaling/src/mediapipeline/RtpLogger.h +++ b/media/webrtc/signaling/src/mediapipeline/RtpLogger.h @@ -15,7 +15,8 @@ namespace mozilla { /* This class logs RTP and RTCP packets in hex in a format compatible to * text2pcap. * Example to convert the MOZ log file into a PCAP file: - * egrep '(RTP_PACKET|RTCP_PACKET)' moz.log | text2pcap -D -n -l 1 -i 17 -u 1234,1235 -t '%H:%M:%S.' - rtp.pcap + * egrep '(RTP_PACKET|RTCP_PACKET)' moz.log | \ + * text2pcap -D -n -l 1 -i 17 -u 1234,1235 -t '%H:%M:%S.' - rtp.pcap */ class RtpLogger { public: diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp index 167db41b3848..6a404e1ed37d 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp @@ -187,7 +187,8 @@ void PeerConnectionCtx::Destroy() { // Telemetry reporting every second after start of first call. // The threading model around the media pipelines is weird: // - The pipelines are containers, -// - containers that are only safe on main thread, with members only safe on STS, +// - containers that are only safe on main thread, with members only safe on +// STS, // - hence the there and back again approach. static auto diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index e7be18fd2f9f..ea6e3303c26b 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -1215,7 +1215,8 @@ PeerConnectionImpl::CreateDataChannel(const nsAString& aLabel, // return; // } // RefPtr tmp2 = do_QueryObject(tmp); -// RefPtr pco = static_cast(&*tmp2); +// RefPtr pco = +// static_cast(&*tmp2); static already_AddRefed do_QueryObjectReferent(nsIWeakReference* aRawPtr) { diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index 9f27366f9e86..7c2aa081d3ce 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -572,8 +572,8 @@ * expected to live on the stack or in static storage, so it is a compile-time * error to use it, or an array of such objects, as the type of a new * expression. If a member of another class uses this class, or if another - * class inherits from this class, then it is considered to be a non-heap class - * as well, although this attribute need not be provided in such cases. + * class inherits from this class, then it is considered to be a non-heap + * class as well, although this attribute need not be provided in such cases. * MOZ_HEAP_CLASS: Applies to all classes. Any class with this annotation is * expected to live on the heap, so it is a compile-time error to use it, or * an array of such objects, as the type of a variable declaration, or as a @@ -637,25 +637,27 @@ * MOZ_NON_OWNING_REF: Applies to declarations of pointers to reference counted * types. This attribute tells the compiler that the raw pointer is a weak * reference, which is ensured to be valid by a guarantee that the reference - * will be nulled before the pointer becomes invalid. This can make the compiler - * ignore these pointers when validating the usage of pointers otherwise. + * will be nulled before the pointer becomes invalid. This can make the + * compiler ignore these pointers when validating the usage of pointers + * otherwise. * * Examples include an mOwner pointer, which is nulled by the owning class's * destructor, and is null-checked before dereferencing. - * MOZ_UNSAFE_REF: Applies to declarations of pointers to reference counted types. - * Occasionally there are non-owning references which are valid, but do not take - * the form of a MOZ_NON_OWNING_REF. Their safety may be dependent on the behaviour - * of API consumers. The string argument passed to this macro documents the safety - * conditions. This can make the compiler ignore these pointers when validating - * the usage of pointers elsewhere. + * MOZ_UNSAFE_REF: Applies to declarations of pointers to reference counted + * types. Occasionally there are non-owning references which are valid, but + * do not take the form of a MOZ_NON_OWNING_REF. Their safety may be + * dependent on the behaviour of API consumers. The string argument passed + * to this macro documents the safety conditions. This can make the compiler + * ignore these pointers when validating the usage of pointers elsewhere. * - * Examples include an nsAtom* member which is known at compile time to point to a - * static atom which is valid throughout the lifetime of the program, or an API which - * stores a pointer, but doesn't take ownership over it, instead requiring the API - * consumer to correctly null the value before it becomes invalid. + * Examples include an nsAtom* member which is known at compile time to point + * to a static atom which is valid throughout the lifetime of the program, or + * an API which stores a pointer, but doesn't take ownership over it, instead + * requiring the API consumer to correctly null the value before it becomes + * invalid. * - * Use of this annotation is discouraged when a strong reference or one of the above - * two annotations can be used instead. + * Use of this annotation is discouraged when a strong reference or one of + * the above two annotations can be used instead. * MOZ_NO_ADDREF_RELEASE_ON_RETURN: Applies to function declarations. Makes it * a compile time error to call AddRef or Release on the return value of a * function. This is intended to be used with operator->() of our smart @@ -665,8 +667,8 @@ * error to not use the return value of a function which has this type. This * is intended to be used with types which it is an error to not use. * MOZ_NEEDS_NO_VTABLE_TYPE: Applies to template class declarations. Makes it - * a compile time error to instantiate this template with a type parameter which - * has a VTable. + * a compile time error to instantiate this template with a type parameter + * which has a VTable. * MOZ_NON_MEMMOVABLE: Applies to class declarations for types that are not safe * to be moved in memory using memmove(). * MOZ_NEEDS_MEMMOVABLE_TYPE: Applies to template class declarations where the @@ -691,21 +693,22 @@ * MOZ_INIT_OUTSIDE_CTOR: Applies to class member declarations. Occasionally * there are class members that are not initialized in the constructor, * but logic elsewhere in the class ensures they are initialized prior to use. - * Using this attribute on a member disables the check that this member must be - * initialized in constructors via list-initialization, in the constructor body, - * or via functions called from the constructor body. + * Using this attribute on a member disables the check that this member must + * be initialized in constructors via list-initialization, in the constructor + * body, or via functions called from the constructor body. * MOZ_IS_CLASS_INIT: Applies to class method declarations. Occasionally the - * constructor doesn't initialize all of the member variables and another function - * is used to initialize the rest. This marker is used to make the static analysis - * tool aware that the marked function is part of the initialization process - * and to include the marked function in the scan mechanism that determines which - * member variables still remain uninitialized. + * constructor doesn't initialize all of the member variables and another + * function is used to initialize the rest. This marker is used to make the + * static analysis tool aware that the marked function is part of the + * initialization process and to include the marked function in the scan + * mechanism that determines which member variables still remain + * uninitialized. * MOZ_NON_PARAM: Applies to types. Makes it compile time error to use the type * in parameter without pointer or reference. - * MOZ_NON_AUTOABLE: Applies to class declarations. Makes it a compile time error to - * use `auto` in place of this type in variable declarations. This is intended to - * be used with types which are intended to be implicitly constructed into other - * other types before being assigned to variables. + * MOZ_NON_AUTOABLE: Applies to class declarations. Makes it a compile time + * error to use `auto` in place of this type in variable declarations. This + * is intended to be used with types which are intended to be implicitly + * constructed into other other types before being assigned to variables. * MOZ_REQUIRED_BASE_METHOD: Applies to virtual class method declarations. * Sometimes derived classes override methods that need to be called by their * overridden counterparts. This marker indicates that the marked method must diff --git a/mfbt/Move.h b/mfbt/Move.h index 856ab44c4a8b..f52da8622600 100644 --- a/mfbt/Move.h +++ b/mfbt/Move.h @@ -137,7 +137,8 @@ namespace mozilla { * template like so[0]: * * template - * C::C(XArg&& x, YArg&& y) : x(std::forward(x)), y(std::forward(y)) { } + * C::C(XArg&& x, YArg&& y) : x(std::forward(x)), + * y(std::forward(y)) { } * * ("'Don't Repeat Yourself'? What's that?") * diff --git a/mfbt/Span.h b/mfbt/Span.h index 7b59eaab9b7f..978d346d3c08 100644 --- a/mfbt/Span.h +++ b/mfbt/Span.h @@ -448,8 +448,11 @@ public: constexpr static const index_type extent = Extent; // [Span.cons], Span constructors, copy, assignment, and destructor - // "Dependent" is needed to make "span_details::enable_if_t<(Dependent || Extent == 0 || Extent == mozilla::MaxValue::value)>" SFINAE, - // since "span_details::enable_if_t<(Extent == 0 || Extent == mozilla::MaxValue::value)>" is ill-formed when Extent is neither of the extreme values. + // "Dependent" is needed to make "span_details::enable_if_t<(Dependent || + // Extent == 0 || Extent == mozilla::MaxValue::value)>" SFINAE, + // since "span_details::enable_if_t<(Extent == 0 || Extent == + // mozilla::MaxValue::value)>" is ill-formed when Extent is neither + // of the extreme values. /** * Constructor with no args. */ diff --git a/mfbt/ThreadSafeWeakPtr.h b/mfbt/ThreadSafeWeakPtr.h index 5821315365f8..4ebb8c094b58 100644 --- a/mfbt/ThreadSafeWeakPtr.h +++ b/mfbt/ThreadSafeWeakPtr.h @@ -43,7 +43,8 @@ * // Make a new weak reference to the object from the strong reference. * weak = strong; * } - * MOZ_ASSERT(!bool(weak), "Weak pointers are cleared after all strong references are released."); + * MOZ_ASSERT(!bool(weak), "Weak pointers are cleared after all " + * "strong references are released."); * * // Convert the weak reference to a strong reference for usage. * RefPtr other(weak); diff --git a/mfbt/WrappingOperations.h b/mfbt/WrappingOperations.h index f93c311671e6..cd06f5ed89ee 100644 --- a/mfbt/WrappingOperations.h +++ b/mfbt/WrappingOperations.h @@ -142,9 +142,12 @@ public: * For N-bit signed integer types, this is equivalent to adding the two numbers * wrapped to unsigned, then wrapping the sum mod 2**N to the signed range: * - * WrappingAdd(int16_t(32767), int16_t(3)) is -32766 ((32770 mod 2**16) - 2**16); - * WrappingAdd(int8_t(-128), int8_t(-128)) is 0 (256 mod 2**8); - * WrappingAdd(int32_t(-42), int32_t(-17)) is -59 ((8589934533 mod 2**32) - 2**32). + * WrappingAdd(int16_t(32767), int16_t(3)) is + * -32766 ((32770 mod 2**16) - 2**16); + * WrappingAdd(int8_t(-128), int8_t(-128)) is + * 0 (256 mod 2**8); + * WrappingAdd(int32_t(-42), int32_t(-17)) is + * -59 ((8589934533 mod 2**32) - 2**32). * * There's no equivalent to this operation in C++, as C++ signed addition that * overflows has undefined behavior. But it's how such addition *tends* to @@ -253,7 +256,8 @@ public: * numbers wrapped to unsigned, then wrapping the product mod 2**N to the signed * range: * - * WrappingMultiply(int16_t(-456), int16_t(123)) is 9448 ((-56088 mod 2**16) + 2**16); + * WrappingMultiply(int16_t(-456), int16_t(123)) is + * 9448 ((-56088 mod 2**16) + 2**16); * WrappingMultiply(int32_t(-7), int32_t(-9)) is 63 (63 mod 2**32); * WrappingMultiply(int8_t(16), int8_t(24)) is -128 ((384 mod 2**8) - 2**8); * WrappingMultiply(int8_t(16), int8_t(255)) is -16 ((4080 mod 2**8) - 2**8).