/* -*- Mode: C++; tab-width: 20; 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/. */#ifndef GFX_PLATFORM_H#define GFX_PLATFORM_H#include"mozilla/FontPropertyTypes.h"#include"mozilla/Logging.h"#include"mozilla/gfx/Types.h"#include"nsTArray.h"#include"nsString.h"#include"nsCOMPtr.h"#include"nsUnicodeScriptCodes.h"#include"gfxTypes.h"#include"gfxFontFamilyList.h"#include"gfxBlur.h"#include"gfxSkipChars.h"#include"nsRect.h"#include"qcms.h"#include"mozilla/RefPtr.h"#include"GfxInfoCollector.h"#include"mozilla/layers/CompositorTypes.h"#include"mozilla/layers/MemoryPressureObserver.h"classgfxASurface;classgfxFont;classgfxFontGroup;structgfxFontStyle;classgfxUserFontSet;classgfxFontEntry;classgfxPlatformFontList;classgfxTextRun;classnsIURI;classnsAtom;classnsIObserver;classSRGBOverrideObserver;classgfxTextPerfMetrics;typedefstructFT_LibraryRec_*FT_Library;namespacemozilla{namespacegl{classSkiaGLGlue;}// namespace glnamespacegfx{classDrawTarget;classSourceSurface;classDataSourceSurface;classScaledFont;classDrawEventRecorder;classVsyncSource;classContentDeviceData;classGPUDeviceData;classFeatureState;inlineuint32_tBackendTypeBit(BackendTypeb){return1<<uint8_t(b);}}// namespace gfxnamespacedom{classSystemFontListEntry;}}// namespace mozilla#define MOZ_PERFORMANCE_WARNING(module, ...) \ do { \ if (gfxPlatform::PerfWarnings()) { \ printf_stderr("[" module "] " __VA_ARGS__); \ } \ } while (0)enumeCMSMode{eCMSMode_Off=0,// No color managementeCMSMode_All=1,// Color manage everythingeCMSMode_TaggedOnly=2,// Color manage tagged Images OnlyeCMSMode_AllCount=3};enumeGfxLog{// all font enumerations, localized names, fullname/psnames, cmap loadseGfxLog_fontlist=0,// timing info on font initializationeGfxLog_fontinit=1,// dump text runs, font matching, system fallback for contenteGfxLog_textrun=2,// dump text runs, font matching, system fallback for chromeeGfxLog_textrunui=3,// dump cmap coverage data as they are loadedeGfxLog_cmapdata=4,// text perf dataeGfxLog_textperf=5};// when searching through pref langs, max number of pref langsconstuint32_tkMaxLenPrefLangList=32;#define UNINITIALIZED_VALUE (-1)inlineconstchar*GetBackendName(mozilla::gfx::BackendTypeaBackend){switch(aBackend){casemozilla::gfx::BackendType::DIRECT2D:return"direct2d";casemozilla::gfx::BackendType::CAIRO:return"cairo";casemozilla::gfx::BackendType::SKIA:return"skia";casemozilla::gfx::BackendType::RECORDING:return"recording";casemozilla::gfx::BackendType::DIRECT2D1_1:return"direct2d 1.1";casemozilla::gfx::BackendType::WEBRENDER_TEXT:return"webrender text";casemozilla::gfx::BackendType::NONE:return"none";casemozilla::gfx::BackendType::BACKEND_LAST:return"invalid";}MOZ_CRASH("Incomplete switch");}enumclassDeviceResetReason{OK=0,HUNG,REMOVED,RESET,DRIVER_ERROR,INVALID_CALL,OUT_OF_MEMORY,FORCED_RESET,UNKNOWN,D3D9_RESET};enumclassForcedDeviceResetReason{OPENSHAREDHANDLE=0,COMPOSITOR_UPDATED,};structBackendPrefsData{uint32_tmCanvasBitmask=0;mozilla::gfx::BackendTypemCanvasDefault=mozilla::gfx::BackendType::NONE;uint32_tmContentBitmask=0;mozilla::gfx::BackendTypemContentDefault=mozilla::gfx::BackendType::NONE;};classgfxPlatform:publicmozilla::layers::MemoryPressureListener{friendclassSRGBOverrideObserver;public:typedefmozilla::StretchRangeStretchRange;typedefmozilla::SlantStyleRangeSlantStyleRange;typedefmozilla::WeightRangeWeightRange;typedefmozilla::gfx::ColorColor;typedefmozilla::gfx::DataSourceSurfaceDataSourceSurface;typedefmozilla::gfx::DrawTargetDrawTarget;typedefmozilla::gfx::IntSizeIntSize;typedefmozilla::gfx::SourceSurfaceSourceSurface;typedefmozilla::unicode::ScriptScript;/** * Return a pointer to the current active platform. * This is a singleton; it contains mostly convenience * functions to obtain platform-specific objects. */staticgfxPlatform*GetPlatform();/** * Returns whether or not graphics has been initialized yet. This is * intended for Telemetry where we don't necessarily want to initialize * graphics just to observe its state. */staticboolInitialized();/** * Shut down Thebes. * Init() arranges for this to be called at an appropriate time. */staticvoidShutdown();/** * Initialize gfxPlatform (if not already done) in a child process, with * the provided ContentDeviceData. */staticvoidInitChild(constmozilla::gfx::ContentDeviceData&aData);staticvoidInitLayersIPC();staticvoidShutdownLayersIPC();/** * Initialize ScrollMetadata statics. Does not depend on gfxPlatform. */staticvoidInitNullMetadata();staticint32_tMaxTextureSize();staticint32_tMaxAllocSize();staticvoidInitMoz2DLogging();staticboolIsHeadless();/** * Create an offscreen surface of the given dimensions * and image format. */virtualalready_AddRefed<gfxASurface>CreateOffscreenSurface(constIntSize&aSize,gfxImageFormataFormat)=0;/** * Beware that this method may return DrawTargets which are not fully supported * on the current platform and might fail silently in subtle ways. This is a massive * potential footgun. You should only use these methods for canvas drawing really. * Use extreme caution if you use them for content where you are not 100% sure we * support the DrawTarget we get back. * See SupportsAzureContentForDrawTarget. */staticalready_AddRefed<DrawTarget>CreateDrawTargetForSurface(gfxASurface*aSurface,constmozilla::gfx::IntSize&aSize);/* * Creates a SourceSurface for a gfxASurface. This function does no caching, * so the caller should cache the gfxASurface if it will be used frequently. * The returned surface keeps a reference to aTarget, so it is OK to keep the * surface, even if aTarget changes. * aTarget should not keep a reference to the returned surface because that * will cause a cycle. * * This function is static so that it can be accessed from * PluginInstanceChild (where we can't call gfxPlatform::GetPlatform() * because the prefs service can only be accessed from the main process). * * aIsPlugin is used to tell the backend that they can optimize this surface * specifically because it's used for a plugin. This is mostly for Skia. */staticalready_AddRefed<SourceSurface>GetSourceSurfaceForSurface(RefPtr<mozilla::gfx::DrawTarget>aTarget,gfxASurface*aSurface,boolaIsPlugin=false);staticvoidClearSourceSurfaceForSurface(gfxASurface*aSurface);staticalready_AddRefed<DataSourceSurface>GetWrappedDataSourceSurface(gfxASurface*aSurface);already_AddRefed<DrawTarget>CreateOffscreenContentDrawTarget(constmozilla::gfx::IntSize&aSize,mozilla::gfx::SurfaceFormataFormat,boolaFallback=false);already_AddRefed<DrawTarget>CreateOffscreenCanvasDrawTarget(constmozilla::gfx::IntSize&aSize,mozilla::gfx::SurfaceFormataFormat);already_AddRefed<DrawTarget>CreateSimilarSoftwareDrawTarget(DrawTarget*aDT,constIntSize&aSize,mozilla::gfx::SurfaceFormataFormat);staticalready_AddRefed<DrawTarget>CreateDrawTargetForData(unsignedchar*aData,constmozilla::gfx::IntSize&aSize,int32_taStride,mozilla::gfx::SurfaceFormataFormat,boolaUninitialized=false);/** * Returns true if we should use Azure to render content with aTarget. For * example, it is possible that we are using Direct2D for rendering and thus * using Azure. But we want to render to a CairoDrawTarget, in which case * SupportsAzureContent will return true but SupportsAzureContentForDrawTarget * will return false. */boolSupportsAzureContentForDrawTarget(mozilla::gfx::DrawTarget*aTarget);boolSupportsAzureContentForType(mozilla::gfx::BackendTypeaType){returnBackendTypeBit(aType)&mContentBackendBitmask;}/// This function also lets us know if the current preferences/platform/// combination allows for both accelerated and not accelerated canvas/// implementations. If it does, and other relevant preferences are/// asking for it, we will examine the commands in the first few seconds/// of the canvas usage, and potentially change to accelerated or/// non-accelerated canvas.virtualboolAllowOpenGLCanvas();virtualvoidInitializeSkiaCacheLimits();staticboolAsyncPanZoomEnabled();virtualvoidGetAzureBackendInfo(mozilla::widget::InfoObject&aObj);voidGetApzSupportInfo(mozilla::widget::InfoObject&aObj);voidGetTilesSupportInfo(mozilla::widget::InfoObject&aObj);// Get the default content backend that will be used with the default// compositor. If the compositor is known when calling this function,// GetContentBackendFor() should be called instead.mozilla::gfx::BackendTypeGetDefaultContentBackend()const{returnmContentBackend;}/// Return the software backend to use by default.mozilla::gfx::BackendTypeGetSoftwareBackend(){returnmSoftwareBackend;}// Return the best content backend available that is compatible with the// given layers backend.virtualmozilla::gfx::BackendTypeGetContentBackendFor(mozilla::layers::LayersBackendaLayers){returnmContentBackend;}virtualmozilla::gfx::BackendTypeGetPreferredCanvasBackend(){returnmPreferredCanvasBackend;}mozilla::gfx::BackendTypeGetFallbackCanvasBackend(){returnmFallbackCanvasBackend;}/* * Font bits */virtualvoidSetupClusterBoundaries(gfxTextRun*aTextRun,constchar16_t*aString);/** * Fill aListOfFonts with the results of querying the list of font names * that correspond to the given language group or generic font family * (or both, or neither). */virtualnsresultGetFontList(nsAtom*aLangGroup,constnsACString&aGenericFamily,nsTArray<nsString>&aListOfFonts);/** * Fill aFontList with a list of SystemFontListEntry records for the * available fonts on the platform; used to pass the list from chrome to * content process. Currently implemented only on MacOSX and Linux. */virtualvoidReadSystemFontList(InfallibleTArray<mozilla::dom::SystemFontListEntry>*aFontList){}/** * Rebuilds the any cached system font lists */virtualnsresultUpdateFontList();/** * Create the platform font-list object (gfxPlatformFontList concrete subclass). * This function is responsible to create the appropriate subclass of * gfxPlatformFontList *and* to call its InitFontList() method. */virtualgfxPlatformFontList*CreatePlatformFontList(){MOZ_ASSERT_UNREACHABLE("oops, this platform doesn't have a ""gfxPlatformFontList implementation");returnnullptr;}/** * Resolving a font name to family name. The result MUST be in the result of GetFontList(). * If the name doesn't in the system, aFamilyName will be empty string, but not failed. */virtualnsresultGetStandardFamilyName(constnsAString&aFontName,nsAString&aFamilyName);/** * Returns default font name (localized family name) for aLangGroup and * aGenericFamily. The result is typically the first font in * font.name-list.<aGenericFamily>.<aLangGroup>. However, if it's not * available in the system, this may return second or later font in the * pref. If there are no available fonts in the pref, returns empty string. */nsStringGetDefaultFontName(constnsACString&aLangGroup,constnsACString&aGenericFamily);/** * Create the appropriate platform font group */virtualgfxFontGroup*CreateFontGroup(constmozilla::FontFamilyList&aFontFamilyList,constgfxFontStyle*aStyle,gfxTextPerfMetrics*aTextPerf,gfxUserFontSet*aUserFontSet,gfxFloataDevToCssSize)=0;/** * Look up a local platform font using the full font face name. * (Needed to support @font-face src local().) * Ownership of the returned gfxFontEntry is passed to the caller, * who must either AddRef() or delete. */gfxFontEntry*LookupLocalFont(constnsAString&aFontName,WeightRangeaWeightForEntry,StretchRangeaStretchForEntry,SlantStyleRangeaStyleForEntry);/** * Activate a platform font. (Needed to support @font-face src url().) * aFontData is a NS_Malloc'ed block that must be freed by this function * (or responsibility passed on) when it is no longer needed; the caller * will NOT free it. * Ownership of the returned gfxFontEntry is passed to the caller, * who must either AddRef() or delete. */gfxFontEntry*MakePlatformFont(constnsAString&aFontName,WeightRangeaWeightForEntry,StretchRangeaStretchForEntry,SlantStyleRangeaStyleForEntry,constuint8_t*aFontData,uint32_taLength);/** * Whether to allow downloadable fonts via @font-face rules */boolDownloadableFontsEnabled();/** * True when hinting should be enabled. This setting shouldn't * change per gecko process, while the process is live. If so the * results are not defined. * * NB: this bit is only honored by the FT2 backend, currently. */virtualboolFontHintingEnabled(){returntrue;}/** * True when zooming should not require reflow, so glyph metrics and * positioning should not be adjusted for device pixels. * If this is TRUE, then FontHintingEnabled() should be FALSE, * but the converse is not necessarily required; * * Like FontHintingEnabled (above), this setting shouldn't * change per gecko process, while the process is live. If so the * results are not defined. * * NB: this bit is only honored by the FT2 backend, currently. */virtualboolRequiresLinearZoom(){returnfalse;}/** * Whether the frame->StyleFont().mFont.smoothing field is respected by * text rendering on this platform. */virtualboolRespectsFontStyleSmoothing()const{returnfalse;}/** * Whether to check all font cmaps during system font fallback */boolUseCmapsDuringSystemFallback();/** * Whether to render SVG glyphs within an OpenType font wrapper */boolOpenTypeSVGEnabled();/** * Max character length of words in the word cache */uint32_tWordCacheCharLimit();/** * Max number of entries in word cache */uint32_tWordCacheMaxEntries();/** * Whether to use the SIL Graphite rendering engine * (for fonts that include Graphite tables) */boolUseGraphiteShaping();// Check whether format is supported on a platform (if unclear, returns true).// Default implementation checks for "common" formats that we support across// all platforms, but individual platform implementations may override.virtualboolIsFontFormatSupported(uint32_taFormatFlags);virtualboolDidRenderingDeviceReset(DeviceResetReason*aResetReason=nullptr){returnfalse;}// returns a list of commonly used fonts for a given character// these are *possible* matches, no cmap-checking is done at this levelvirtualvoidGetCommonFallbackFonts(uint32_t/*aCh*/,uint32_t/*aNextCh*/,Script/*aRunScript*/,nsTArray<constchar*>&/*aFontList*/){// platform-specific override, by default do nothing}// Are we in safe mode?staticboolInSafeMode();staticboolOffMainThreadCompositingEnabled();voidUpdateCanUseHardwareVideoDecoding();// Returns a prioritized list of all available compositor backends.voidGetCompositorBackends(booluseAcceleration,nsTArray<mozilla::layers::LayersBackend>&aBackends);/** * Is it possible to use buffer rotation. Note that these * check the preference, but also allow for the override to * disable it using DisableBufferRotation. */staticboolBufferRotationEnabled();staticvoidDisableBufferRotation();/** * Are we going to try color management? */staticeCMSModeGetCMSMode();/** * Determines the rendering intent for color management. * * If the value in the pref gfx.color_management.rendering_intent is a * valid rendering intent as defined in gfx/qcms/qcms.h, that * value is returned. Otherwise, -1 is returned and the embedded intent * should be used. * * See bug 444014 for details. */staticintGetRenderingIntent();/** * Convert a pixel using a cms transform in an endian-aware manner. * * Sets 'out' to 'in' if transform is nullptr. */staticvoidTransformPixel(constColor&in,Color&out,qcms_transform*transform);/** * Return the output device ICC profile. */staticqcms_profile*GetCMSOutputProfile();/** * Return the sRGB ICC profile. */staticqcms_profile*GetCMSsRGBProfile();/** * Return sRGB -> output device transform. */staticqcms_transform*GetCMSRGBTransform();/** * Return output -> sRGB device transform. */staticqcms_transform*GetCMSInverseRGBTransform();/** * Return sRGBA -> output device transform. */staticqcms_transform*GetCMSRGBATransform();virtualvoidFontsPrefsChanged(constchar*aPref);int32_tGetBidiNumeralOption();/** * This is a bit ugly, but useful... force all presContexts to reflow, * by toggling a preference that they observe. This is used when * something about platform settings changes that might have an effect * on layout, such as font rendering settings that influence metrics. */staticvoidForceGlobalReflow();staticvoidFlushFontAndWordCaches();/** * Returns a 1x1 surface that can be used to create graphics contexts * for measuring text etc as if they will be rendered to the screen */gfxASurface*ScreenReferenceSurface(){returnmScreenReferenceSurface;}/** * Returns a 1x1 DrawTarget that can be used for measuring text etc. as * it would measure if rendered on-screen. Guaranteed to return a * non-null and valid DrawTarget. */RefPtr<mozilla::gfx::DrawTarget>ScreenReferenceDrawTarget();virtualmozilla::gfx::SurfaceFormatOptimal2DFormatForContent(gfxContentTypeaContent);virtualgfxImageFormatOptimalFormatForContent(gfxContentTypeaContent);virtualgfxImageFormatGetOffscreenFormat(){returnmozilla::gfx::SurfaceFormat::X8R8G8B8_UINT32;}/** * Returns whether the current process should use tiling for layers. */virtualboolUsesTiling()const;/** * Returns whether the content process will use tiling for layers. This is * only used by about:support. */virtualboolContentUsesTiling()const;/** * Returns a logger if one is available and logging is enabled */staticmozilla::LogModule*GetLog(eGfxLogaWhichLog);intGetScreenDepth()const{returnmScreenDepth;}mozilla::gfx::IntSizeGetScreenSize()const{returnmScreenSize;}/** * Return the layer debugging options to use browser-wide. */mozilla::layers::DiagnosticTypesGetLayerDiagnosticTypes();mozilla::gl::SkiaGLGlue*GetSkiaGLGlue();voidPurgeSkiaGPUCache();staticvoidPurgeSkiaFontCache();staticboolUsesOffMainThreadCompositing();boolHasEnoughTotalSystemMemoryForSkiaGL();/** * Get the hardware vsync source for each platform. * Should only exist and be valid on the parent process */virtualmozilla::gfx::VsyncSource*GetHardwareVsync(){MOZ_ASSERT(mVsyncSource!=nullptr);MOZ_ASSERT(XRE_IsParentProcess()||mozilla::recordreplay::IsRecordingOrReplaying());returnmVsyncSource;}/** * True if layout rendering should use ASAP mode, which means * the refresh driver and compositor should render ASAP. * Used for talos testing purposes */staticboolIsInLayoutAsapMode();/** * Returns the software vsync rate to use. */staticintGetSoftwareVsyncRate();/** * Returns whether or not a custom vsync rate is set. */staticboolForceSoftwareVsync();/** * Returns the default frame rate for the refresh driver / software vsync. */staticintGetDefaultFrameRate();/** * Used to test which input types are handled via APZ. */virtualboolSupportsApzWheelInput()const{returnfalse;}boolSupportsApzTouchInput()const;boolSupportsApzDragInput()const;boolSupportsApzKeyboardInput()const;boolSupportsApzAutoscrolling()const;virtualvoidFlushContentDrawing(){}// If a device reset has occurred, schedule any necessary paints in the// widget. This should only be used within nsRefreshDriver.virtualvoidSchedulePaintIfDeviceReset(){}/** * Helper method, creates a draw target for a specific Azure backend. * Used by CreateOffscreenDrawTarget. */already_AddRefed<DrawTarget>CreateDrawTargetForBackend(mozilla::gfx::BackendTypeaBackend,constmozilla::gfx::IntSize&aSize,mozilla::gfx::SurfaceFormataFormat);/** * Wrapper around gfxPrefs::PerfWarnings(). * Extracted into a function to avoid including gfxPrefs.h from this file. */staticboolPerfWarnings();staticvoidNotifyGPUProcessDisabled();voidNotifyCompositorCreated(mozilla::layers::LayersBackendaBackend);mozilla::layers::LayersBackendGetCompositorBackend()const{returnmCompositorBackend;}virtualvoidCompositorUpdated(){}// Plugin async drawing support.virtualboolSupportsPluginDirectBitmapDrawing(){returnfalse;}// Some platforms don't support CompositorOGL in an unaccelerated OpenGL// context. These platforms should return true here.virtualboolRequiresAcceleratedGLContextForCompositorOGL()const{returnfalse;}/** * Check the blocklist for a feature. Returns false if the feature is blocked * with an appropriate message and failure ID. * */staticboolIsGfxInfoStatusOkay(int32_taFeature,nsCString*aOutMessage,nsCString&aFailureId);constgfxSkipChars&EmptySkipChars()const{returnkEmptySkipChars;}/** * Return information on how child processes should initialize graphics * devices. */virtualvoidBuildContentDeviceData(mozilla::gfx::ContentDeviceData*aOut);/** * Imports settings from the GPU process. This should only be called through * GPUProcessManager, in the UI process. */virtualvoidImportGPUDeviceData(constmozilla::gfx::GPUDeviceData&aData);virtualFT_LibraryGetFTLibrary(){returnnullptr;}boolHasVariationFontSupport()const{returnmHasVariationFontSupport;}boolHasNativeColrFontSupport()const{returnmHasNativeColrFontSupport;}// you probably want to use gfxVars::UseWebRender() instead of thisstaticboolWebRenderPrefEnabled();// you probably want to use gfxVars::UseWebRender() instead of thisstaticboolWebRenderEnvvarEnabled();virtualvoidOnMemoryPressure(mozilla::layers::MemoryPressureReasonaWhy)override;protected:gfxPlatform();virtual~gfxPlatform();virtualvoidInitAcceleration();virtualvoidInitWebRenderConfig();/** * Called immediately before deleting the gfxPlatform object. */virtualvoidWillShutdown();/** * Initialized hardware vsync based on each platform. */virtualalready_AddRefed<mozilla::gfx::VsyncSource>CreateHardwareVsyncSource();// Returns whether or not layers should be accelerated by default on this platform.virtualboolAccelerateLayersByDefault();// Returns a prioritized list of available compositor backends for acceleration.virtualvoidGetAcceleratedCompositorBackends(nsTArray<mozilla::layers::LayersBackend>&aBackends);// Returns preferences of canvas and content backends.virtualBackendPrefsDataGetBackendPrefs()const;/** * Initialise the preferred and fallback canvas backends * aBackendBitmask specifies the backends which are acceptable to the caller. * The backend used is determined by aBackendBitmask and the order specified * by the gfx.canvas.azure.backends pref. */voidInitBackendPrefs(BackendPrefsData&&aPrefsData);/** * Content-process only. Requests device preferences from the parent process * and updates any cached settings. */voidFetchAndImportContentDeviceData();virtualvoidImportContentDeviceData(constmozilla::gfx::ContentDeviceData&aData);/** * Increase the global device counter after a device has been removed/reset. */voidBumpDeviceCounter();/** * returns the first backend named in the pref gfx.canvas.azure.backends * which is a component of aBackendBitmask, a bitmask of backend types */staticmozilla::gfx::BackendTypeGetCanvasBackendPref(uint32_taBackendBitmask);/** * returns the first backend named in the pref gfx.content.azure.backend * which is a component of aBackendBitmask, a bitmask of backend types */staticmozilla::gfx::BackendTypeGetContentBackendPref(uint32_t&aBackendBitmask);/** * Will return the first backend named in aBackendPrefName * allowed by aBackendBitmask, a bitmask of backend types. * It also modifies aBackendBitmask to only include backends that are * allowed given the prefs. */staticmozilla::gfx::BackendTypeGetBackendPref(constchar*aBackendPrefName,uint32_t&aBackendBitmask);/** * Decode the backend enumberation from a string. */staticmozilla::gfx::BackendTypeBackendTypeForName(constnsCString&aName);virtualboolCanUseHardwareVideoDecoding();virtualboolCheckVariationFontSupport()=0;int8_tmAllowDownloadableFonts;int8_tmGraphiteShapingEnabled;int8_tmOpenTypeSVGEnabled;int8_tmBidiNumeralOption;// whether to always search font cmaps globally// when doing system font fallbackint8_tmFallbackUsesCmaps;// Whether the platform supports rendering OpenType font variationsboolmHasVariationFontSupport;// Whether the platform font APIs have native support for COLR fonts.// Set to true during initialization on platforms that implement this.boolmHasNativeColrFontSupport=false;// max character limit for words in word cacheint32_tmWordCacheCharLimit;// max number of entries in word cacheint32_tmWordCacheMaxEntries;uint64_tmTotalSystemMemory;// Hardware vsync source. Only valid on parent processRefPtr<mozilla::gfx::VsyncSource>mVsyncSource;RefPtr<mozilla::gfx::DrawTarget>mScreenReferenceDrawTarget;private:/** * Start up Thebes. */staticvoidInit();staticvoidInitOpenGLConfig();staticvoidCreateCMSOutputProfile();staticvoidGetCMSOutputProfileData(void*&mem,size_t&size);friendvoidRecordingPrefChanged(constchar*aPrefName,void*aClosure);virtualvoidGetPlatformCMSOutputProfile(void*&mem,size_t&size);/** * Calling this function will compute and set the ideal tile size for the * platform. This will only have an effect in the parent process; child processes * should be updated via SetTileSize to match the value computed in the parent. */voidComputeTileSize();/** * This uses nsIScreenManager to determine the screen size and color depth */voidPopulateScreenInfo();voidInitCompositorAccelerationPrefs();voidInitGPUProcessPrefs();voidInitOMTPConfig();staticboolIsDXInterop2Blocked();staticboolIsDXNV12Blocked();RefPtr<gfxASurface>mScreenReferenceSurface;nsCOMPtr<nsIObserver>mSRGBOverrideObserver;RefPtr<mozilla::layers::MemoryPressureObserver>mMemoryPressureObserver;// The preferred draw target backend to use for canvasmozilla::gfx::BackendTypemPreferredCanvasBackend;// The fallback draw target backend to use for canvas, if the preferred backend failsmozilla::gfx::BackendTypemFallbackCanvasBackend;// The backend to use for contentmozilla::gfx::BackendTypemContentBackend;// The backend to use when we need it not to be accelerated.mozilla::gfx::BackendTypemSoftwareBackend;// Bitmask of backend types we can use to render contentuint32_tmContentBackendBitmask;mozilla::widget::GfxInfoCollector<gfxPlatform>mAzureCanvasBackendCollector;mozilla::widget::GfxInfoCollector<gfxPlatform>mApzSupportCollector;mozilla::widget::GfxInfoCollector<gfxPlatform>mTilesInfoCollector;RefPtr<mozilla::gfx::DrawEventRecorder>mRecorder;RefPtr<mozilla::gl::SkiaGLGlue>mSkiaGlue;// Backend that we are compositing with. NONE, if no compositor has been// created yet.mozilla::layers::LayersBackendmCompositorBackend;int32_tmScreenDepth;mozilla::gfx::IntSizemScreenSize;// An instance of gfxSkipChars which is empty. It is used as the// basis for error-case iterators.constgfxSkipCharskEmptySkipChars;};#endif /* GFX_PLATFORM_H */