diff options
author | Moonchild <moonchild@palemoon.org> | 2022-11-07 13:49:11 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-11-07 13:49:11 +0000 |
commit | d19fb35c6abab93a22d08f8c7fc850ddcc2cbba6 (patch) | |
tree | e63daaac8b9dd59a88f4a7d9a55e6f9c0724cddf /gfx | |
parent | 10a37f462e7b4357feda9284dac608c0da0a416e (diff) | |
parent | 94554142e9f2aafdae0f2152537e8e2bee89313c (diff) | |
download | uxp-d19fb35c6abab93a22d08f8c7fc850ddcc2cbba6.tar.gz |
Merge branch 'master' into 1769-take2
Diffstat (limited to 'gfx')
34 files changed, 130 insertions, 365 deletions
diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build index 4f437d575a..b2d48c8427 100644 --- a/gfx/2d/moz.build +++ b/gfx/2d/moz.build @@ -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'] diff --git a/gfx/angle/src/compiler/translator/EmulateGLFragColorBroadcast.h b/gfx/angle/src/compiler/translator/EmulateGLFragColorBroadcast.h index 627c4c67fe..34d4b79f9f 100755 --- a/gfx/angle/src/compiler/translator/EmulateGLFragColorBroadcast.h +++ b/gfx/angle/src/compiler/translator/EmulateGLFragColorBroadcast.h @@ -11,10 +11,12 @@ #define COMPILER_TRANSLATOR_EMULATEGLFRAGCOLORBROADCAST_H_ #include <vector> +// For COMPILER_EXPORT +#include "GLSLANG/ShaderLang.h" namespace sh { -struct OutputVariable; +struct COMPILER_EXPORT OutputVariable; } class TIntermNode; diff --git a/gfx/cairo/cairo/src/moz.build b/gfx/cairo/cairo/src/moz.build index e097c45ca6..1330fdd3e1 100644 --- a/gfx/cairo/cairo/src/moz.build +++ b/gfx/cairo/cairo/src/moz.build @@ -106,7 +106,7 @@ SOURCES += [ 'cairo-surface-wrapper.c', # redefinition of '_copy_transformed_pattern' ] -SOURCES += [ +UNIFIED_SOURCES += [ 'cairo-analysis-surface.c', 'cairo-arc.c', 'cairo-array.c', diff --git a/gfx/config/moz.build b/gfx/config/moz.build index 7311d8b363..d7ff074822 100644 --- a/gfx/config/moz.build +++ b/gfx/config/moz.build @@ -14,7 +14,7 @@ EXPORTS.mozilla.gfx += [ 'gfxVars.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'gfxConfig.cpp', 'gfxFeature.cpp', 'gfxVars.cpp', diff --git a/gfx/gl/GLContextGLX.h b/gfx/gl/GLContextGLX.h index f7dd90c2b5..d431116756 100644 --- a/gfx/gl/GLContextGLX.h +++ b/gfx/gl/GLContextGLX.h @@ -25,8 +25,7 @@ public: Display* display, GLXDrawable drawable, GLXFBConfig cfg, - bool deleteDrawable, - gfxXlibSurface* pixmap = nullptr, + Drawable ownedPixmap = X11None, ContextProfile profile = ContextProfile::OpenGLCompatibility); // Finds a GLXFBConfig compatible with the provided window. @@ -77,25 +76,26 @@ private: Display* aDisplay, GLXDrawable aDrawable, GLXContext aContext, - bool aDeleteDrawable, bool aDoubleBuffered, - gfxXlibSurface* aPixmap, - ContextProfile profile); + ContextProfile profile, + Drawable aOwnedPixmap = X11None); GLXContext mContext; Display* mDisplay; GLXDrawable mDrawable; Maybe<GLXDrawable> mOverrideDrawable; - bool mDeleteDrawable; + // The X pixmap associated with the GLX pixmap. If this is provided, then + // this class assumes responsibility for freeing both. Otherwise, the + // user of this class is responsibile for freeing the drawables. + const Drawable mOwnedPixmap; bool mDoubleBuffered; GLXLibrary* mGLX; - RefPtr<gfxXlibSurface> mPixmap; bool mOwnsContext; }; -} -} +} // namespace gl +} // namespace mozilla #endif // GLCONTEXTGLX_H_ diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp index c44b1a9f06..27d07e391d 100644 --- a/gfx/gl/GLContextProviderGLX.cpp +++ b/gfx/gl/GLContextProviderGLX.cpp @@ -327,7 +327,7 @@ GLXLibrary::CreatePixmap(gfxASurface* aSurface) X11None }; int numConfigs = 0; - Display* display = xs->XDisplay(); + Display *display = xs->XDisplay(); int xscreen = DefaultScreen(display); ScopedXFree<GLXFBConfig> cfgs(xChooseFBConfig(display, @@ -800,7 +800,7 @@ already_AddRefed<GLContextGLX> GLContextGLX::CreateGLContext(CreateContextFlags flags, const SurfaceCaps& caps, GLContextGLX* shareContext, bool isOffscreen, Display* display, GLXDrawable drawable, GLXFBConfig cfg, - bool deleteDrawable, gfxXlibSurface* pixmap, + Drawable ownedPixmap, ContextProfile profile) { GLXLibrary& glx = sGLXLibrary; @@ -860,8 +860,7 @@ GLContextGLX::CreateGLContext(CreateContextFlags flags, const SurfaceCaps& caps, if (context) { glContext = new GLContextGLX(flags, caps, shareContext, isOffscreen, display, - drawable, context, deleteDrawable, db, pixmap, - profile); + drawable, context, db, profile, ownedPixmap); if (!glContext->Init()) error = true; } else { @@ -896,8 +895,9 @@ GLContextGLX::~GLContextGLX() mGLX->xDestroyContext(mDisplay, mContext); - if (mDeleteDrawable) { + if (mOwnedPixmap) { mGLX->xDestroyPixmap(mDisplay, mDrawable); + XFreePixmap(mDisplay, mOwnedPixmap); } MOZ_ASSERT(!mOverrideDrawable); } @@ -1035,18 +1035,16 @@ GLContextGLX::GLContextGLX( Display* aDisplay, GLXDrawable aDrawable, GLXContext aContext, - bool aDeleteDrawable, bool aDoubleBuffered, - gfxXlibSurface* aPixmap, - ContextProfile profile) + ContextProfile profile, + Drawable aOwnedPixmap) : GLContext(flags, caps, shareContext, isOffscreen), mContext(aContext), mDisplay(aDisplay), mDrawable(aDrawable), - mDeleteDrawable(aDeleteDrawable), + mOwnedPixmap(aOwnedPixmap), mDoubleBuffered(aDoubleBuffered), mGLX(&sGLXLibrary), - mPixmap(aPixmap), mOwnsContext(true) { MOZ_ASSERT(mGLX); @@ -1098,10 +1096,9 @@ GLContextProviderGLX::CreateWrappingExisting(void* aContext, void* aSurface) false, // Offscreen (Display*)DefaultXDisplay(), // Display (GLXDrawable)aSurface, (GLXContext)aContext, - false, // aDeleteDrawable, true, - (gfxXlibSurface*)nullptr, - ContextProfile::OpenGLCompatibility); + ContextProfile::OpenGLCompatibility, + (Drawable)nullptr); glContext->mOwnsContext = false; gGlobalContext = glContext; @@ -1146,8 +1143,7 @@ CreateForWidget(Display* aXDisplay, Window aXWindow, bool aForceAccelerated) GLContextGLX* shareContext = GetGlobalContextGLX(); RefPtr<GLContextGLX> gl = GLContextGLX::CreateGLContext(CreateContextFlags::NONE, caps, shareContext, false, - aXDisplay, aXWindow, config, - false); + aXDisplay, aXWindow, config); return gl.forget(); } @@ -1326,24 +1322,20 @@ CreateOffscreenPixmapContext(CreateContextFlags flags, const IntSize& size, FindVisualAndDepth(display, visid, &visual, &depth); OffMainThreadScopedXErrorHandler xErrorHandler; - bool error = false; - Drawable drawable; GLXPixmap pixmap = 0; gfx::IntSize dummySize(16, 16); - RefPtr<gfxXlibSurface> surface = gfxXlibSurface::Create(DefaultScreenOfDisplay(display), - visual, - dummySize); - if (surface->CairoStatus() != 0) { - mozilla::Unused << xErrorHandler.SyncAndGetError(display); - return nullptr; + const auto drawable = + XCreatePixmap(display, DefaultRootWindow(display), + dummySize.width, dummySize.height, depth); + if (!drawable) { + mozilla::Unused << xErrorHandler.SyncAndGetError(display); + return nullptr; } - // Handle slightly different signature between glXCreatePixmap and // its pre-GLX-1.3 extension equivalent (though given the ABI, we // might not need to). - drawable = surface->XDrawable(); if (glx->GLXVersionCheck(1, 3)) { pixmap = glx->xCreatePixmap(display, config, drawable, nullptr); } else { @@ -1351,16 +1343,17 @@ CreateOffscreenPixmapContext(CreateContextFlags flags, const IntSize& size, } if (pixmap == 0) { - error = true; + XFreePixmap(display, drawable); + return nullptr; } bool serverError = xErrorHandler.SyncAndGetError(display); - if (error || serverError) + if (serverError) return nullptr; GLContextGLX* shareContext = GetGlobalContextGLX(); return GLContextGLX::CreateGLContext(flags, minCaps, shareContext, true, display, - pixmap, config, true, surface, profile); + pixmap, config, drawable, profile); } /*static*/ already_AddRefed<GLContext> diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build index c490400cbf..f9ff018373 100644 --- a/gfx/gl/moz.build +++ b/gfx/gl/moz.build @@ -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', diff --git a/gfx/graphite2/src/moz.build b/gfx/graphite2/src/moz.build index ecf396e2b0..2e517449a1 100644 --- a/gfx/graphite2/src/moz.build +++ b/gfx/graphite2/src/moz.build @@ -12,16 +12,16 @@ EXPORTS.graphite2 += [ ] if CONFIG['GNU_CC']: - SOURCES += [ + UNIFIED_SOURCES += [ 'direct_machine.cpp' ] else: - SOURCES += [ + UNIFIED_SOURCES += [ 'call_machine.cpp' ] # This should contain all of the _SOURCES from files.mk, except *_machine.cpp -SOURCES += [ +UNIFIED_SOURCES += [ 'CachedFace.cpp', 'CmapCache.cpp', 'Code.cpp', diff --git a/gfx/harfbuzz/src/moz.build b/gfx/harfbuzz/src/moz.build index 00abf656c0..92dbedb016 100644 --- a/gfx/harfbuzz/src/moz.build +++ b/gfx/harfbuzz/src/moz.build @@ -25,32 +25,35 @@ EXPORTS.harfbuzz += [ ] SOURCES += [ - 'hb-blob.cc', + 'hb-blob.cc', # error: use of undeclared identifier 'snprintf' (FreeBSD) + 'hb-common.cc', # error: use of undeclared identifier 'strdup' + 'hb-ot-math.cc', # conflict with hb-ot-layout.cc + 'hb-ot-shape-complex-hangul.cc', # error: redefinition of enumerator 'NONE' + 'hb-ot-shape-complex-indic.cc', # error: redefinition of enumerator 'INIT' + 'hb-ot-shape-complex-use.cc', # error: redefinition of 'basic_features' + 'hb-ot-shape.cc', # error: functions that differ only in their return type cannot be overloaded + 'hb-shape-plan.cc', # error: redefinition of 'hb_ot_shaper_face_data_ensure' +] + +UNIFIED_SOURCES += [ 'hb-buffer.cc', - 'hb-common.cc', 'hb-face.cc', 'hb-fallback-shape.cc', 'hb-font.cc', 'hb-ot-layout.cc', 'hb-ot-map.cc', - 'hb-ot-math.cc', 'hb-ot-shape-complex-arabic.cc', 'hb-ot-shape-complex-default.cc', - 'hb-ot-shape-complex-hangul.cc', 'hb-ot-shape-complex-hebrew.cc', 'hb-ot-shape-complex-indic-table.cc', - 'hb-ot-shape-complex-indic.cc', 'hb-ot-shape-complex-myanmar.cc', 'hb-ot-shape-complex-thai.cc', 'hb-ot-shape-complex-tibetan.cc', 'hb-ot-shape-complex-use-table.cc', - 'hb-ot-shape-complex-use.cc', 'hb-ot-shape-fallback.cc', 'hb-ot-shape-normalize.cc', - 'hb-ot-shape.cc', 'hb-ot-tag.cc', 'hb-set.cc', - 'hb-shape-plan.cc', 'hb-shape.cc', 'hb-shaper.cc', 'hb-unicode.cc', diff --git a/gfx/ipc/moz.build b/gfx/ipc/moz.build index 312fabcf66..43cdff703f 100644 --- a/gfx/ipc/moz.build +++ b/gfx/ipc/moz.build @@ -36,12 +36,12 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': 'SharedDIBSurface.h', 'SharedDIBWin.h', ] - SOURCES += [ + UNIFIED_SOURCES += [ 'SharedDIBSurface.cpp', 'SharedDIBWin.cpp', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'CompositorSession.cpp', 'CompositorWidgetVsyncObserver.cpp', 'D3DMessageUtils.cpp', diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 991e8ed2f0..724f2c7fdf 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -1545,115 +1545,6 @@ RefLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs) aAttrs = RefLayerAttributes(GetReferentId(), mEventRegionsOverride); } -/** - * StartFrameTimeRecording, together with StopFrameTimeRecording - * enable recording of frame intervals. - * - * To allow concurrent consumers, a cyclic array is used which serves all - * consumers, practically stateless with regard to consumers. - * - * To save resources, the buffer is allocated on first call to StartFrameTimeRecording - * and recording is paused if no consumer which called StartFrameTimeRecording is able - * to get valid results (because the cyclic buffer was overwritten since that call). - * - * To determine availability of the data upon StopFrameTimeRecording: - * - mRecording.mNextIndex increases on each PostPresent, and never resets. - * - Cyclic buffer position is realized as mNextIndex % bufferSize. - * - StartFrameTimeRecording returns mNextIndex. When StopFrameTimeRecording is called, - * the required start index is passed as an arg, and we're able to calculate the required - * length. If this length is bigger than bufferSize, it means data was overwritten. - * otherwise, we can return the entire sequence. - * - To determine if we need to pause, mLatestStartIndex is updated to mNextIndex - * on each call to StartFrameTimeRecording. If this index gets overwritten, - * it means that all earlier start indices obtained via StartFrameTimeRecording - * were also overwritten, hence, no point in recording, so pause. - * - mCurrentRunStartIndex indicates the oldest index of the recording after which - * the recording was not paused. If StopFrameTimeRecording is invoked with a start index - * older than this, it means that some frames were not recorded, so data is invalid. - */ -uint32_t -LayerManager::StartFrameTimeRecording(int32_t aBufferSize) -{ - if (mRecording.mIsPaused) { - mRecording.mIsPaused = false; - - if (!mRecording.mIntervals.Length()) { // Initialize recording buffers - mRecording.mIntervals.SetLength(aBufferSize); - } - - // After being paused, recent values got invalid. Update them to now. - mRecording.mLastFrameTime = TimeStamp::Now(); - - // Any recording which started before this is invalid, since we were paused. - mRecording.mCurrentRunStartIndex = mRecording.mNextIndex; - } - - // If we'll overwrite this index, there are no more consumers with aStartIndex - // for which we're able to provide the full recording, so no point in keep recording. - mRecording.mLatestStartIndex = mRecording.mNextIndex; - return mRecording.mNextIndex; -} - -void -LayerManager::RecordFrame() -{ - if (!mRecording.mIsPaused) { - TimeStamp now = TimeStamp::Now(); - uint32_t i = mRecording.mNextIndex % mRecording.mIntervals.Length(); - mRecording.mIntervals[i] = static_cast<float>((now - mRecording.mLastFrameTime) - .ToMilliseconds()); - mRecording.mNextIndex++; - mRecording.mLastFrameTime = now; - - if (mRecording.mNextIndex > (mRecording.mLatestStartIndex + mRecording.mIntervals.Length())) { - // We've just overwritten the most recent recording start -> pause. - mRecording.mIsPaused = true; - } - } -} - -void -LayerManager::PostPresent() -{ - if (!mTabSwitchStart.IsNull()) { - mTabSwitchStart = TimeStamp(); - } -} - -void -LayerManager::StopFrameTimeRecording(uint32_t aStartIndex, - nsTArray<float>& aFrameIntervals) -{ - uint32_t bufferSize = mRecording.mIntervals.Length(); - uint32_t length = mRecording.mNextIndex - aStartIndex; - if (mRecording.mIsPaused || length > bufferSize || aStartIndex < mRecording.mCurrentRunStartIndex) { - // aStartIndex is too old. Also if aStartIndex was issued before mRecordingNextIndex overflowed (uint32_t) - // and stopped after the overflow (would happen once every 828 days of constant 60fps). - length = 0; - } - - if (!length) { - aFrameIntervals.Clear(); - return; // empty recording, return empty arrays. - } - // Set length in advance to avoid possibly repeated reallocations - aFrameIntervals.SetLength(length); - - uint32_t cyclicPos = aStartIndex % bufferSize; - for (uint32_t i = 0; i < length; i++, cyclicPos++) { - if (cyclicPos == bufferSize) { - cyclicPos = 0; - } - aFrameIntervals[i] = mRecording.mIntervals[cyclicPos]; - } -} - -void -LayerManager::BeginTabSwitch() -{ - mTabSwitchStart = TimeStamp::Now(); -} - static void PrintInfo(std::stringstream& aStream, LayerComposite* aLayerComposite); #ifdef MOZ_DUMP_PAINTING diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 805d41d48e..8b5e0a4ab5 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -586,36 +586,6 @@ public: */ void LogSelf(const char* aPrefix=""); - /** - * Record (and return) frame-intervals and paint-times for frames which were presented - * between calling StartFrameTimeRecording and StopFrameTimeRecording. - * - * - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late - * (elements were overwritten since Start), result is considered invalid and hence empty. - * - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent). - * Can be changed (up to 1 hour) via pref: toolkit.framesRecording.bufferSize. - * - Note: the first frame-interval may be longer than expected because last frame - * might have been presented some time before calling StartFrameTimeRecording. - */ - - /** - * Returns a handle which represents current recording start position. - */ - virtual uint32_t StartFrameTimeRecording(int32_t aBufferSize); - - /** - * Clears, then populates aFrameIntervals with the recorded frame timing - * data. The array will be empty if data was overwritten since - * aStartIndex was obtained. - */ - virtual void StopFrameTimeRecording(uint32_t aStartIndex, - nsTArray<float>& aFrameIntervals); - - void RecordFrame(); - void PostPresent(); - - void BeginTabSwitch(); - static bool IsLogEnabled(); static mozilla::LogModule* GetLog(); @@ -686,27 +656,6 @@ protected: TimeStamp mAnimationReadyTime; // The count of pixels that were painted in the current transaction. uint32_t mPaintedPixelCount; -private: - struct FramesTimingRecording - { - // Stores state and data for frame intervals and paint times recording. - // see LayerManager::StartFrameTimeRecording() at Layers.cpp for more details. - FramesTimingRecording() - : mNextIndex(0) - , mLatestStartIndex(0) - , mCurrentRunStartIndex(0) - , mIsPaused(true) - {} - nsTArray<float> mIntervals; - TimeStamp mLastFrameTime; - uint32_t mNextIndex; - uint32_t mLatestStartIndex; - uint32_t mCurrentRunStartIndex; - bool mIsPaused; - }; - FramesTimingRecording mRecording; - - TimeStamp mTabSwitchStart; public: /* diff --git a/gfx/layers/apz/public/IAPZCTreeManager.cpp b/gfx/layers/apz/public/IAPZCTreeManager.cpp index f60cb9c87f..9b4e746e5d 100644 --- a/gfx/layers/apz/public/IAPZCTreeManager.cpp +++ b/gfx/layers/apz/public/IAPZCTreeManager.cpp @@ -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. diff --git a/gfx/layers/apz/public/IAPZCTreeManager.h b/gfx/layers/apz/public/IAPZCTreeManager.h index f3cc37a716..2bd50fb986 100644 --- a/gfx/layers/apz/public/IAPZCTreeManager.h +++ b/gfx/layers/apz/public/IAPZCTreeManager.h @@ -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) diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 297bf57fe2..c308754e5a 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -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 diff --git a/gfx/layers/basic/BasicLayerManager.cpp b/gfx/layers/basic/BasicLayerManager.cpp index 41c37dc8ea..91e0696aa7 100644 --- a/gfx/layers/basic/BasicLayerManager.cpp +++ b/gfx/layers/basic/BasicLayerManager.cpp @@ -629,8 +629,6 @@ BasicLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback, if (mWidget) { FlashWidgetUpdateArea(mTarget); } - RecordFrame(); - PostPresent(); if (!mTransactionIncomplete) { // Clear out target if we have a complete transaction. diff --git a/gfx/layers/client/ClientLayerManager.cpp b/gfx/layers/client/ClientLayerManager.cpp index ddca3ec3c1..95af8fb5fc 100644 --- a/gfx/layers/client/ClientLayerManager.cpp +++ b/gfx/layers/client/ClientLayerManager.cpp @@ -617,28 +617,6 @@ ClientLayerManager::SendInvalidRegion(const nsIntRegion& aRegion) } } -uint32_t -ClientLayerManager::StartFrameTimeRecording(int32_t aBufferSize) -{ - CompositorBridgeChild* renderer = GetRemoteRenderer(); - if (renderer) { - uint32_t startIndex; - renderer->SendStartFrameTimeRecording(aBufferSize, &startIndex); - return startIndex; - } - return -1; -} - -void -ClientLayerManager::StopFrameTimeRecording(uint32_t aStartIndex, - nsTArray<float>& aFrameIntervals) -{ - CompositorBridgeChild* renderer = GetRemoteRenderer(); - if (renderer) { - renderer->SendStopFrameTimeRecording(aStartIndex, &aFrameIntervals); - } -} - void ClientLayerManager::ForwardTransaction(bool aScheduleComposite) { diff --git a/gfx/layers/client/ClientLayerManager.h b/gfx/layers/client/ClientLayerManager.h index 5bcd5e4121..e7ea7f8116 100644 --- a/gfx/layers/client/ClientLayerManager.h +++ b/gfx/layers/client/ClientLayerManager.h @@ -98,11 +98,6 @@ public: virtual void FlushRendering() override; void SendInvalidRegion(const nsIntRegion& aRegion); - virtual uint32_t StartFrameTimeRecording(int32_t aBufferSize) override; - - virtual void StopFrameTimeRecording(uint32_t aStartIndex, - nsTArray<float>& aFrameIntervals) override; - virtual bool NeedsWidgetInvalidation() override { return false; } ShadowableLayer* Hold(Layer* aLayer); diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 0ee11bdfb1..fde5eb1c57 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -966,8 +966,6 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi } mCompositor->GetWidget()->PostRender(&widgetContext); - - RecordFrame(); } already_AddRefed<PaintedLayerComposite> diff --git a/gfx/layers/ipc/CompositorBridgeChild.cpp b/gfx/layers/ipc/CompositorBridgeChild.cpp index f0a1b861ae..ed5c3d52c5 100644 --- a/gfx/layers/ipc/CompositorBridgeChild.cpp +++ b/gfx/layers/ipc/CompositorBridgeChild.cpp @@ -803,24 +803,6 @@ CompositorBridgeChild::SendFlushRendering() } bool -CompositorBridgeChild::SendStartFrameTimeRecording(const int32_t& bufferSize, uint32_t* startIndex) -{ - if (!mCanSend) { - return false; - } - return PCompositorBridgeChild::SendStartFrameTimeRecording(bufferSize, startIndex); -} - -bool -CompositorBridgeChild::SendStopFrameTimeRecording(const uint32_t& startIndex, nsTArray<float>* intervals) -{ - if (!mCanSend) { - return false; - } - return PCompositorBridgeChild::SendStopFrameTimeRecording(startIndex, intervals); -} - -bool CompositorBridgeChild::SendNotifyRegionInvalidated(const nsIntRegion& region) { if (!mCanSend) { diff --git a/gfx/layers/ipc/CompositorBridgeChild.h b/gfx/layers/ipc/CompositorBridgeChild.h index e5a4906b3e..55b8d37c2d 100644 --- a/gfx/layers/ipc/CompositorBridgeChild.h +++ b/gfx/layers/ipc/CompositorBridgeChild.h @@ -159,8 +159,6 @@ public: bool SendMakeSnapshot(const SurfaceDescriptor& inSnapshot, const gfx::IntRect& dirtyRect); bool SendFlushRendering(); bool SendGetTileSize(int32_t* tileWidth, int32_t* tileHeight); - bool SendStartFrameTimeRecording(const int32_t& bufferSize, uint32_t* startIndex); - bool SendStopFrameTimeRecording(const uint32_t& startIndex, nsTArray<float>* intervals); bool SendNotifyRegionInvalidated(const nsIntRegion& region); bool SendRequestNotifyAfterRemotePaint(); bool SendClearApproximatelyVisibleRegions(uint64_t aLayersId, uint32_t aPresShellId); diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index d08176b6a5..f92e74c147 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -817,27 +817,6 @@ CompositorBridgeParent::Invalidate() } bool -CompositorBridgeParent::RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) -{ - if (mLayerManager) { - *aOutStartIndex = mLayerManager->StartFrameTimeRecording(aBufferSize); - } else { - *aOutStartIndex = 0; - } - return true; -} - -bool -CompositorBridgeParent::RecvStopFrameTimeRecording(const uint32_t& aStartIndex, - InfallibleTArray<float>* intervals) -{ - if (mLayerManager) { - mLayerManager->StopFrameTimeRecording(aStartIndex, *intervals); - } - return true; -} - -bool CompositorBridgeParent::RecvClearApproximatelyVisibleRegions(const uint64_t& aLayersId, const uint32_t& aPresShellId) { diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h index d4f2da54c2..98812f75c8 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -281,8 +281,6 @@ public: } virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override; - virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override; - virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override; // Unused for chrome <-> compositor communication (which this class does). // @see CrossProcessCompositorBridgeParent::RecvRequestNotifyAfterRemotePaint diff --git a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h index 76a90f71b1..919fcfbc4f 100644 --- a/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h +++ b/gfx/layers/ipc/CrossProcessCompositorBridgeParent.h @@ -56,8 +56,6 @@ public: virtual bool RecvFlushRendering() override { return true; } virtual bool RecvForcePresent() override { return true; } virtual bool RecvNotifyRegionInvalidated(const nsIntRegion& aRegion) override { return true; } - virtual bool RecvStartFrameTimeRecording(const int32_t& aBufferSize, uint32_t* aOutStartIndex) override { return true; } - virtual bool RecvStopFrameTimeRecording(const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override { return true; } virtual bool RecvClearApproximatelyVisibleRegions(const uint64_t& aLayersId, const uint32_t& aPresShellId) override; diff --git a/gfx/layers/ipc/PCompositorBridge.ipdl b/gfx/layers/ipc/PCompositorBridge.ipdl index 03a3535063..f47e45d92c 100644 --- a/gfx/layers/ipc/PCompositorBridge.ipdl +++ b/gfx/layers/ipc/PCompositorBridge.ipdl @@ -184,12 +184,6 @@ parent: // work around a windows presentation bug (See Bug 1232042) async ForcePresent(); - sync StartFrameTimeRecording(int32_t bufferSize) - returns (uint32_t startIndex); - - sync StopFrameTimeRecording(uint32_t startIndex) - returns (float[] intervals); - // layersBackendHints is an ordered list of preffered backends where // layersBackendHints[0] is the best backend. If any hints are LayersBackend::LAYERS_NONE // that hint is ignored. diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index be0c95ba20..1449c3477a 100644 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -48,6 +48,8 @@ EXPORTS += [ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': SOURCES += [ 'D3D11ShareHandleImage.cpp', + ] + UNIFIED_SOURCES += [ 'D3D9SurfaceImage.cpp', 'IMFYCbCrImage.cpp', 'TextureDIB.cpp', @@ -64,7 +66,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': SOURCES += [ 'd3d11/CompositorD3D11.cpp', 'd3d11/ReadbackManagerD3D11.cpp', - 'd3d11/TextureD3D11.cpp', + ] + UNIFIED_SOURCES += [ 'd3d11/TextureD3D11.cpp', ] EXPORTS.gfxipc += [ @@ -208,14 +211,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', @@ -250,7 +255,6 @@ SOURCES += [ 'basic/BasicColorLayer.cpp', 'basic/BasicCompositor.cpp', 'basic/BasicContainerLayer.cpp', - 'basic/BasicImageLayer.cpp', 'basic/BasicImages.cpp', 'basic/BasicLayerManager.cpp', 'basic/BasicLayersImpl.cpp', @@ -299,7 +303,6 @@ SOURCES += [ 'Effects.cpp', 'FrameMetrics.cpp', 'GLImages.cpp', - 'ImageContainer.cpp', 'ImageDataSerializer.cpp', 'ImageLayers.cpp', 'ipc/APZChild.cpp', @@ -309,7 +312,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', @@ -327,12 +332,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', @@ -340,7 +343,6 @@ SOURCES += [ 'opengl/TextureClientOGL.cpp', 'opengl/TextureHostOGL.cpp', 'opengl/TexturePoolOGL.cpp', - 'PersistentBufferProvider.cpp', 'protobuf/LayerScopePacket.pb.cc', 'ReadbackProcessor.cpp', 'RenderTrace.cpp', @@ -348,11 +350,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 @@ -420,6 +424,6 @@ if CONFIG['GNU_CXX']: CXXFLAGS += ['-Wno-error=shadow'] if CONFIG['MOZ_ENABLE_SKIA']: - SOURCES += [ + UNIFIED_SOURCES += [ 'composite/PaintCounter.cpp', ] diff --git a/gfx/ots/src/moz.build b/gfx/ots/src/moz.build index 909a2092e8..b5c7ceca9e 100644 --- a/gfx/ots/src/moz.build +++ b/gfx/ots/src/moz.build @@ -8,7 +8,7 @@ EXPORTS += [ '../include/ots-memory-stream.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'avar.cc', 'cff.cc', 'cff_charstring.cc', diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py index a15fd40861..33594bd32c 100755 --- a/gfx/skia/generate_mozbuild.py +++ b/gfx/skia/generate_mozbuild.py @@ -75,7 +75,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in { if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': DEFINES['UNICODE'] = True DEFINES['_UNICODE'] = True - SOURCES += [ + UNIFIED_SOURCES += [ 'skia/src/fonts/SkFontMgr_indirect.cpp', 'skia/src/fonts/SkRemotableFontMgr.cpp', ] @@ -407,7 +407,7 @@ def write_sources(f, values, indent): else: sources['unified'].add(item) - write_list(f, "SOURCES", sources['unified'], indent) + write_list(f, "UNIFIED_SOURCES", sources['unified'], indent) write_list(f, "SOURCES", sources['nonunified'], indent) def write_list(f, name, values, indent): diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build index 75a66dd28e..61d8c8570d 100644 --- a/gfx/skia/moz.build +++ b/gfx/skia/moz.build @@ -22,7 +22,7 @@ if CONFIG['MOZ_OPTIMIZE']: elif CONFIG['GNU_CC']: skia_opt_flags += ['-O2'] -SOURCES += [ +UNIFIED_SOURCES += [ 'skia/src/core/SkAAClip.cpp', 'skia/src/core/SkAlphaRuns.cpp', 'skia/src/core/SkAnnotation.cpp', @@ -308,7 +308,7 @@ SOURCES['skia/src/core/SkSpriteBlitter4f.cpp'].flags += skia_opt_flags SOURCES['skia/src/core/SkSpriteBlitter_ARGB32.cpp'].flags += skia_opt_flags SOURCES['skia/src/core/SkSpriteBlitter_RGB16.cpp'].flags += skia_opt_flags if CONFIG['MOZ_ENABLE_SKIA_PDF']: - SOURCES += [ + UNIFIED_SOURCES += [ 'skia/src/core/SkMD5.cpp', 'skia/src/pdf/SkDeflate.cpp', 'skia/src/pdf/SkJpegInfo.cpp', @@ -332,7 +332,7 @@ if CONFIG['MOZ_ENABLE_SKIA_PDF']: 'skia/src/pdf/SkPDFFont.cpp', ] if CONFIG['MOZ_ENABLE_SKIA_GPU']: - SOURCES += [ + UNIFIED_SOURCES += [ 'skia/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp', 'skia/src/gpu/batches/GrAnalyticRectBatch.cpp', 'skia/src/gpu/batches/GrAtlasTextBatch.cpp', @@ -517,7 +517,7 @@ if CONFIG['MOZ_ENABLE_SKIA_GPU']: 'skia/src/image/SkImage_Gpu.cpp', ] if CONFIG['MOZ_WIDGET_TOOLKIT'] in {'cocoa', 'uikit'}: - SOURCES += [ + UNIFIED_SOURCES += [ 'skia/src/ports/SkDebug_stdio.cpp', 'skia/src/ports/SkOSFile_posix.cpp', 'skia/src/ports/SkOSLibrary_posix.cpp', @@ -530,7 +530,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in {'cocoa', 'uikit'}: 'skia/src/ports/SkFontHost_mac.cpp', ] if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: - SOURCES += [ + UNIFIED_SOURCES += [ 'skia/src/ports/SkDebug_stdio.cpp', 'skia/src/ports/SkOSFile_posix.cpp', 'skia/src/ports/SkOSLibrary_posix.cpp', @@ -562,7 +562,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': 'skia/src/utils/win/SkIStream.cpp', ] if CONFIG['INTEL_ARCHITECTURE']: - SOURCES += [ + UNIFIED_SOURCES += [ 'skia/src/opts/opts_check_x86.cpp', ] SOURCES += [ @@ -586,7 +586,7 @@ if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += skia_opt_flags SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += skia_opt_flags elif CONFIG['CPU_ARCH'] in ('arm', 'aarch64') and CONFIG['GNU_CC']: - SOURCES += [ + UNIFIED_SOURCES += [ 'skia/src/core/SkUtilsArm.cpp', ] SOURCES += [ diff --git a/gfx/src/moz.build b/gfx/src/moz.build index 993d4bde2c..2029a10a10 100644 --- a/gfx/src/moz.build +++ b/gfx/src/moz.build @@ -55,12 +55,11 @@ if CONFIG['MOZ_X11']: 'X11Util.cpp', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'DriverCrashGuard.cpp', 'FilterSupport.cpp', 'gfxTelemetry.cpp', 'nsColor.cpp', - 'nsDeviceContext.cpp', 'nsFont.cpp', 'nsFontMetrics.cpp', 'nsRect.cpp', @@ -72,6 +71,11 @@ SOURCES += [ 'TiledRegion.cpp', ] +# nsDeviceContext.cpp cannot be built in unified mode because it pulls in OS X system headers. +SOURCES += [ + 'nsDeviceContext.cpp', +] + include('/ipc/chromium/chromium-config.mozbuild') LOCAL_INCLUDES += [ diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 6b55935248..73d1741922 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -731,8 +731,7 @@ public: false, mXDisplay, root, - config, - false); + config); if (!mGLContext) { lock.NotifyAll(); diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index 0ee6c67d30..cc1d5227b6 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -592,6 +592,7 @@ private: DECL_GFX_PREF(Once, "webgl.force-layers-readback", WebGLForceLayersReadback, bool, false); DECL_GFX_PREF(Live, "webgl.lose-context-on-memory-pressure", WebGLLoseContextOnMemoryPressure, bool, false); DECL_GFX_PREF(Live, "webgl.max-warnings-per-context", WebGLMaxWarningsPerContext, uint32_t, 32); + DECL_GFX_PREF(Live, "webgl.max-size-per-texture-mb", WebGLMaxSizePerTextureMB, uint32_t, 1024); DECL_GFX_PREF(Live, "webgl.min_capability_mode", WebGLMinCapabilityMode, bool, false); DECL_GFX_PREF(Live, "webgl.msaa-force", WebGLForceMSAA, bool, false); DECL_GFX_PREF(Live, "webgl.prefer-16bpp", WebGLPrefer16bpp, bool, false); diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build index 1d3cf3bc93..2d4dc41a40 100644 --- a/gfx/thebes/moz.build +++ b/gfx/thebes/moz.build @@ -121,9 +121,11 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': 'PrintTargetPDF.h', 'PrintTargetWindows.h', ] + UNIFIED_SOURCES += [ + 'gfxDWriteFontList.cpp', + ] SOURCES += [ 'gfxDWriteCommon.cpp', - 'gfxDWriteFontList.cpp', 'gfxDWriteFonts.cpp', 'gfxGDIFont.cpp', 'gfxGDIFontList.cpp', @@ -142,14 +144,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', @@ -165,9 +180,7 @@ SOURCES += [ 'gfxMathTable.cpp', 'gfxMatrix.cpp', 'gfxPattern.cpp', - 'gfxPlatform.cpp', 'gfxPlatformFontList.cpp', - 'gfxPrefs.cpp', 'gfxRect.cpp', 'gfxScriptItemizer.cpp', 'gfxSkipChars.cpp', @@ -176,18 +189,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', ] diff --git a/gfx/ycbcr/moz.build b/gfx/ycbcr/moz.build index 7e04c96ed1..0c8eb7b83c 100644 --- a/gfx/ycbcr/moz.build +++ b/gfx/ycbcr/moz.build @@ -7,7 +7,7 @@ EXPORTS += [ 'YCbCrUtils.h', ] -SOURCES += [ +UNIFIED_SOURCES += [ 'scale_yuv_argb.cpp', 'ycbcr_to_rgb565.cpp', 'YCbCrUtils.cpp', |