зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to autoland. a=merge CLOSED TREE
This commit is contained in:
Коммит
db7f220d5c
|
@ -304,12 +304,14 @@ void WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage) {
|
|||
////
|
||||
|
||||
const auto checkedSize = CheckedInt<size_t>(size);
|
||||
if (!checkedSize.isValid()) return ErrorOutOfMemory("size too large for platform.");
|
||||
if (!checkedSize.isValid())
|
||||
return ErrorOutOfMemory("size too large for platform.");
|
||||
|
||||
const UniqueBuffer zeroBuffer(calloc(checkedSize.value(), 1u));
|
||||
if (!zeroBuffer) return ErrorOutOfMemory("Failed to allocate zeros.");
|
||||
|
||||
BufferDataImpl(target, checkedSize.value(), (const uint8_t*)zeroBuffer.get(), usage);
|
||||
BufferDataImpl(target, checkedSize.value(), (const uint8_t*)zeroBuffer.get(),
|
||||
usage);
|
||||
}
|
||||
|
||||
void WebGLContext::BufferData(GLenum target,
|
||||
|
|
|
@ -284,15 +284,13 @@ void WebGLContext::GetExtension(JSContext* cx, const nsAString& wideName,
|
|||
// Step 4: Enable any implied extensions.
|
||||
switch (ext) {
|
||||
case WebGLExtensionID::EXT_color_buffer_float:
|
||||
EnableSupportedExtension(callerType,
|
||||
WebGLExtensionID::EXT_float_blend);
|
||||
EnableSupportedExtension(callerType, WebGLExtensionID::EXT_float_blend);
|
||||
break;
|
||||
|
||||
case WebGLExtensionID::OES_texture_float:
|
||||
EnableSupportedExtension(callerType,
|
||||
WebGLExtensionID::WEBGL_color_buffer_float);
|
||||
EnableSupportedExtension(callerType,
|
||||
WebGLExtensionID::EXT_float_blend);
|
||||
EnableSupportedExtension(callerType, WebGLExtensionID::EXT_float_blend);
|
||||
break;
|
||||
|
||||
case WebGLExtensionID::OES_texture_half_float:
|
||||
|
@ -301,8 +299,7 @@ void WebGLContext::GetExtension(JSContext* cx, const nsAString& wideName,
|
|||
break;
|
||||
|
||||
case WebGLExtensionID::WEBGL_color_buffer_float:
|
||||
EnableSupportedExtension(callerType,
|
||||
WebGLExtensionID::EXT_float_blend);
|
||||
EnableSupportedExtension(callerType, WebGLExtensionID::EXT_float_blend);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -42,7 +42,8 @@ WebGLExtensionTextureFloat::WebGLExtensionTextureFloat(WebGLContext* webgl)
|
|||
dui = {pi.format, pi.format, pi.type};
|
||||
swizzle = nullptr;
|
||||
if (needsSizedFormat ||
|
||||
gl->IsExtensionSupported(gl::GLContext::CHROMIUM_color_buffer_float_rgba)) {
|
||||
gl->IsExtensionSupported(
|
||||
gl::GLContext::CHROMIUM_color_buffer_float_rgba)) {
|
||||
dui.internalFormat = LOCAL_GL_RGBA32F;
|
||||
}
|
||||
fnAdd(webgl::EffectiveFormat::RGBA32F);
|
||||
|
|
|
@ -25,20 +25,22 @@ class GLContext; // This is going to be needed a lot.
|
|||
} // namespace gl
|
||||
|
||||
// -
|
||||
// Prevent implicit conversions into calloc and malloc. (mozilla namespace only!)
|
||||
// Prevent implicit conversions into calloc and malloc. (mozilla namespace
|
||||
// only!)
|
||||
|
||||
template<typename DestT>
|
||||
class ForbidNarrowing final
|
||||
{
|
||||
template <typename DestT>
|
||||
class ForbidNarrowing final {
|
||||
DestT mVal;
|
||||
|
||||
public:
|
||||
template<typename SrcT>
|
||||
public:
|
||||
template <typename SrcT>
|
||||
MOZ_IMPLICIT ForbidNarrowing(SrcT val) : mVal(val) {
|
||||
static_assert(std::numeric_limits<SrcT>::min() >= std::numeric_limits<DestT>::min(),
|
||||
"SrcT must be narrower than DestT.");
|
||||
static_assert(std::numeric_limits<SrcT>::max() <= std::numeric_limits<DestT>::max(),
|
||||
"SrcT must be narrower than DestT.");
|
||||
static_assert(
|
||||
std::numeric_limits<SrcT>::min() >= std::numeric_limits<DestT>::min(),
|
||||
"SrcT must be narrower than DestT.");
|
||||
static_assert(
|
||||
std::numeric_limits<SrcT>::max() <= std::numeric_limits<DestT>::max(),
|
||||
"SrcT must be narrower than DestT.");
|
||||
}
|
||||
|
||||
explicit operator DestT() const { return mVal; }
|
||||
|
@ -48,7 +50,8 @@ inline void* malloc(const ForbidNarrowing<size_t> s) {
|
|||
return ::malloc(size_t(s));
|
||||
}
|
||||
|
||||
inline void* calloc(const ForbidNarrowing<size_t> n, const ForbidNarrowing<size_t> size) {
|
||||
inline void* calloc(const ForbidNarrowing<size_t> n,
|
||||
const ForbidNarrowing<size_t> size) {
|
||||
return ::calloc(size_t(n), size_t(size));
|
||||
}
|
||||
|
||||
|
|
|
@ -862,7 +862,7 @@ inline bool MOZ2D_warn_if_impl(bool aCondition, const char* aExpr,
|
|||
|
||||
const int INDENT_PER_LEVEL = 2;
|
||||
|
||||
template<int Level = LOG_DEBUG>
|
||||
template <int Level = LOG_DEBUG>
|
||||
class TreeLog {
|
||||
public:
|
||||
explicit TreeLog(const std::string& aPrefix = "")
|
||||
|
@ -930,7 +930,7 @@ class TreeLog {
|
|||
}
|
||||
};
|
||||
|
||||
template<int Level = LOG_DEBUG>
|
||||
template <int Level = LOG_DEBUG>
|
||||
class TreeAutoIndent {
|
||||
public:
|
||||
explicit TreeAutoIndent(TreeLog<Level>& aTreeLog) : mTreeLog(aTreeLog) {
|
||||
|
|
|
@ -142,8 +142,8 @@ static const FeatureInfo sFeatureInfoArr[] = {
|
|||
GLESVersion::ES3,
|
||||
GLContext::Extension_None,
|
||||
{GLContext::ARB_color_buffer_float, GLContext::EXT_color_buffer_float,
|
||||
GLContext::EXT_color_buffer_half_float, GLContext::CHROMIUM_color_buffer_float_rgba,
|
||||
GLContext::Extensions_End}},
|
||||
GLContext::EXT_color_buffer_half_float,
|
||||
GLContext::CHROMIUM_color_buffer_float_rgba, GLContext::Extensions_End}},
|
||||
{"frag_depth",
|
||||
GLVersion::GL2,
|
||||
GLESVersion::ES3,
|
||||
|
|
|
@ -286,8 +286,7 @@ already_AddRefed<GLContext> GLContextEGLFactory::Create(
|
|||
flags, caps, false, config, surface, &discardFailureId);
|
||||
if (!gl) {
|
||||
const auto err = egl->fGetError();
|
||||
gfxCriticalNote << "Failed to create EGLContext!: "
|
||||
<< gfx::hexa(err);
|
||||
gfxCriticalNote << "Failed to create EGLContext!: " << gfx::hexa(err);
|
||||
mozilla::gl::DestroySurface(surface);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -23,9 +23,7 @@ class VsyncIOThreadHolder final {
|
|||
|
||||
RefPtr<nsIThread> GetThread() const;
|
||||
|
||||
bool IsOnCurrentThread() const {
|
||||
return mThread->IsOnCurrentThread();
|
||||
}
|
||||
bool IsOnCurrentThread() const { return mThread->IsOnCurrentThread(); }
|
||||
|
||||
void Dispatch(already_AddRefed<nsIRunnable> task) {
|
||||
mThread->Dispatch(std::move(task), NS_DISPATCH_NORMAL);
|
||||
|
|
|
@ -2233,8 +2233,7 @@ bool LayerManager::IsLogEnabled() {
|
|||
}
|
||||
|
||||
bool LayerManager::SetPendingScrollUpdateForNextTransaction(
|
||||
ScrollableLayerGuid::ViewID aScrollId,
|
||||
const ScrollUpdateInfo& aUpdateInfo,
|
||||
ScrollableLayerGuid::ViewID aScrollId, const ScrollUpdateInfo& aUpdateInfo,
|
||||
wr::RenderRoot aRenderRoot) {
|
||||
Layer* withPendingTransform = DepthFirstSearch<ForwardIterator>(
|
||||
GetRoot(), [](Layer* aLayer) { return aLayer->HasPendingTransform(); });
|
||||
|
@ -2247,7 +2246,8 @@ bool LayerManager::SetPendingScrollUpdateForNextTransaction(
|
|||
// RenderRoot::Default so that we can make assumptions in
|
||||
// GetPendingScrollInfoUpdate.
|
||||
wr::RenderRoot renderRoot = (GetBackendType() == LayersBackend::LAYERS_WR)
|
||||
? aRenderRoot : wr::RenderRoot::Default;
|
||||
? aRenderRoot
|
||||
: wr::RenderRoot::Default;
|
||||
mPendingScrollUpdates[renderRoot][aScrollId] = aUpdateInfo;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -791,8 +791,7 @@ class LayerManager : public FrameRecorder {
|
|||
*/
|
||||
virtual bool SetPendingScrollUpdateForNextTransaction(
|
||||
ScrollableLayerGuid::ViewID aScrollId,
|
||||
const ScrollUpdateInfo& aUpdateInfo,
|
||||
wr::RenderRoot aRenderRoot);
|
||||
const ScrollUpdateInfo& aUpdateInfo, wr::RenderRoot aRenderRoot);
|
||||
Maybe<ScrollUpdateInfo> GetPendingScrollInfoUpdate(
|
||||
ScrollableLayerGuid::ViewID aScrollId);
|
||||
void ClearPendingScrollInfoUpdate();
|
||||
|
|
|
@ -362,8 +362,8 @@ APZCTreeManager::UpdateHitTestingTreeImpl(LayersId aRootLayerTreeId,
|
|||
if (gfxPrefs::APZTestLoggingEnabled()) {
|
||||
MutexAutoLock lock(mTestDataLock);
|
||||
UniquePtr<APZTestData> ptr = MakeUnique<APZTestData>();
|
||||
auto result =
|
||||
mTestData.insert(std::make_pair(aOriginatingWrRootId.mLayersId, std::move(ptr)));
|
||||
auto result = mTestData.insert(
|
||||
std::make_pair(aOriginatingWrRootId.mLayersId, std::move(ptr)));
|
||||
testData = result.first->second.get();
|
||||
testData->StartNewPaint(aPaintSequenceNumber);
|
||||
}
|
||||
|
@ -609,7 +609,8 @@ void APZCTreeManager::UpdateHitTestingTree(LayersId aRootLayerTreeId,
|
|||
|
||||
LayerMetricsWrapper root(aRoot);
|
||||
UpdateHitTestingTreeImpl(aRootLayerTreeId, root, aIsFirstPaint,
|
||||
WRRootId::NonWebRender(aOriginatingLayersId), aPaintSequenceNumber);
|
||||
WRRootId::NonWebRender(aOriginatingLayersId),
|
||||
aPaintSequenceNumber);
|
||||
}
|
||||
|
||||
void APZCTreeManager::UpdateHitTestingTree(
|
||||
|
@ -1046,8 +1047,9 @@ HitTestingTreeNode* APZCTreeManager::PrepareNodeForLayer(
|
|||
"Using APZC %p for layer %p with identifiers %" PRIx64 " %" PRId64 "\n",
|
||||
apzc, aLayer.GetLayer(), uint64_t(aLayersId), aMetrics.GetScrollId());
|
||||
|
||||
apzc->NotifyLayersUpdated(aLayer.Metadata(), aState.mIsFirstPaint,
|
||||
WRRootId(aLayersId, aRenderRoot) == aState.mOriginatingWrRootId);
|
||||
apzc->NotifyLayersUpdated(
|
||||
aLayer.Metadata(), aState.mIsFirstPaint,
|
||||
WRRootId(aLayersId, aRenderRoot) == aState.mOriginatingWrRootId);
|
||||
|
||||
// Since this is the first time we are encountering an APZC with this guid,
|
||||
// the node holding it must be the primary holder. It may be newly-created
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
#include "mozilla/layers/APZTestData.h" // for APZTestData
|
||||
#include "mozilla/layers/IAPZCTreeManager.h" // for IAPZCTreeManager
|
||||
#include "mozilla/layers/LayersTypes.h"
|
||||
#include "mozilla/layers/KeyboardMap.h" // for KeyboardMap
|
||||
#include "mozilla/layers/TouchCounter.h" // for TouchCounter
|
||||
#include "mozilla/layers/KeyboardMap.h" // for KeyboardMap
|
||||
#include "mozilla/layers/TouchCounter.h" // for TouchCounter
|
||||
#include "mozilla/layers/ZoomConstraints.h" // for ZoomConstraints
|
||||
#include "mozilla/RecursiveMutex.h" // for RecursiveMutex
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/TimeStamp.h" // for mozilla::TimeStamp
|
||||
#include "mozilla/UniquePtr.h" // for UniquePtr
|
||||
#include "nsCOMPtr.h" // for already_AddRefed
|
||||
#include "mozilla/RecursiveMutex.h" // for RecursiveMutex
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/TimeStamp.h" // for mozilla::TimeStamp
|
||||
#include "mozilla/UniquePtr.h" // for UniquePtr
|
||||
#include "nsCOMPtr.h" // for already_AddRefed
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
# include "mozilla/layers/AndroidDynamicToolbarAnimator.h"
|
||||
|
|
|
@ -157,7 +157,8 @@ void APZUpdater::UpdateFocusState(LayersId aRootLayerTreeId,
|
|||
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
|
||||
UpdaterQueueSelector selector(aOriginatingWrRootId);
|
||||
if (aFocusTarget.mData.is<FocusTarget::ScrollTargets>()) {
|
||||
const FocusTarget::ScrollTargets& targets = aFocusTarget.mData.as<FocusTarget::ScrollTargets>();
|
||||
const FocusTarget::ScrollTargets& targets =
|
||||
aFocusTarget.mData.as<FocusTarget::ScrollTargets>();
|
||||
selector.mRenderRoots += targets.mHorizontalRenderRoot;
|
||||
selector.mRenderRoots += targets.mVerticalRenderRoot;
|
||||
}
|
||||
|
@ -196,23 +197,23 @@ void APZUpdater::UpdateScrollDataAndTreeState(
|
|||
}
|
||||
self->mEpochData[aOriginatingWrRootId].mRequired = aEpoch;
|
||||
}));
|
||||
RunOnUpdaterThread(
|
||||
UpdaterQueueSelector(aOriginatingWrRootId),
|
||||
NS_NewRunnableFunction(
|
||||
"APZUpdater::UpdateHitTestingTree",
|
||||
[=, aScrollData = std::move(aScrollData)]() {
|
||||
self->mScrollData[aOriginatingWrRootId] = aScrollData;
|
||||
auto root = self->mScrollData.find(aRootLayerTreeId);
|
||||
if (root == self->mScrollData.end()) {
|
||||
return;
|
||||
}
|
||||
self->mApz->UpdateHitTestingTree(
|
||||
aRootLayerTreeId.mLayersId,
|
||||
WebRenderScrollDataWrapper(*self, aRootLayerTreeId,
|
||||
&(root->second)),
|
||||
aScrollData.IsFirstPaint(), aOriginatingWrRootId,
|
||||
aScrollData.GetPaintSequenceNumber());
|
||||
}));
|
||||
RunOnUpdaterThread(UpdaterQueueSelector(aOriginatingWrRootId),
|
||||
NS_NewRunnableFunction(
|
||||
"APZUpdater::UpdateHitTestingTree",
|
||||
[=, aScrollData = std::move(aScrollData)]() {
|
||||
self->mScrollData[aOriginatingWrRootId] =
|
||||
aScrollData;
|
||||
auto root = self->mScrollData.find(aRootLayerTreeId);
|
||||
if (root == self->mScrollData.end()) {
|
||||
return;
|
||||
}
|
||||
self->mApz->UpdateHitTestingTree(
|
||||
aRootLayerTreeId.mLayersId,
|
||||
WebRenderScrollDataWrapper(
|
||||
*self, aRootLayerTreeId, &(root->second)),
|
||||
aScrollData.IsFirstPaint(), aOriginatingWrRootId,
|
||||
aScrollData.GetPaintSequenceNumber());
|
||||
}));
|
||||
}
|
||||
|
||||
void APZUpdater::UpdateScrollOffsets(WRRootId aRootLayerTreeId,
|
||||
|
@ -235,8 +236,7 @@ void APZUpdater::UpdateScrollOffsets(WRRootId aRootLayerTreeId,
|
|||
aRootLayerTreeId.mLayersId,
|
||||
WebRenderScrollDataWrapper(
|
||||
*self, aRootLayerTreeId, &(root->second)),
|
||||
/*isFirstPaint*/ false,
|
||||
aOriginatingWrRootId,
|
||||
/*isFirstPaint*/ false, aOriginatingWrRootId,
|
||||
aPaintSequenceNumber);
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -32,10 +32,8 @@ class APZCBasicTester : public APZCTesterBase {
|
|||
tm = new TestAPZCTreeManager(mcc);
|
||||
updater = new APZUpdater(tm, false);
|
||||
sampler = new APZSampler(tm, false);
|
||||
apzc =
|
||||
new TestAsyncPanZoomController(LayersId{0}, mcc, tm,
|
||||
wr::RenderRoot::Default,
|
||||
mGestureBehavior);
|
||||
apzc = new TestAsyncPanZoomController(
|
||||
LayersId{0}, mcc, tm, wr::RenderRoot::Default, mGestureBehavior);
|
||||
apzc->SetFrameMetrics(TestFrameMetrics());
|
||||
apzc->GetScrollMetadata().SetIsLayersIdRoot(true);
|
||||
}
|
||||
|
|
|
@ -58,9 +58,8 @@ TEST_F(APZCBasicTester, ComplexTransform) {
|
|||
// CSS pixels). The displayport is 1 extra CSS pixel on all
|
||||
// sides.
|
||||
|
||||
RefPtr<TestAsyncPanZoomController> childApzc =
|
||||
new TestAsyncPanZoomController(LayersId{0}, mcc, tm,
|
||||
wr::RenderRoot::Default);
|
||||
RefPtr<TestAsyncPanZoomController> childApzc = new TestAsyncPanZoomController(
|
||||
LayersId{0}, mcc, tm, wr::RenderRoot::Default);
|
||||
|
||||
const char* layerTreeSyntax = "c(c)";
|
||||
// LayerID 0 1
|
||||
|
|
|
@ -120,8 +120,8 @@ void ClientImageLayer::RenderLayer() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!mImageClient || !mImageClient->UpdateImage(mContainer, GetContentFlags(),
|
||||
Nothing())) {
|
||||
if (!mImageClient ||
|
||||
!mImageClient->UpdateImage(mContainer, GetContentFlags(), Nothing())) {
|
||||
CompositableType type = GetImageClientType();
|
||||
if (type == CompositableType::UNKNOWN) {
|
||||
return;
|
||||
|
@ -137,8 +137,7 @@ void ClientImageLayer::RenderLayer() {
|
|||
mImageClient->Connect();
|
||||
ClientManager()->AsShadowForwarder()->Attach(mImageClient, this);
|
||||
}
|
||||
if (!mImageClient->UpdateImage(mContainer, GetContentFlags(),
|
||||
Nothing())) {
|
||||
if (!mImageClient->UpdateImage(mContainer, GetContentFlags(), Nothing())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1045,13 +1045,14 @@ bool AsyncCompositionManager::ApplyAsyncContentTransformToTree(
|
|||
if (mIsFirstPaint || FrameMetricsHaveUpdated(metrics)) {
|
||||
if (animator) {
|
||||
animator->UpdateRootFrameMetrics(metrics);
|
||||
} else if (RefPtr<UiCompositorControllerParent> uiController =
|
||||
UiCompositorControllerParent::
|
||||
GetFromRootLayerTreeId(rootLayerTreeId)) {
|
||||
} else if (RefPtr<UiCompositorControllerParent>
|
||||
uiController = UiCompositorControllerParent::
|
||||
GetFromRootLayerTreeId(
|
||||
rootLayerTreeId)) {
|
||||
uiController->NotifyUpdateScreenMetrics(metrics);
|
||||
}
|
||||
mLastMetrics = metrics;
|
||||
}
|
||||
}
|
||||
if (mIsFirstPaint) {
|
||||
if (animator) {
|
||||
animator->FirstPaint();
|
||||
|
@ -1238,9 +1239,12 @@ bool AsyncCompositionManager::ApplyAsyncContentTransformToTree(
|
|||
}
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
bool AsyncCompositionManager::FrameMetricsHaveUpdated(const FrameMetrics& aMetrics) {
|
||||
return RoundedToInt(mLastMetrics.GetScrollOffset()) != RoundedToInt(aMetrics.GetScrollOffset())
|
||||
|| mLastMetrics.GetZoom() != aMetrics.GetZoom();;
|
||||
bool AsyncCompositionManager::FrameMetricsHaveUpdated(
|
||||
const FrameMetrics& aMetrics) {
|
||||
return RoundedToInt(mLastMetrics.GetScrollOffset()) !=
|
||||
RoundedToInt(aMetrics.GetScrollOffset()) ||
|
||||
mLastMetrics.GetZoom() != aMetrics.GetZoom();
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -460,10 +460,10 @@ void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
|||
wr::BuiltDisplayList dl;
|
||||
wr::LayoutSize builderContentSize;
|
||||
builder.Finalize(builderContentSize, dl);
|
||||
aSceneBuilderTxn.SetDisplayList(
|
||||
gfx::Color(0.f, 0.f, 0.f, 0.f), aEpoch,
|
||||
wr::ToLayoutSize(aPipeline->mScBounds.Size()),
|
||||
aPipelineId, builderContentSize, dl.dl_desc, dl.dl);
|
||||
aSceneBuilderTxn.SetDisplayList(gfx::Color(0.f, 0.f, 0.f, 0.f), aEpoch,
|
||||
wr::ToLayoutSize(aPipeline->mScBounds.Size()),
|
||||
aPipelineId, builderContentSize, dl.dl_desc,
|
||||
dl.dl);
|
||||
}
|
||||
|
||||
void AsyncImagePipelineManager::ApplyAsyncImageForPipeline(
|
||||
|
@ -519,10 +519,9 @@ void AsyncImagePipelineManager::SetEmptyDisplayList(
|
|||
wr::BuiltDisplayList dl;
|
||||
wr::LayoutSize builderContentSize;
|
||||
builder.Finalize(builderContentSize, dl);
|
||||
txn.SetDisplayList(
|
||||
gfx::Color(0.f, 0.f, 0.f, 0.f), epoch,
|
||||
wr::ToLayoutSize(pipeline->mScBounds.Size()),
|
||||
aPipelineId, builderContentSize, dl.dl_desc, dl.dl);
|
||||
txn.SetDisplayList(gfx::Color(0.f, 0.f, 0.f, 0.f), epoch,
|
||||
wr::ToLayoutSize(pipeline->mScBounds.Size()), aPipelineId,
|
||||
builderContentSize, dl.dl_desc, dl.dl);
|
||||
}
|
||||
|
||||
void AsyncImagePipelineManager::HoldExternalImage(
|
||||
|
|
|
@ -249,8 +249,7 @@ bool ShmSegmentsReader::Read(const layers::OffsetRange& aRange,
|
|||
}
|
||||
|
||||
IpcResourceUpdateQueue::IpcResourceUpdateQueue(
|
||||
layers::WebRenderBridgeChild* aAllocator,
|
||||
wr::RenderRoot aRenderRoot,
|
||||
layers::WebRenderBridgeChild* aAllocator, wr::RenderRoot aRenderRoot,
|
||||
size_t aChunkSize)
|
||||
: mWriter(aAllocator, aChunkSize), mRenderRoot(aRenderRoot) {}
|
||||
|
||||
|
@ -276,8 +275,7 @@ IpcResourceUpdateQueue& IpcResourceUpdateQueue::operator=(
|
|||
return *this;
|
||||
}
|
||||
|
||||
void IpcResourceUpdateQueue::ReplaceResources(
|
||||
IpcResourceUpdateQueue&& aOther) {
|
||||
void IpcResourceUpdateQueue::ReplaceResources(IpcResourceUpdateQueue&& aOther) {
|
||||
MOZ_ASSERT(IsEmpty(), "Will forget existing updates!");
|
||||
MOZ_ASSERT(!aOther.HasAnySubQueue(), "Subqueues will be lost!");
|
||||
MOZ_ASSERT(mRenderRoot == aOther.mRenderRoot);
|
||||
|
|
|
@ -11,65 +11,61 @@
|
|||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
void IPDLParamTraits<mozilla::layers::RenderRootDisplayListData>::Write(IPC::Message* aMsg,
|
||||
IProtocol* aActor,
|
||||
paramType&& aParam) {
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mRenderRoot);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mRect);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mCommands);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mContentSize);
|
||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mDL));
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mDLDesc);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mResourceUpdates);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mSmallShmems);
|
||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mLargeShmems));
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollData);
|
||||
void IPDLParamTraits<mozilla::layers::RenderRootDisplayListData>::Write(
|
||||
IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam) {
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mRenderRoot);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mRect);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mCommands);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mContentSize);
|
||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mDL));
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mDLDesc);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mResourceUpdates);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mSmallShmems);
|
||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mLargeShmems));
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollData);
|
||||
}
|
||||
|
||||
bool IPDLParamTraits<mozilla::layers::RenderRootDisplayListData>::Read(const IPC::Message* aMsg,
|
||||
PickleIterator* aIter,
|
||||
IProtocol* aActor,
|
||||
paramType* aResult) {
|
||||
if (ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRenderRoot) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRect) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCommands) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mContentSize) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDL) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDLDesc) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResourceUpdates) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSmallShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLargeShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollData)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
bool IPDLParamTraits<mozilla::layers::RenderRootDisplayListData>::Read(
|
||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
||||
paramType* aResult) {
|
||||
if (ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRenderRoot) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRect) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCommands) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mContentSize) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDL) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mDLDesc) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResourceUpdates) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSmallShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLargeShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollData)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void IPDLParamTraits<mozilla::layers::RenderRootUpdates>::Write(IPC::Message* aMsg,
|
||||
IProtocol* aActor,
|
||||
paramType&& aParam) {
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mRenderRoot);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mCommands);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mResourceUpdates);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mSmallShmems);
|
||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mLargeShmems));
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollUpdates);
|
||||
void IPDLParamTraits<mozilla::layers::RenderRootUpdates>::Write(
|
||||
IPC::Message* aMsg, IProtocol* aActor, paramType&& aParam) {
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mRenderRoot);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mCommands);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mResourceUpdates);
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mSmallShmems);
|
||||
WriteIPDLParam(aMsg, aActor, std::move(aParam.mLargeShmems));
|
||||
WriteIPDLParam(aMsg, aActor, aParam.mScrollUpdates);
|
||||
}
|
||||
|
||||
bool IPDLParamTraits<mozilla::layers::RenderRootUpdates>::Read(const IPC::Message* aMsg,
|
||||
PickleIterator* aIter,
|
||||
IProtocol* aActor,
|
||||
paramType* aResult) {
|
||||
if (ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRenderRoot) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCommands) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResourceUpdates) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSmallShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLargeShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollUpdates)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
bool IPDLParamTraits<mozilla::layers::RenderRootUpdates>::Read(
|
||||
const IPC::Message* aMsg, PickleIterator* aIter, IProtocol* aActor,
|
||||
paramType* aResult) {
|
||||
if (ReadIPDLParam(aMsg, aIter, aActor, &aResult->mRenderRoot) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mCommands) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mResourceUpdates) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mSmallShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mLargeShmems) &&
|
||||
ReadIPDLParam(aMsg, aIter, aActor, &aResult->mScrollUpdates)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -111,9 +111,9 @@ struct ParamTraits<mozilla::wr::LayoutPoint>
|
|||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::wr::RenderRoot>
|
||||
: public ContiguousEnumSerializerInclusive<mozilla::wr::RenderRoot,
|
||||
mozilla::wr::RenderRoot::Default,
|
||||
mozilla::wr::kHighestRenderRoot> {};
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::wr::RenderRoot, mozilla::wr::RenderRoot::Default,
|
||||
mozilla::wr::kHighestRenderRoot> {};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::wr::ImageRendering>
|
||||
|
|
|
@ -372,8 +372,8 @@ WebRenderCanvasRendererAsync* WebRenderCanvasData::CreateCanvasRenderer() {
|
|||
return mCanvasRenderer.get();
|
||||
}
|
||||
|
||||
WebRenderRenderRootData::WebRenderRenderRootData(RenderRootStateManager* aManager,
|
||||
nsDisplayItem* aItem)
|
||||
WebRenderRenderRootData::WebRenderRenderRootData(
|
||||
RenderRootStateManager* aManager, nsDisplayItem* aItem)
|
||||
: WebRenderUserData(aManager, aItem) {}
|
||||
|
||||
RenderRootBoundary& WebRenderRenderRootData::EnsureHasBoundary(
|
||||
|
|
|
@ -97,8 +97,7 @@ class FontPropertyValue {
|
|||
: mValue(std::round(aValue * kScale)) {
|
||||
MOZ_ASSERT(aValue >= kMin && aValue <= kMax);
|
||||
}
|
||||
explicit constexpr FontPropertyValue(int aValue)
|
||||
: mValue(aValue * kScale) {
|
||||
explicit constexpr FontPropertyValue(int aValue) : mValue(aValue * kScale) {
|
||||
MOZ_ASSERT(aValue >= Min && aValue <= Max);
|
||||
}
|
||||
|
||||
|
|
|
@ -2919,7 +2919,8 @@ bool gfxPlatform::IsInLayoutAsapMode() {
|
|||
|
||||
/* static */
|
||||
bool gfxPlatform::ForceSoftwareVsync() {
|
||||
return gfxPrefs::LayoutFrameRate() > 0 || recordreplay::IsRecordingOrReplaying();
|
||||
return gfxPrefs::LayoutFrameRate() > 0 ||
|
||||
recordreplay::IsRecordingOrReplaying();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -2932,9 +2933,7 @@ int gfxPlatform::GetSoftwareVsyncRate() {
|
|||
}
|
||||
|
||||
/* static */
|
||||
int gfxPlatform::GetDefaultFrameRate() {
|
||||
return 60;
|
||||
}
|
||||
int gfxPlatform::GetDefaultFrameRate() { return 60; }
|
||||
|
||||
/* static */
|
||||
void gfxPlatform::ReInitFrameRate() {
|
||||
|
|
|
@ -1472,8 +1472,7 @@ bool gfxUtils::DumpDisplayList() {
|
|||
}
|
||||
|
||||
wr::RenderRoot gfxUtils::GetContentRenderRoot() {
|
||||
if (gfx::gfxVars::UseWebRender() &&
|
||||
gfxPrefs::WebRenderSplitRenderRoots()) {
|
||||
if (gfx::gfxVars::UseWebRender() && gfxPrefs::WebRenderSplitRenderRoots()) {
|
||||
return wr::RenderRoot::Content;
|
||||
}
|
||||
return wr::RenderRoot::Default;
|
||||
|
@ -1489,7 +1488,8 @@ Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForFrame(const nsIFrame* aFrame) {
|
|||
return gfxUtils::GetRenderRootForElement(aFrame->GetContent()->AsElement());
|
||||
}
|
||||
|
||||
Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForElement(const dom::Element* aElement) {
|
||||
Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForElement(
|
||||
const dom::Element* aElement) {
|
||||
if (!aElement) {
|
||||
return Nothing();
|
||||
}
|
||||
|
@ -1499,21 +1499,20 @@ Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForElement(const dom::Element* aEle
|
|||
if (!aElement->IsXULElement()) {
|
||||
return Nothing();
|
||||
}
|
||||
if (aElement->AttrValueIs(
|
||||
kNameSpaceID_None, nsGkAtoms::renderroot,
|
||||
NS_LITERAL_STRING("content"), eCaseMatters)) {
|
||||
if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::renderroot,
|
||||
NS_LITERAL_STRING("content"), eCaseMatters)) {
|
||||
return Some(wr::RenderRoot::Content);
|
||||
}
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForFrame(const nsIFrame* aFrame) {
|
||||
wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForFrame(
|
||||
const nsIFrame* aFrame) {
|
||||
if (!gfxVars::UseWebRender() || !gfxPrefs::WebRenderSplitRenderRoots()) {
|
||||
return wr::RenderRoot::Default;
|
||||
}
|
||||
|
||||
for (const nsIFrame* current = aFrame;
|
||||
current;
|
||||
for (const nsIFrame* current = aFrame; current;
|
||||
current = current->GetParent()) {
|
||||
auto renderRoot = gfxUtils::GetRenderRootForFrame(current);
|
||||
if (renderRoot) {
|
||||
|
@ -1524,13 +1523,13 @@ wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForFrame(const nsIFrame* aFrame
|
|||
return wr::RenderRoot::Default;
|
||||
}
|
||||
|
||||
wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForElement(const dom::Element* aElement) {
|
||||
wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForElement(
|
||||
const dom::Element* aElement) {
|
||||
if (!gfxVars::UseWebRender() || !gfxPrefs::WebRenderSplitRenderRoots()) {
|
||||
return wr::RenderRoot::Default;
|
||||
}
|
||||
|
||||
for (const dom::Element* current = aElement;
|
||||
current;
|
||||
for (const dom::Element* current = aElement; current;
|
||||
current = current->GetParentElement()) {
|
||||
auto renderRoot = gfxUtils::GetRenderRootForElement(current);
|
||||
if (renderRoot) {
|
||||
|
|
|
@ -316,10 +316,14 @@ class gfxUtils {
|
|||
|
||||
static mozilla::wr::RenderRoot GetContentRenderRoot();
|
||||
|
||||
static mozilla::Maybe<mozilla::wr::RenderRoot> GetRenderRootForFrame(const nsIFrame* aFrame);
|
||||
static mozilla::Maybe<mozilla::wr::RenderRoot> GetRenderRootForElement(const mozilla::dom::Element* aElement);
|
||||
static mozilla::wr::RenderRoot RecursivelyGetRenderRootForFrame(const nsIFrame* aFrame);
|
||||
static mozilla::wr::RenderRoot RecursivelyGetRenderRootForElement(const mozilla::dom::Element* aElement);
|
||||
static mozilla::Maybe<mozilla::wr::RenderRoot> GetRenderRootForFrame(
|
||||
const nsIFrame* aFrame);
|
||||
static mozilla::Maybe<mozilla::wr::RenderRoot> GetRenderRootForElement(
|
||||
const mozilla::dom::Element* aElement);
|
||||
static mozilla::wr::RenderRoot RecursivelyGetRenderRootForFrame(
|
||||
const nsIFrame* aFrame);
|
||||
static mozilla::wr::RenderRoot RecursivelyGetRenderRootForElement(
|
||||
const mozilla::dom::Element* aElement);
|
||||
};
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -161,7 +161,8 @@ enum class VRDisplayCapabilityFlags : uint16_t {
|
|||
Cap_MountDetection = 1 << 8,
|
||||
/**
|
||||
* Cap_PositionEmulated is set if the VRDisplay is capable of setting a
|
||||
* emulated position (e.g. neck model) even if still doesn't support 6DOF tracking.
|
||||
* emulated position (e.g. neck model) even if still doesn't support 6DOF
|
||||
* tracking.
|
||||
*/
|
||||
Cap_PositionEmulated = 1 << 9,
|
||||
/**
|
||||
|
|
|
@ -511,7 +511,8 @@ void RenderThread::DecPendingFrameCount(wr::WindowId aWindowId) {
|
|||
info->mStartIds.pop();
|
||||
}
|
||||
|
||||
mozilla::Pair<bool, bool> RenderThread::IncRenderingFrameCount(wr::WindowId aWindowId, bool aRender) {
|
||||
mozilla::Pair<bool, bool> RenderThread::IncRenderingFrameCount(
|
||||
wr::WindowId aWindowId, bool aRender) {
|
||||
auto windows = mWindowInfos.Lock();
|
||||
auto it = windows->find(AsUint64(aWindowId));
|
||||
if (it == windows->end()) {
|
||||
|
@ -894,7 +895,8 @@ void wr_schedule_render(mozilla::wr::WrWindowId aWindowId,
|
|||
RefPtr<mozilla::layers::CompositorBridgeParent> cbp = mozilla::layers::
|
||||
CompositorBridgeParent::GetCompositorBridgeParentFromWindowId(aWindowId);
|
||||
if (cbp) {
|
||||
cbp->ScheduleRenderOnCompositorThread(Some(wr::RenderRootFromId(aDocumentId)));
|
||||
cbp->ScheduleRenderOnCompositorThread(
|
||||
Some(wr::RenderRootFromId(aDocumentId)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,9 +169,8 @@ void TransactionBuilder::SetDisplayList(
|
|||
wr::WrPipelineId pipeline_id, const wr::LayoutSize& content_size,
|
||||
wr::BuiltDisplayListDescriptor dl_descriptor, wr::Vec<uint8_t>& dl_data) {
|
||||
wr_transaction_set_display_list(mTxn, aEpoch, ToColorF(aBgColor),
|
||||
aViewportSize,
|
||||
pipeline_id, content_size, dl_descriptor,
|
||||
&dl_data.inner);
|
||||
aViewportSize, pipeline_id, content_size,
|
||||
dl_descriptor, &dl_data.inner);
|
||||
}
|
||||
|
||||
void TransactionBuilder::ClearDisplayList(Epoch aEpoch,
|
||||
|
|
|
@ -61,29 +61,29 @@ struct ExternalImageKeyPair {
|
|||
/* Generate a brand new window id and return it. */
|
||||
WindowId NewWindowId();
|
||||
|
||||
MOZ_DEFINE_ENUM_CLASS_WITH_BASE(RenderRoot, uint8_t, (
|
||||
// The default render root - within the parent process, this refers
|
||||
// to everything within the top chrome area (urlbar, tab strip, etc.).
|
||||
// Within the content process, this refers to the content area. Any
|
||||
// system that multiplexes data streams from different processes is
|
||||
// responsible for converting RenderRoot::Default into
|
||||
// RenderRoot::Content (or whatever value is appropriate)
|
||||
Default,
|
||||
MOZ_DEFINE_ENUM_CLASS_WITH_BASE(
|
||||
RenderRoot, uint8_t,
|
||||
(
|
||||
// The default render root - within the parent process, this refers
|
||||
// to everything within the top chrome area (urlbar, tab strip, etc.).
|
||||
// Within the content process, this refers to the content area. Any
|
||||
// system that multiplexes data streams from different processes is
|
||||
// responsible for converting RenderRoot::Default into
|
||||
// RenderRoot::Content (or whatever value is appropriate)
|
||||
Default,
|
||||
|
||||
// Everything below the chrome - even if it is not coming from a content
|
||||
// process. For example. the devtools, sidebars, and status panel are
|
||||
// traditionally part of the "chrome," but are assigned a renderroot of
|
||||
// RenderRoot::Content because they occupy screen space in the "content"
|
||||
// area of the browser (visually situated below the "chrome" area).
|
||||
Content
|
||||
));
|
||||
// Everything below the chrome - even if it is not coming from a content
|
||||
// process. For example. the devtools, sidebars, and status panel are
|
||||
// traditionally part of the "chrome," but are assigned a renderroot of
|
||||
// RenderRoot::Content because they occupy screen space in the "content"
|
||||
// area of the browser (visually situated below the "chrome" area).
|
||||
Content));
|
||||
|
||||
typedef EnumSet<RenderRoot, uint8_t> RenderRootSet;
|
||||
|
||||
// For simple iteration of all render roots
|
||||
const Array<RenderRoot, kRenderRootCount> kRenderRoots(
|
||||
RenderRoot::Default,
|
||||
RenderRoot::Content);
|
||||
const Array<RenderRoot, kRenderRootCount> kRenderRoots(RenderRoot::Default,
|
||||
RenderRoot::Content);
|
||||
|
||||
const Array<RenderRoot, kRenderRootCount - 1> kNonDefaultRenderRoots(
|
||||
RenderRoot::Content);
|
||||
|
@ -91,12 +91,13 @@ const Array<RenderRoot, kRenderRootCount - 1> kNonDefaultRenderRoots(
|
|||
template <typename T>
|
||||
class RenderRootArray : public Array<T, kRenderRootCount> {
|
||||
typedef Array<T, kRenderRootCount> Super;
|
||||
|
||||
public:
|
||||
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
|
||||
} // else C++ will default-initialize the array elements for us
|
||||
}
|
||||
|
||||
T& operator[](wr::RenderRoot aIndex) {
|
||||
|
@ -114,6 +115,7 @@ class RenderRootArray : public Array<T, kRenderRootCount> {
|
|||
template <typename T>
|
||||
class NonDefaultRenderRootArray : public Array<T, kRenderRootCount - 1> {
|
||||
typedef Array<T, kRenderRootCount - 1> Super;
|
||||
|
||||
public:
|
||||
NonDefaultRenderRootArray() {
|
||||
// See RenderRootArray constructor
|
||||
|
|
|
@ -10698,7 +10698,6 @@ nsContainerFrame* nsCSSFrameConstructor::BeginBuildingColumns(
|
|||
nsContainerFrame* columnSetFrame = NS_NewColumnSetFrame(
|
||||
mPresShell, aComputedStyle, nsFrameState(NS_FRAME_OWNS_ANON_BOXES));
|
||||
InitAndRestoreFrame(aState, aContent, aParentFrame, columnSetFrame);
|
||||
SetInitialSingleChild(columnSetFrame, aColumnContent);
|
||||
|
||||
RefPtr<ComputedStyle> anonBlockStyle =
|
||||
mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle(
|
||||
|
@ -10706,6 +10705,7 @@ nsContainerFrame* nsCSSFrameConstructor::BeginBuildingColumns(
|
|||
aColumnContent->SetComputedStyleWithoutNotification(anonBlockStyle);
|
||||
InitAndRestoreFrame(aState, aContent, columnSetFrame, aColumnContent);
|
||||
|
||||
SetInitialSingleChild(columnSetFrame, aColumnContent);
|
||||
return columnSetFrame;
|
||||
}
|
||||
|
||||
|
|
|
@ -1338,6 +1338,11 @@ void nsComboboxControlFrame::GetChildLists(nsTArray<ChildList>* aLists) const {
|
|||
|
||||
void nsComboboxControlFrame::SetInitialChildList(ChildListID aListID,
|
||||
nsFrameList& aChildList) {
|
||||
#ifdef DEBUG
|
||||
for (nsIFrame* f : aChildList) {
|
||||
MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
|
||||
}
|
||||
#endif
|
||||
if (kSelectPopupList == aListID) {
|
||||
mPopupFrames.SetFrames(aChildList);
|
||||
} else {
|
||||
|
|
|
@ -49,6 +49,9 @@ void nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame,
|
|||
MOZ_ASSERT(mChildListID == aListID, "unexpected child list name");
|
||||
#ifdef DEBUG
|
||||
nsFrame::VerifyDirtyBitSet(aChildList);
|
||||
for (nsIFrame* f : aChildList) {
|
||||
MOZ_ASSERT(f->GetParent() == aDelegatingFrame, "Unexpected parent");
|
||||
}
|
||||
#endif
|
||||
mAbsoluteFrames.SetFrames(aChildList);
|
||||
}
|
||||
|
|
|
@ -65,6 +65,9 @@ void nsContainerFrame::SetInitialChildList(ChildListID aListID,
|
|||
nsFrameList& aChildList) {
|
||||
#ifdef DEBUG
|
||||
nsFrame::VerifyDirtyBitSet(aChildList);
|
||||
for (nsIFrame* f : aChildList) {
|
||||
MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
|
||||
}
|
||||
#endif
|
||||
if (aListID == kPrincipalList) {
|
||||
MOZ_ASSERT(mFrames.IsEmpty(),
|
||||
|
|
|
@ -114,6 +114,11 @@ void nsTableColGroupFrame::SetInitialChildList(ChildListID aListID,
|
|||
MOZ_ASSERT(mFrames.IsEmpty(),
|
||||
"unexpected second call to SetInitialChildList");
|
||||
MOZ_ASSERT(aListID == kPrincipalList, "unexpected child list");
|
||||
#ifdef DEBUG
|
||||
for (nsIFrame* f : aChildList) {
|
||||
MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
|
||||
}
|
||||
#endif
|
||||
if (aChildList.IsEmpty()) {
|
||||
GetTableFrame()->AppendAnonymousColFrames(this, GetSpan(),
|
||||
eColAnonymousColGroup, false);
|
||||
|
|
|
@ -314,6 +314,11 @@ void nsTableFrame::SetInitialChildList(ChildListID aListID,
|
|||
|
||||
MOZ_ASSERT(mFrames.IsEmpty() && mColGroups.IsEmpty(),
|
||||
"unexpected second call to SetInitialChildList");
|
||||
#ifdef DEBUG
|
||||
for (nsIFrame* f : aChildList) {
|
||||
MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
|
||||
}
|
||||
#endif
|
||||
|
||||
// XXXbz the below code is an icky cesspit that's only needed in its current
|
||||
// form for two reasons:
|
||||
|
|
|
@ -82,6 +82,12 @@ void nsTableWrapperFrame::GetChildLists(nsTArray<ChildList>* aLists) const {
|
|||
void nsTableWrapperFrame::SetInitialChildList(ChildListID aListID,
|
||||
nsFrameList& aChildList) {
|
||||
if (kCaptionList == aListID) {
|
||||
#ifdef DEBUG
|
||||
nsFrame::VerifyDirtyBitSet(aChildList);
|
||||
for (nsIFrame* f : aChildList) {
|
||||
MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
|
||||
}
|
||||
#endif
|
||||
// the frame constructor already checked for table-caption display type
|
||||
MOZ_ASSERT(mCaptionFrames.IsEmpty(),
|
||||
"already have child frames in CaptionList");
|
||||
|
|
|
@ -269,6 +269,11 @@ void nsMenuFrame::SetInitialChildList(ChildListID aListID,
|
|||
nsFrameList& aChildList) {
|
||||
if (aListID == kPrincipalList || aListID == kPopupList) {
|
||||
NS_ASSERTION(!HasPopup(), "SetInitialChildList called twice?");
|
||||
#ifdef DEBUG
|
||||
for (nsIFrame* f : aChildList) {
|
||||
MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
|
||||
}
|
||||
#endif
|
||||
SetPopupFrame(aChildList);
|
||||
}
|
||||
nsBoxFrame::SetInitialChildList(aListID, aChildList);
|
||||
|
|
|
@ -399,7 +399,8 @@ class BufferList : private AllocPolicy {
|
|||
};
|
||||
|
||||
template <typename AllocPolicy>
|
||||
MOZ_MUST_USE bool BufferList<AllocPolicy>::WriteBytes(const char* aData, size_t aSize) {
|
||||
MOZ_MUST_USE bool BufferList<AllocPolicy>::WriteBytes(const char* aData,
|
||||
size_t aSize) {
|
||||
MOZ_RELEASE_ASSERT(mOwning);
|
||||
MOZ_RELEASE_ASSERT(mStandardCapacity);
|
||||
|
||||
|
|
|
@ -52,10 +52,9 @@ class nsFilePicker : public nsBaseFilePicker {
|
|||
// aFile is an existing but unspecified file. These functions must specify it.
|
||||
//
|
||||
// will return |returnCancel| or |returnOK| as result.
|
||||
int16_t GetLocalFiles(const nsString& inTitle, bool inAllowMultiple,
|
||||
nsCOMArray<nsIFile>& outFiles);
|
||||
int16_t GetLocalFolder(const nsString& inTitle, nsIFile** outFile);
|
||||
int16_t PutLocalFile(const nsString& inTitle, const nsString& inDefaultName, nsIFile** outFile);
|
||||
int16_t GetLocalFiles(bool inAllowMultiple, nsCOMArray<nsIFile>& outFiles);
|
||||
int16_t GetLocalFolder(nsIFile** outFile);
|
||||
int16_t PutLocalFile(nsIFile** outFile);
|
||||
|
||||
void SetDialogTitle(const nsString& inTitle, id aDialog);
|
||||
NSString* PanelDefaultDirectory();
|
||||
|
@ -63,7 +62,7 @@ class nsFilePicker : public nsBaseFilePicker {
|
|||
|
||||
nsString mTitle;
|
||||
nsCOMArray<nsIFile> mFiles;
|
||||
nsString mDefault;
|
||||
nsString mDefaultFilename;
|
||||
|
||||
nsTArray<nsString> mFilters;
|
||||
nsTArray<nsString> mTitles;
|
||||
|
|
|
@ -190,34 +190,26 @@ nsresult nsFilePicker::Show(int16_t* retval) {
|
|||
|
||||
int16_t userClicksOK = returnCancel;
|
||||
|
||||
// Random questions from DHH:
|
||||
//
|
||||
// Why do we pass mTitle, mDefault to the functions? Can GetLocalFile. PutLocalFile,
|
||||
// and GetLocalFolder get called someplace else? It generates a bunch of warnings
|
||||
// as it is right now.
|
||||
//
|
||||
// I think we could easily combine GetLocalFile and GetLocalFolder together, just
|
||||
// setting panel pick options based on mMode. I didn't do it here b/c I wanted to
|
||||
// make this look as much like Carbon nsFilePicker as possible.
|
||||
|
||||
mFiles.Clear();
|
||||
nsCOMPtr<nsIFile> theFile;
|
||||
|
||||
// Note that GetLocalFolder shares a lot of code with GetLocalFiles.
|
||||
// Could combine the functions and just pass the mode in.
|
||||
switch (mMode) {
|
||||
case modeOpen:
|
||||
userClicksOK = GetLocalFiles(mTitle, false, mFiles);
|
||||
userClicksOK = GetLocalFiles(false, mFiles);
|
||||
break;
|
||||
|
||||
case modeOpenMultiple:
|
||||
userClicksOK = GetLocalFiles(mTitle, true, mFiles);
|
||||
userClicksOK = GetLocalFiles(true, mFiles);
|
||||
break;
|
||||
|
||||
case modeSave:
|
||||
userClicksOK = PutLocalFile(mTitle, mDefault, getter_AddRefs(theFile));
|
||||
userClicksOK = PutLocalFile(getter_AddRefs(theFile));
|
||||
break;
|
||||
|
||||
case modeGetFolder:
|
||||
userClicksOK = GetLocalFolder(mTitle, getter_AddRefs(theFile));
|
||||
userClicksOK = GetLocalFolder(getter_AddRefs(theFile));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -266,8 +258,7 @@ static void UpdatePanelFileTypes(NSOpenPanel* aPanel, NSArray* aFilters) {
|
|||
@end
|
||||
|
||||
// Use OpenPanel to do a GetFile. Returns |returnOK| if the user presses OK in the dialog.
|
||||
int16_t nsFilePicker::GetLocalFiles(const nsString& inTitle, bool inAllowMultiple,
|
||||
nsCOMArray<nsIFile>& outFiles) {
|
||||
int16_t nsFilePicker::GetLocalFiles(bool inAllowMultiple, nsCOMArray<nsIFile>& outFiles) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
||||
int16_t retVal = (int16_t)returnCancel;
|
||||
|
@ -276,12 +267,12 @@ int16_t nsFilePicker::GetLocalFiles(const nsString& inTitle, bool inAllowMultipl
|
|||
SetShowHiddenFileState(thePanel);
|
||||
|
||||
// Set the options for how the get file dialog will appear
|
||||
SetDialogTitle(inTitle, thePanel);
|
||||
SetDialogTitle(mTitle, thePanel);
|
||||
[thePanel setAllowsMultipleSelection:inAllowMultiple];
|
||||
[thePanel setCanSelectHiddenExtension:YES];
|
||||
[thePanel setCanChooseDirectories:NO];
|
||||
[thePanel setCanChooseFiles:YES];
|
||||
[thePanel setResolvesAliases:YES]; // this is default - probably doesn't need to be set
|
||||
[thePanel setResolvesAliases:YES];
|
||||
|
||||
// Get filters
|
||||
// filters may be null, if we should allow all file types.
|
||||
|
@ -366,7 +357,7 @@ int16_t nsFilePicker::GetLocalFiles(const nsString& inTitle, bool inAllowMultipl
|
|||
}
|
||||
|
||||
// Use OpenPanel to do a GetFolder. Returns |returnOK| if the user presses OK in the dialog.
|
||||
int16_t nsFilePicker::GetLocalFolder(const nsString& inTitle, nsIFile** outFile) {
|
||||
int16_t nsFilePicker::GetLocalFolder(nsIFile** outFile) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
NS_ASSERTION(outFile, "this protected member function expects a null initialized out pointer");
|
||||
|
||||
|
@ -376,12 +367,12 @@ int16_t nsFilePicker::GetLocalFolder(const nsString& inTitle, nsIFile** outFile)
|
|||
SetShowHiddenFileState(thePanel);
|
||||
|
||||
// Set the options for how the get file dialog will appear
|
||||
SetDialogTitle(inTitle, thePanel);
|
||||
[thePanel setAllowsMultipleSelection:NO]; // this is default -probably doesn't need to be set
|
||||
SetDialogTitle(mTitle, thePanel);
|
||||
[thePanel setAllowsMultipleSelection:NO];
|
||||
[thePanel setCanSelectHiddenExtension:YES];
|
||||
[thePanel setCanChooseDirectories:YES];
|
||||
[thePanel setCanChooseFiles:NO];
|
||||
[thePanel setResolvesAliases:YES]; // this is default - probably doesn't need to be set
|
||||
[thePanel setResolvesAliases:YES];
|
||||
[thePanel setCanCreateDirectories:YES];
|
||||
|
||||
// packages != folders
|
||||
|
@ -417,8 +408,7 @@ int16_t nsFilePicker::GetLocalFolder(const nsString& inTitle, nsIFile** outFile)
|
|||
}
|
||||
|
||||
// Returns |returnOK| if the user presses OK in the dialog.
|
||||
int16_t nsFilePicker::PutLocalFile(const nsString& inTitle, const nsString& inDefaultName,
|
||||
nsIFile** outFile) {
|
||||
int16_t nsFilePicker::PutLocalFile(nsIFile** outFile) {
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
NS_ASSERTION(outFile, "this protected member function expects a null initialized out pointer");
|
||||
|
||||
|
@ -427,15 +417,15 @@ int16_t nsFilePicker::PutLocalFile(const nsString& inTitle, const nsString& inDe
|
|||
|
||||
SetShowHiddenFileState(thePanel);
|
||||
|
||||
SetDialogTitle(inTitle, thePanel);
|
||||
SetDialogTitle(mTitle, thePanel);
|
||||
|
||||
// set up accessory view for file format options
|
||||
NSView* accessoryView = GetAccessoryView();
|
||||
[thePanel setAccessoryView:accessoryView];
|
||||
|
||||
// set up default file name
|
||||
NSString* defaultFilename = [NSString stringWithCharacters:(const unichar*)inDefaultName.get()
|
||||
length:inDefaultName.Length()];
|
||||
NSString* defaultFilename = [NSString stringWithCharacters:(const unichar*)mDefaultFilename.get()
|
||||
length:mDefaultFilename.Length()];
|
||||
|
||||
// Set up the allowed type. This prevents the extension from being selected.
|
||||
NSString* extension = defaultFilename.pathExtension;
|
||||
|
@ -609,7 +599,7 @@ NS_IMETHODIMP nsFilePicker::GetFiles(nsISimpleEnumerator** aFiles) {
|
|||
}
|
||||
|
||||
NS_IMETHODIMP nsFilePicker::SetDefaultString(const nsAString& aString) {
|
||||
mDefault = aString;
|
||||
mDefaultFilename = aString;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -2629,6 +2629,10 @@ void nsCycleCollector::ForgetSkippable(js::SliceBudget& aBudget,
|
|||
bool aAsyncSnowWhiteFreeing) {
|
||||
CheckThreadSafety();
|
||||
|
||||
if (mFreeingSnowWhite) {
|
||||
return;
|
||||
}
|
||||
|
||||
mozilla::Maybe<mozilla::AutoGlobalTimelineMarker> marker;
|
||||
if (NS_IsMainThread()) {
|
||||
marker.emplace("nsCycleCollector::ForgetSkippable",
|
||||
|
|
Загрузка…
Ссылка в новой задаче