Issue #80 - Re-unify most of gfx

This commit is contained in:
Moonchild 2022-09-08 16:50:40 +00:00 committed by roytam1
commit f801bd1847
9 changed files with 65 additions and 57 deletions

View file

@ -62,7 +62,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
EXPORTS.mozilla.gfx += [
'MacIOSurface.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'NativeFontResourceMac.cpp',
'PathCG.cpp',
'ScaledFontMac.cpp',
@ -94,8 +94,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
]
if CONFIG['MOZ_ENABLE_SKIA']:
SOURCES += [
UNIFIED_SOURCES += [
'convolver.cpp',
]
SOURCES += [
'DrawTargetSkia.cpp',
'image_operations.cpp', # Uses _USE_MATH_DEFINES
'PathSkia.cpp',
@ -140,7 +142,7 @@ elif CONFIG['CPU_ARCH'].startswith('mips'):
'convolverLS3.cpp',
]
SOURCES += [
UNIFIED_SOURCES += [
'BezierUtils.cpp',
'Blur.cpp',
'DataSourceSurface.cpp',
@ -153,7 +155,6 @@ SOURCES += [
'DrawTargetDual.cpp',
'DrawTargetRecording.cpp',
'DrawTargetTiled.cpp',
'Factory.cpp', # Need to suppress warnings in Skia header files.
'FilterNodeSoftware.cpp',
'FilterProcessing.cpp',
'FilterProcessingScalar.cpp',
@ -175,6 +176,10 @@ SOURCES += [
'SourceSurfaceRawData.cpp',
]
SOURCES += [
'Factory.cpp', # Need to suppress warnings in Skia header files.
]
if CONFIG['CLANG_CXX']:
SOURCES['Factory.cpp'].flags += ['-Wno-implicit-fallthrough']

View file

@ -109,7 +109,7 @@ SOURCES += [
'cairo-surface-wrapper.c', # redefinition of '_copy_transformed_pattern'
]
SOURCES += [
UNIFIED_SOURCES += [
'cairo-analysis-surface.c',
'cairo-arc.c',
'cairo-array.c',

View file

@ -14,7 +14,7 @@ EXPORTS.mozilla.gfx += [
'gfxVars.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'gfxConfig.cpp',
'gfxFeature.cpp',
'gfxVars.cpp',

View file

@ -64,7 +64,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'SharedSurfaceD3D11Interop.h',
'WGLLibrary.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'GLContextProviderWGL.cpp',
'SharedSurfaceANGLE.cpp',
'SharedSurfaceD3D11Interop.cpp',
@ -114,7 +114,7 @@ elif gl_provider == 'GLX':
'SharedSurfaceGLX.h'
]
SOURCES += [
UNIFIED_SOURCES += [
'DecomposeIntoNoRepeatTriangles.cpp',
'EGLUtils.cpp',
'GfxTexturesReporter.cpp',

View file

@ -9,21 +9,11 @@
#include "InputData.h" // for InputData, etc
#include "mozilla/EventStateManager.h" // for WheelPrefs
#include "mozilla/layers/APZThreadUtils.h" // for AssertOnCompositorThread, etc
#include "mozilla/MouseEvents.h" // for WidgetMouseEvent
#include "mozilla/TouchEvents.h" // for WidgetTouchEvent
namespace mozilla {
namespace layers {
static bool
WillHandleMouseEvent(const WidgetMouseEventBase& aEvent)
{
return aEvent.mMessage == eMouseMove ||
aEvent.mMessage == eMouseDown ||
aEvent.mMessage == eMouseUp ||
aEvent.mMessage == eDragEnd;
}
// Returns whether or not a wheel event action will be (or was) performed by
// APZ. If this returns true, the event must not perform a synchronous
// scroll.

View file

@ -11,6 +11,7 @@
#include "FrameMetrics.h" // for FrameMetrics, etc
#include "mozilla/EventForwards.h" // for WidgetInputEvent, nsEventStatus
#include "mozilla/layers/APZUtils.h" // for HitTestResult
#include "mozilla/MouseEvents.h" // for WidgetMouseEvent
#include "nsTArrayForwardDeclare.h" // for nsTArray, nsTArray_Impl, etc
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
#include "Units.h" // for CSSPoint, CSSRect, etc
@ -38,6 +39,15 @@ enum ZoomToRectBehavior : uint32_t {
class AsyncDragMetrics;
static bool
WillHandleMouseEvent(const WidgetMouseEventBase& aEvent)
{
return aEvent.mMessage == eMouseMove ||
aEvent.mMessage == eMouseDown ||
aEvent.mMessage == eMouseUp ||
aEvent.mMessage == eDragEnd;
}
class IAPZCTreeManager {
NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING(IAPZCTreeManager)

View file

@ -85,21 +85,6 @@ struct APZCTreeManager::TreeBuildingState {
std::map<ScrollableLayerGuid, AsyncPanZoomController*> mApzcMap;
};
// Returns whether or not a wheel event action will be (or was) performed by
// APZ. If this returns true, the event must not perform a synchronous
// scroll.
//
// Even if this returns false, all wheel events in APZ-aware widgets must
// be sent through APZ so they are transformed correctly for TabParent.
static bool
WillHandleWheelEvent(WidgetWheelEvent* aEvent)
{
return EventStateManager::WheelEventIsScrollAction(aEvent) &&
(aEvent->mDeltaMode == nsIDOMWheelEvent::DOM_DELTA_LINE ||
aEvent->mDeltaMode == nsIDOMWheelEvent::DOM_DELTA_PIXEL ||
aEvent->mDeltaMode == nsIDOMWheelEvent::DOM_DELTA_PAGE);
}
class APZCTreeManager::CheckerboardFlushObserver : public nsIObserver {
public:
NS_DECL_ISUPPORTS

View file

@ -48,6 +48,8 @@ EXPORTS += [
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
SOURCES += [
'D3D11ShareHandleImage.cpp',
]
UNIFIED_SOURCES += [
'D3D9SurfaceImage.cpp',
'IMFYCbCrImage.cpp',
'TextureDIB.cpp',
@ -77,6 +79,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
SOURCES += [
'd3d11/CompositorD3D11.cpp',
'd3d11/ReadbackManagerD3D11.cpp',
]
UNIFIED_SOURCES += [
'd3d11/TextureD3D11.cpp',
]
@ -221,14 +225,16 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
'MacIOSurfaceHelpers.h',
'MacIOSurfaceImage.h',
]
UNIFIED_SOURCES += [
'opengl/GLManager.cpp',
]
SOURCES += [
'ipc/ShadowLayerUtilsMac.cpp',
'MacIOSurfaceHelpers.cpp',
'MacIOSurfaceImage.cpp',
'opengl/GLManager.cpp',
]
SOURCES += [
UNIFIED_SOURCES += [
'apz/public/IAPZCTreeManager.cpp',
'apz/src/APZCTreeManager.cpp',
'apz/src/AsyncPanZoomController.cpp',
@ -263,7 +269,6 @@ SOURCES += [
'basic/BasicColorLayer.cpp',
'basic/BasicCompositor.cpp',
'basic/BasicContainerLayer.cpp',
'basic/BasicImageLayer.cpp',
'basic/BasicImages.cpp',
'basic/BasicLayerManager.cpp',
'basic/BasicLayersImpl.cpp',
@ -312,7 +317,6 @@ SOURCES += [
'Effects.cpp',
'FrameMetrics.cpp',
'GLImages.cpp',
'ImageContainer.cpp',
'ImageDataSerializer.cpp',
'ImageLayers.cpp',
'ipc/APZChild.cpp',
@ -322,7 +326,9 @@ SOURCES += [
'ipc/CompositableTransactionParent.cpp',
'ipc/CompositorBench.cpp',
'ipc/CompositorBridgeChild.cpp',
'ipc/CompositorBridgeParent.cpp',
'ipc/CompositorThread.cpp',
'ipc/CrossProcessCompositorBridgeParent.cpp',
'ipc/ImageBridgeChild.cpp',
'ipc/ImageBridgeParent.cpp',
'ipc/ImageContainerChild.cpp',
@ -340,12 +346,10 @@ SOURCES += [
'ipc/SharedRGBImage.cpp',
'ipc/VideoBridgeChild.cpp',
'ipc/VideoBridgeParent.cpp',
'Layers.cpp',
'LayerScope.cpp',
'LayersLogging.cpp',
'LayerSorter.cpp',
'LayersTypes.cpp',
'LayerTreeInvalidation.cpp',
'opengl/CompositingRenderTargetOGL.cpp',
'opengl/CompositorOGL.cpp',
'opengl/GLBlitTextureImageHelper.cpp',
@ -353,7 +357,6 @@ SOURCES += [
'opengl/TextureClientOGL.cpp',
'opengl/TextureHostOGL.cpp',
'opengl/TexturePoolOGL.cpp',
'PersistentBufferProvider.cpp',
'protobuf/LayerScopePacket.pb.cc',
'ReadbackProcessor.cpp',
'RenderTrace.cpp',
@ -361,11 +364,13 @@ SOURCES += [
'TextureWrapperImage.cpp',
]
# Implementation in CBP.cpp of things used in CPCBP.cpp
# EraseLayerState, UpdateIndirectTree and map<uint64_t, CompositorBridgeParent::LayerTreeState>
UNIFIED_SOURCES += [
'ipc/CompositorBridgeParent.cpp',
'ipc/CrossProcessCompositorBridgeParent.cpp',
# Cannot be built unified
SOURCES += [
'basic/BasicImageLayer.cpp',
'ImageContainer.cpp',
'Layers.cpp',
'LayerTreeInvalidation.cpp',
'PersistentBufferProvider.cpp',
]
# Disable RTTI in google protocol buffer
@ -433,6 +438,6 @@ if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']
if CONFIG['MOZ_ENABLE_SKIA']:
SOURCES += [
UNIFIED_SOURCES += [
'composite/PaintCounter.cpp',
]

View file

@ -121,9 +121,11 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'PrintTargetPDF.h',
'PrintTargetWindows.h',
]
UNIFIED_SOURCES += [
'gfxGDIFontList.cpp',
]
SOURCES += [
'gfxGDIFont.cpp',
'gfxGDIFontList.cpp',
'gfxWindowsNativeDrawing.cpp',
'gfxWindowsPlatform.cpp',
'gfxWindowsSurface.cpp',
@ -131,9 +133,11 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'PrintTargetWindows.cpp',
]
if CONFIG['MOZ_ENABLE_DWRITE_FONT']:
UNIFIED_SOURCES += [
'gfxDWriteFontList.cpp',
]
SOURCES += [
'gfxDWriteCommon.cpp',
'gfxDWriteFontList.cpp',
'gfxDWriteFonts.cpp',
]
@ -145,14 +149,27 @@ if CONFIG['INTEL_ARCHITECTURE']:
SOURCES['gfxAlphaRecoverySSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
SOURCES += [
'CJKCompatSVS.cpp',
'ContextStateTracker.cpp',
'gfxAlphaRecovery.cpp',
# Includes mac system header conflicting with point/size,
# and includes glxXlibSurface.h which drags in Xrender.h
'gfxASurface.cpp',
# on X11, gfxDrawable.cpp includes X headers for an old workaround which
# we could consider removing soon (affects Ubuntus older than 10.04 LTS)
# which currently prevent it from joining UNIFIED_SOURCES.
'gfxDrawable.cpp',
# gfxPlatform.cpp includes mac system header conflicting with point/size
'gfxPlatform.cpp',
'gfxPrefs.cpp',
'PrintTarget.cpp',
'PrintTargetThebes.cpp',
]
UNIFIED_SOURCES += [
'CJKCompatSVS.cpp',
'gfxAlphaRecovery.cpp',
'gfxBaseSharedMemorySurface.cpp',
'gfxBlur.cpp',
'gfxContext.cpp',
'gfxDrawable.cpp',
'gfxFont.cpp',
'gfxFontEntry.cpp',
'gfxFontFeatures.cpp',
@ -168,9 +185,7 @@ SOURCES += [
'gfxMathTable.cpp',
'gfxMatrix.cpp',
'gfxPattern.cpp',
'gfxPlatform.cpp',
'gfxPlatformFontList.cpp',
'gfxPrefs.cpp',
'gfxRect.cpp',
'gfxScriptItemizer.cpp',
'gfxSkipChars.cpp',
@ -179,18 +194,16 @@ SOURCES += [
'gfxUserFontSet.cpp',
'gfxUtils.cpp',
'nsUnicodeRange.cpp',
'PrintTarget.cpp',
'PrintTargetThebes.cpp',
'SoftwareVsyncSource.cpp',
'VsyncSource.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
SOURCES += [
UNIFIED_SOURCES += [
'gfxMacPlatformFontList.mm',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
SOURCES += [
UNIFIED_SOURCES += [
'D3D11Checks.cpp',
'DeviceManagerDx.cpp',
]