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
This commit is contained in:
Ehsan Akhgari 2018-11-28 09:16:55 +00:00
Родитель 0ad55ab74f
Коммит ca162bee20
93 изменённых файлов: 520 добавлений и 346 удалений

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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;
<set appropriate swap chain parameters in 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;

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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);

Просмотреть файл

@ -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)

Просмотреть файл

@ -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.
*/
/**

Просмотреть файл

@ -89,8 +89,9 @@ WaitForTextureIdsToUnlock(pid_t pid, const Span<const uint64_t>& 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
} // namespace mozilla

Просмотреть файл

@ -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().

Просмотреть файл

@ -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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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<TestAsyncPanZoomController> apzcroot = ApzcOf(root);
TestAsyncPanZoomController* apzc1 = ApzcOf(layers[1]);

Просмотреть файл

@ -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

Просмотреть файл

@ -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);

Просмотреть файл

@ -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.

Просмотреть файл

@ -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,

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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<nsDisplayItemGeometry> 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);

Просмотреть файл

@ -142,8 +142,10 @@ struct nsRect :
__m128i resultRect = _mm_max_epi32(rect1, rect2); // xr, yr, zz, zz
// result.width = std::min<int32_t>(x - result.x + width, aRect.x - result.x + aRect.width);
// result.height = std::min<int32_t>(y - result.y + height, aRect.y - result.y + aRect.height);
// result.width = std::min<int32_t>(x - result.x + width,
// aRect.x - result.x + aRect.width);
// result.height = std::min<int32_t>(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<int32_t>(x - result.x + width, aRect.x - result.x + aRect.width);
// result.height = std::min<int32_t>(y - result.y + height, aRect.y - result.y + aRect.height);
// result.width = std::min<int32_t>(x - result.x + width,
// aRect.x - result.x + aRect.width);
// result.height = std::min<int32_t>(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);

Просмотреть файл

@ -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

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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,

Просмотреть файл

@ -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);

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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()

Просмотреть файл

@ -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;

Просмотреть файл

@ -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

Просмотреть файл

@ -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.
*

Просмотреть файл

@ -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];

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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).
*/

Просмотреть файл

@ -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.

Просмотреть файл

@ -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.)

Просмотреть файл

@ -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);

Просмотреть файл

@ -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_) \

Просмотреть файл

@ -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
//

Просмотреть файл

@ -781,7 +781,8 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> 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)
}

Просмотреть файл

@ -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'.
//

Просмотреть файл

@ -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;

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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/. */

Просмотреть файл

@ -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.

Просмотреть файл

@ -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<IMFCollection> events = output.pEvents; // Ensure this is released.
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) {

Просмотреть файл

@ -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<Foo> 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<Foo> objects, we can remove our own copy, for instance on a
* call ended event.
*/
#include <map>

Просмотреть файл

@ -99,20 +99,24 @@ public:
MediaConduitErrorCode SetReceiverTransport(RefPtr<TransportInterface> 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,

Просмотреть файл

@ -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[],

Просмотреть файл

@ -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<UniquePtr<VideoCodecConfig>>& codecConfigList) override;

Просмотреть файл

@ -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:

Просмотреть файл

@ -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

Просмотреть файл

@ -1215,7 +1215,8 @@ PeerConnectionImpl::CreateDataChannel(const nsAString& aLabel,
// return;
// }
// RefPtr<nsSupportsWeakReference> tmp2 = do_QueryObject(tmp);
// RefPtr<PeerConnectionObserver> pco = static_cast<PeerConnectionObserver*>(&*tmp2);
// RefPtr<PeerConnectionObserver> pco =
// static_cast<PeerConnectionObserver*>(&*tmp2);
static already_AddRefed<PeerConnectionObserver>
do_QueryObjectReferent(nsIWeakReference* aRawPtr) {

Просмотреть файл

@ -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

Просмотреть файл

@ -137,7 +137,8 @@ namespace mozilla {
* template like so[0]:
*
* template <typename XArg, typename YArg>
* C::C(XArg&& x, YArg&& y) : x(std::forward<XArg>(x)), y(std::forward<YArg>(y)) { }
* C::C(XArg&& x, YArg&& y) : x(std::forward<XArg>(x)),
* y(std::forward<YArg>(y)) { }
*
* ("'Don't Repeat Yourself'? What's that?")
*

Просмотреть файл

@ -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<size_t>::value)>" SFINAE,
// since "span_details::enable_if_t<(Extent == 0 || Extent == mozilla::MaxValue<size_t>::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<size_t>::value)>" SFINAE,
// since "span_details::enable_if_t<(Extent == 0 || Extent ==
// mozilla::MaxValue<size_t>::value)>" is ill-formed when Extent is neither
// of the extreme values.
/**
* Constructor with no args.
*/

Просмотреть файл

@ -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<C> other(weak);

Просмотреть файл

@ -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).