Bug 1665289 - Convert WebGLChild's kDefaultCmdsShmemSize to a pref. r=lsalzman

Also reduce it from 100KB to 10KB, since we want more concurrency.

Differential Revision: https://phabricator.services.mozilla.com/D90358
This commit is contained in:
unknown 2020-09-16 15:22:22 +00:00
Родитель abe6d1a340
Коммит 456d695946
3 изменённых файлов: 11 добавлений и 4 удалений

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

@ -6,12 +6,15 @@
#include "WebGLChild.h"
#include "ClientWebGLContext.h"
#include "mozilla/StaticPrefs_webgl.h"
#include "WebGLMethodDispatcher.h"
namespace mozilla {
namespace dom {
WebGLChild::WebGLChild(ClientWebGLContext& context) : mContext(&context) {}
WebGLChild::WebGLChild(ClientWebGLContext& context)
: mContext(&context),
mDefaultCmdsShmemSize(StaticPrefs::webgl_out_of_process_shmem_size()) {}
WebGLChild::~WebGLChild() { (void)Send__delete__(this); }
@ -21,11 +24,9 @@ void WebGLChild::ActorDestroy(ActorDestroyReason why) {
// -
static constexpr size_t kDefaultCmdsShmemSize = 100 * 1000;
Maybe<Range<uint8_t>> WebGLChild::AllocPendingCmdBytes(const size_t size) {
if (!mPendingCmdsShmem) {
size_t capacity = kDefaultCmdsShmemSize;
size_t capacity = mDefaultCmdsShmemSize;
if (capacity < size) {
capacity = size;
}

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

@ -34,6 +34,7 @@ struct FlushedCmdInfo final {
class WebGLChild final : public PWebGLChild, public SupportsWeakPtr {
const WeakPtr<ClientWebGLContext> mContext;
const size_t mDefaultCmdsShmemSize;
webgl::RaiiShmem mPendingCmdsShmem;
size_t mPendingCmdsPos = 0;
FlushedCmdInfo mFlushedCmdInfo;

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

@ -9937,6 +9937,11 @@
value: false
mirror: always
- name: webgl.out-of-process.shmem-size
type: RelaxedAtomicUint32
value: 10000 # 10KB
mirror: always
- name: webgl.power-preference-override
type: RelaxedAtomicInt32
value: 0