diff options
author | Moonchild <moonchild@palemoon.org> | 2020-05-15 11:04:41 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-05-15 11:04:41 +0000 |
commit | 1f2f05d56b419366ae3faa121a34cc0dc470df5b (patch) | |
tree | 5bc89583e37612ef1f46d340debc367ee0adec1d /gfx | |
parent | bae6360e70e85052b2833ea68168e0da23510f8c (diff) | |
download | uxp-1f2f05d56b419366ae3faa121a34cc0dc470df5b.tar.gz |
Issue mcp-graveyard/UXP#80- De-unify gfx/layers
Excludes layers/ipc/CompositorBridgeParent and CrossProcessCompositorBridgeParent
because the latter purposely uses functions implemented in the former.
See also code comment in CrossProcessCompositorBridgeParent.cpp
Note: likely dead code for us anyway; likely not worth investing in to solve.
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/layers/GLImages.cpp | 1 | ||||
-rw-r--r-- | gfx/layers/IMFYCbCrImage.cpp | 10 | ||||
-rw-r--r-- | gfx/layers/TextureDIB.cpp | 2 | ||||
-rw-r--r-- | gfx/layers/apz/src/APZCTreeManager.cpp | 15 | ||||
-rw-r--r-- | gfx/layers/apz/src/AsyncPanZoomController.cpp | 11 | ||||
-rw-r--r-- | gfx/layers/apz/src/GestureEventListener.cpp | 1 | ||||
-rw-r--r-- | gfx/layers/apz/src/InputBlockState.h | 1 | ||||
-rw-r--r-- | gfx/layers/apz/util/ContentProcessController.h | 1 | ||||
-rw-r--r-- | gfx/layers/client/ClientCanvasLayer.cpp | 3 | ||||
-rw-r--r-- | gfx/layers/ipc/CompositorBridgeParent.cpp | 1 | ||||
-rw-r--r-- | gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp | 3 | ||||
-rw-r--r-- | gfx/layers/ipc/CrossProcessCompositorBridgeParent.h | 1 | ||||
-rw-r--r-- | gfx/layers/ipc/VideoBridgeParent.cpp | 1 | ||||
-rw-r--r-- | gfx/layers/ipc/VideoBridgeParent.h | 1 | ||||
-rw-r--r-- | gfx/layers/moz.build | 38 |
15 files changed, 61 insertions, 29 deletions
diff --git a/gfx/layers/GLImages.cpp b/gfx/layers/GLImages.cpp index e45c3e7d64..c151d991b2 100644 --- a/gfx/layers/GLImages.cpp +++ b/gfx/layers/GLImages.cpp @@ -7,6 +7,7 @@ #include "GLBlitHelper.h" #include "GLReadTexImageHelper.h" #include "GLLibraryEGL.h" +#include "mozilla/gfx/Logging.h" using namespace mozilla; using namespace mozilla::gl; diff --git a/gfx/layers/IMFYCbCrImage.cpp b/gfx/layers/IMFYCbCrImage.cpp index d5943b0303..6740fdbe07 100644 --- a/gfx/layers/IMFYCbCrImage.cpp +++ b/gfx/layers/IMFYCbCrImage.cpp @@ -13,6 +13,8 @@ #include "mozilla/layers/TextureClient.h" #include "d3d9.h" +using namespace mozilla::gfx; + namespace mozilla { namespace layers { @@ -67,10 +69,10 @@ struct AutoLockTexture static already_AddRefed<IDirect3DTexture9> InitTextures(IDirect3DDevice9* aDevice, const IntSize &aSize, - _D3DFORMAT aFormat, - RefPtr<IDirect3DSurface9>& aSurface, - HANDLE& aHandle, - D3DLOCKED_RECT& aLockedRect) + _D3DFORMAT aFormat, + RefPtr<IDirect3DSurface9>& aSurface, + HANDLE& aHandle, + D3DLOCKED_RECT& aLockedRect) { if (!aDevice) { return nullptr; diff --git a/gfx/layers/TextureDIB.cpp b/gfx/layers/TextureDIB.cpp index 79a9469bfa..775538cf3b 100644 --- a/gfx/layers/TextureDIB.cpp +++ b/gfx/layers/TextureDIB.cpp @@ -7,8 +7,10 @@ #include "gfx2DGlue.h" #include "mozilla/gfx/DataSurfaceHelpers.h" // For BufferSizeFromDimensions #include "mozilla/layers/ISurfaceAllocator.h" +#include "mozilla/layers/TextureForwarder.h" #include "mozilla/ipc/ProtocolUtils.h" + namespace mozilla { using namespace gfx; diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index f543263602..00eb3f1834 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -85,6 +85,21 @@ 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 diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 3d41123956..d9ad3ae784 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -33,6 +33,7 @@ #include "mozilla/ClearOnShutdown.h" // for ClearOnShutdown #include "mozilla/ComputedTimingFunction.h" // for ComputedTimingFunction #include "mozilla/EventForwards.h" // for nsEventStatus_* +#include "mozilla/EventStateManager.h" #include "mozilla/MouseEvents.h" // for WidgetWheelEvent #include "mozilla/Preferences.h" // for Preferences #include "mozilla/ReentrantMonitor.h" // for ReentrantMonitorAutoEnter, etc @@ -44,6 +45,7 @@ #include "mozilla/dom/Touch.h" // for Touch #include "mozilla/gfx/BasePoint.h" // for BasePoint #include "mozilla/gfx/BaseRect.h" // for BaseRect +#include "mozilla/gfx/Coord.h" #include "mozilla/gfx/Point.h" // for Point, RoundedToInt, etc #include "mozilla/gfx/Rect.h" // for RoundedIn #include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor @@ -102,7 +104,12 @@ typedef GeckoContentController::APZStateChange APZStateChange; typedef GeckoContentController::TapType TapType; typedef mozilla::gfx::Point Point; typedef mozilla::gfx::Matrix4x4 Matrix4x4; +using mozilla::gfx::CoordTyped; +using mozilla::gfx::IntCoordTyped; +using mozilla::gfx::IntRectTyped; using mozilla::gfx::PointTyped; +using mozilla::gfx::RectTyped; +using mozilla::gfx::ScaleFactors2D; // Choose between platform-specific implementations. #ifdef MOZ_WIDGET_ANDROID @@ -833,7 +840,9 @@ AsyncPanZoomController::ArePointerEventsConsumable(TouchBlockState* aBlock, uint } template <typename Units> -static CoordTyped<Units> GetAxisStart(AsyncDragMetrics::DragDirection aDir, const PointTyped<Units>& aValue) { +static CoordTyped<Units> GetAxisStart( +AsyncDragMetrics::DragDirection aDir, +const PointTyped<Units>& aValue) { if (aDir == AsyncDragMetrics::HORIZONTAL) { return aValue.x; } else { diff --git a/gfx/layers/apz/src/GestureEventListener.cpp b/gfx/layers/apz/src/GestureEventListener.cpp index 7fd07f3ff7..0bacc8778f 100644 --- a/gfx/layers/apz/src/GestureEventListener.cpp +++ b/gfx/layers/apz/src/GestureEventListener.cpp @@ -13,6 +13,7 @@ #include "mozilla/SizePrintfMacros.h" // for PRIuSIZE #include "nsDebug.h" // for NS_WARNING #include "nsMathUtils.h" // for NS_hypot +#include "InputBlockState.h" // for TouchBlockState #define GEL_LOG(...) // #define GEL_LOG(...) printf_stderr("GEL: " __VA_ARGS__) diff --git a/gfx/layers/apz/src/InputBlockState.h b/gfx/layers/apz/src/InputBlockState.h index 86fb0d03ff..528609947a 100644 --- a/gfx/layers/apz/src/InputBlockState.h +++ b/gfx/layers/apz/src/InputBlockState.h @@ -16,6 +16,7 @@ #include "mozilla/TimeStamp.h" // for TimeStamp #include "nsTArray.h" // for nsTArray #include "TouchCounter.h" +#include "OverscrollHandoffState.h" namespace mozilla { namespace layers { diff --git a/gfx/layers/apz/util/ContentProcessController.h b/gfx/layers/apz/util/ContentProcessController.h index 07d113c9ee..bb1a86d3fd 100644 --- a/gfx/layers/apz/util/ContentProcessController.h +++ b/gfx/layers/apz/util/ContentProcessController.h @@ -8,6 +8,7 @@ #define mozilla_layers_ContentProcessController_h #include "mozilla/layers/GeckoContentController.h" +#include "mozilla/dom/ipc/IdType.h" class nsIObserver; diff --git a/gfx/layers/client/ClientCanvasLayer.cpp b/gfx/layers/client/ClientCanvasLayer.cpp index 32acf1eb29..7e9885ef1e 100644 --- a/gfx/layers/client/ClientCanvasLayer.cpp +++ b/gfx/layers/client/ClientCanvasLayer.cpp @@ -19,6 +19,9 @@ #include "nsRect.h" // for mozilla::gfx::IntRect #include "nsXULAppAPI.h" // for XRE_GetProcessType, etc #include "gfxPrefs.h" // for WebGLForceLayersReadback +#include "gfxUtils.h" +#include "TextureClientSharedSurface.h" + using namespace mozilla::gfx; using namespace mozilla::gl; diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index 97ea984dba..9a2df849b8 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -28,6 +28,7 @@ #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/TabParent.h" #include "mozilla/gfx/2D.h" // for DrawTarget +#include "mozilla/gfx/gfxVars.h" #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/gfx/Rect.h" // for IntSize #include "mozilla/ipc/Transport.h" // for Transport diff --git a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp index 8bb5cf2d53..9509cf16a6 100644 --- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.cpp @@ -84,9 +84,10 @@ #include "LayerScope.h" namespace mozilla { - namespace layers { +using namespace std; + // defined in CompositorBridgeParent.cpp typedef map<uint64_t, CompositorBridgeParent::LayerTreeState> LayerTreeMap; extern LayerTreeMap sIndirectLayerTrees; diff --git a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h index 3999699508..ca213bbd55 100644 --- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h +++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h @@ -8,6 +8,7 @@ #define mozilla_layers_CrossProcessCompositorBridgeParent_h #include "mozilla/layers/CompositorBridgeParent.h" +#include "mozilla/layers/CompositorThread.h" namespace mozilla { namespace layers { diff --git a/gfx/layers/ipc/VideoBridgeParent.cpp b/gfx/layers/ipc/VideoBridgeParent.cpp index fce2184c87..f8e3c5314c 100644 --- a/gfx/layers/ipc/VideoBridgeParent.cpp +++ b/gfx/layers/ipc/VideoBridgeParent.cpp @@ -12,7 +12,6 @@ namespace layers { using namespace mozilla::ipc; using namespace mozilla::gfx; -using namespace mozilla::media; static VideoBridgeParent* sVideoBridgeSingleton; diff --git a/gfx/layers/ipc/VideoBridgeParent.h b/gfx/layers/ipc/VideoBridgeParent.h index e5560acab7..bde18b632f 100644 --- a/gfx/layers/ipc/VideoBridgeParent.h +++ b/gfx/layers/ipc/VideoBridgeParent.h @@ -7,6 +7,7 @@ #define gfx_layers_ipc_VideoBridgeParent_h_ #include "mozilla/layers/PVideoBridgeParent.h" +#include "mozilla/layers/ISurfaceAllocator.h" namespace mozilla { namespace layers { diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index 164f043505..2242a774ba 100644 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -49,8 +49,6 @@ EXPORTS += [ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': SOURCES += [ 'D3D11ShareHandleImage.cpp', - ] - UNIFIED_SOURCES += [ 'D3D9SurfaceImage.cpp', 'IMFYCbCrImage.cpp', 'TextureDIB.cpp', @@ -66,12 +64,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': 'd3d9/CompositorD3D9.h', 'd3d9/TextureD3D9.h', ] - UNIFIED_SOURCES += [ - 'd3d9/TextureD3D9.cpp', - ] SOURCES += [ 'd3d9/CompositorD3D9.cpp', 'd3d9/DeviceManagerD3D9.cpp', + 'd3d9/TextureD3D9.cpp', ] if CONFIG['MOZ_ENABLE_D3D10_LAYER']: EXPORTS.mozilla.layers += [ @@ -79,12 +75,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': 'd3d11/ReadbackManagerD3D11.h', 'd3d11/TextureD3D11.h', ] - UNIFIED_SOURCES += [ - 'd3d11/TextureD3D11.cpp', - ] SOURCES += [ 'd3d11/CompositorD3D11.cpp', 'd3d11/ReadbackManagerD3D11.cpp', + 'd3d11/TextureD3D11.cpp', ] EXPORTS.gfxipc += [ @@ -228,21 +222,19 @@ 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', ] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android': - UNIFIED_SOURCES += [ + SOURCES += [ 'apz/src/AndroidAPZ.cpp', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'apz/public/IAPZCTreeManager.cpp', 'apz/src/APZCTreeManager.cpp', 'apz/src/AsyncPanZoomController.cpp', @@ -277,6 +269,7 @@ UNIFIED_SOURCES += [ 'basic/BasicColorLayer.cpp', 'basic/BasicCompositor.cpp', 'basic/BasicContainerLayer.cpp', + 'basic/BasicImageLayer.cpp', 'basic/BasicImages.cpp', 'basic/BasicLayerManager.cpp', 'basic/BasicLayersImpl.cpp', @@ -325,6 +318,7 @@ UNIFIED_SOURCES += [ 'Effects.cpp', 'FrameMetrics.cpp', 'GLImages.cpp', + 'ImageContainer.cpp', 'ImageDataSerializer.cpp', 'ImageLayers.cpp', 'ipc/APZChild.cpp', @@ -334,9 +328,7 @@ UNIFIED_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', @@ -354,10 +346,12 @@ UNIFIED_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', @@ -365,6 +359,7 @@ UNIFIED_SOURCES += [ 'opengl/TextureClientOGL.cpp', 'opengl/TextureHostOGL.cpp', 'opengl/TexturePoolOGL.cpp', + 'PersistentBufferProvider.cpp', 'protobuf/LayerScopePacket.pb.cc', 'ReadbackProcessor.cpp', 'RenderTrace.cpp', @@ -372,12 +367,11 @@ UNIFIED_SOURCES += [ 'TextureWrapperImage.cpp', ] -SOURCES += [ - 'basic/BasicImageLayer.cpp', - 'ImageContainer.cpp', - 'Layers.cpp', - 'LayerTreeInvalidation.cpp', - 'PersistentBufferProvider.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', ] # Disable RTTI in google protocol buffer @@ -445,6 +439,6 @@ if CONFIG['GNU_CXX']: CXXFLAGS += ['-Wno-error=shadow'] if CONFIG['MOZ_ENABLE_SKIA']: - UNIFIED_SOURCES += [ + SOURCES += [ 'composite/PaintCounter.cpp', ] |