зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1538768 - Ensure that RenderRootArray<bool> is properly initialized to false on creation. r=dthayer
Differential Revision: https://phabricator.services.mozilla.com/D24950 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
20e5ae9990
Коммит
b4b306f879
|
@ -1123,7 +1123,7 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvEmptyTransaction(
|
|||
AutoWebRenderBridgeParentAsyncMessageSender autoAsyncMessageSender(
|
||||
this, &aToDestroy);
|
||||
|
||||
wr::RenderRootArray<bool> scheduleComposite(false);
|
||||
wr::RenderRootArray<bool> scheduleComposite;
|
||||
|
||||
UpdateAPZFocusState(aFocusTarget);
|
||||
|
||||
|
|
|
@ -39,8 +39,7 @@ WebRenderLayerManager::WebRenderLayerManager(nsIWidget* aWidget)
|
|||
mIsFirstPaint(false),
|
||||
mTarget(nullptr),
|
||||
mPaintSequenceNumber(0),
|
||||
mWebRenderCommandBuilder(this),
|
||||
mLastDisplayListSizes{0} {
|
||||
mWebRenderCommandBuilder(this) {
|
||||
MOZ_COUNT_CTOR(WebRenderLayerManager);
|
||||
for (auto renderRoot : wr::kRenderRoots) {
|
||||
mStateManagers[renderRoot].mRenderRoot = renderRoot;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "mozilla/layers/LayersTypes.h"
|
||||
#include "mozilla/PodOperations.h"
|
||||
#include "mozilla/Range.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "mozilla/Variant.h"
|
||||
#include "Units.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
@ -91,12 +92,11 @@ template <typename T>
|
|||
class RenderRootArray : public Array<T, kRenderRootCount> {
|
||||
typedef Array<T, kRenderRootCount> Super;
|
||||
public:
|
||||
RenderRootArray() {}
|
||||
|
||||
explicit RenderRootArray(T aDefault) {
|
||||
for (auto renderRoot : kRenderRoots) {
|
||||
(*this)[renderRoot] = aDefault;
|
||||
}
|
||||
RenderRootArray() {
|
||||
if (IsPod<T>::value) {
|
||||
// Ensure primitive types get initialized to 0/false.
|
||||
PodArrayZero(*this);
|
||||
} // else C++ will default-initialize the array elements for us
|
||||
}
|
||||
|
||||
T& operator[](wr::RenderRoot aIndex) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче