Bug 1883287 - Don't wait for the hidden window to be created on Linux to load the...
[gecko.git] / gfx / layers / moz.build
blob1bf2e83804b483f744742563ebc20feed44ee2fd
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 with Files("**"):
8     BUG_COMPONENT = ("Core", "Graphics")
10 with Files("apz/**"):
11     BUG_COMPONENT = ("Core", "Panning and Zooming")
13 EXPORTS += [
14     "composite/CompositableHost.h",
15     "CompositorTypes.h",
16     "FrameMetrics.h",
17     "GLImages.h",
18     "GPUVideoImage.h",
19     "ImageContainer.h",
20     "ImageTypes.h",
21     "IMFYCbCrImage.h",
22     "LayersTypes.h",
23     "LayerUserData.h",
24     "opengl/OGLShaderConfig.h",
25     "opengl/OGLShaderProgram.h",
28 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
29     SOURCES += [
30         "D3D11ShareHandleImage.cpp",
31         "D3D11TextureIMFSampleImage.cpp",
32         "D3D11YCbCrImage.cpp",
33     ]
34     UNIFIED_SOURCES += [
35         "IMFYCbCrImage.cpp",
36     ]
37     if CONFIG["MOZ_ENABLE_D3D10_LAYER"]:
38         EXPORTS.mozilla.layers += [
39             "d3d11/CompositorD3D11.h",
40             "d3d11/DeviceAttachmentsD3D11.h",
41             "d3d11/FenceD3D11.h",
42             "d3d11/GpuProcessD3D11QueryMap.h",
43             "d3d11/GpuProcessD3D11TextureMap.h",
44             "d3d11/HelpersD3D11.h",
45             "d3d11/ShaderDefinitionsD3D11.h",
46             "d3d11/TextureD3D11.h",
47             "d3d11/TextureHostWrapperD3D11.h",
48         ]
49         UNIFIED_SOURCES += [
50             "d3d11/FenceD3D11.cpp",
51             "d3d11/GpuProcessD3D11QueryMap.cpp",
52             "d3d11/GpuProcessD3D11TextureMap.cpp",
53             "d3d11/TextureD3D11.cpp",
54             "d3d11/TextureHostWrapperD3D11.cpp",
55         ]
56         SOURCES += [
57             "d3d11/CompositorD3D11.cpp",
58             "d3d11/DeviceAttachmentsD3D11.cpp",
59         ]
60     if CONFIG["MOZ_WMF_MEDIA_ENGINE"]:
61         EXPORTS.mozilla.layers += [
62             "DcompSurfaceImage.h",
63         ]
64         UNIFIED_SOURCES += [
65             "DcompSurfaceImage.cpp",
66         ]
68 EXPORTS.gfxipc += [
69     "ipc/ShadowLayerUtils.h",
70     "ipc/SurfaceDescriptor.h",
73 EXPORTS.mozilla.dom += [
74     "apz/util/CheckerboardReportService.h",
77 EXPORTS.mozilla.gfx += [
78     "BuildConstants.h",
81 EXPORTS.mozilla.layers += [
82     "AnimationHelper.h",
83     "AnimationInfo.h",
84     "AnimationStorageData.h",
85     "apz/public/APZInputBridge.h",
86     "apz/public/APZPublicUtils.h",
87     "apz/public/APZSampler.h",
88     "apz/public/APZUpdater.h",
89     "apz/public/CompositorController.h",
90     "apz/public/GeckoContentController.h",
91     "apz/public/GeckoContentControllerTypes.h",
92     "apz/public/IAPZCTreeManager.h",
93     "apz/public/MatrixMessage.h",
94     # exporting things from apz/src is temporary until we extract a
95     # proper interface for the code there
96     "apz/src/APZUtils.h",
97     "apz/src/AsyncDragMetrics.h",
98     "apz/src/FocusTarget.h",
99     "apz/src/KeyboardMap.h",
100     "apz/src/KeyboardScrollAction.h",
101     "apz/testutil/APZTestData.h",
102     "apz/util/ActiveElementManager.h",
103     "apz/util/APZCCallbackHelper.h",
104     "apz/util/APZEventState.h",
105     "apz/util/APZTaskRunnable.h",
106     "apz/util/APZThreadUtils.h",
107     "apz/util/ChromeProcessController.h",
108     "apz/util/ContentProcessController.h",
109     "apz/util/DoubleTapToZoom.h",
110     "apz/util/InputAPZContext.h",
111     "apz/util/ScrollingInteractionContext.h",
112     "apz/util/ScrollLinkedEffectDetector.h",
113     "apz/util/TouchActionHelper.h",
114     "apz/util/TouchCounter.h",
115     "AtomicRefCountedWithFinalize.h",
116     "AxisPhysicsModel.h",
117     "AxisPhysicsMSDModel.h",
118     "BSPTree.h",
119     "BufferTexture.h",
120     "BuildConstants.h",
121     "CanvasDrawEventRecorder.h",
122     "CanvasRenderer.h",
123     "client/CanvasClient.h",
124     "client/CompositableClient.h",
125     "client/GPUVideoTextureClient.h",
126     "client/ImageClient.h",
127     "client/TextureClient.h",
128     "client/TextureClientPool.h",
129     "client/TextureClientRecycleAllocator.h",
130     "client/TextureClientSharedSurface.h",
131     "client/TextureRecorded.h",
132     "composite/Diagnostics.h",
133     "composite/FrameUniformityData.h",
134     "composite/GPUVideoTextureHost.h",
135     "composite/ImageComposite.h",
136     "composite/RemoteTextureHostWrapper.h",
137     "composite/TextureHost.h",
138     "CompositionRecorder.h",
139     "Compositor.h",
140     "CompositorAnimationStorage.h",
141     "CompositorTypes.h",
142     "D3D11ShareHandleImage.h",
143     "D3D11TextureIMFSampleImage.h",
144     "D3D11YCbCrImage.h",
145     "DirectionUtils.h",
146     "Effects.h",
147     "ImageDataSerializer.h",
148     "ipc/ActiveResource.h",
149     "ipc/APZChild.h",
150     "ipc/APZCTreeManagerChild.h",
151     "ipc/APZCTreeManagerParent.h",
152     "ipc/APZInputBridgeChild.h",
153     "ipc/APZInputBridgeParent.h",
154     "ipc/CanvasChild.h",
155     "ipc/CanvasTranslator.h",
156     "ipc/CompositableForwarder.h",
157     "ipc/CompositableTransactionParent.h",
158     "ipc/CompositorBridgeChild.h",
159     "ipc/CompositorBridgeParent.h",
160     "ipc/CompositorManagerChild.h",
161     "ipc/CompositorManagerParent.h",
162     "ipc/CompositorThread.h",
163     "ipc/CompositorVsyncScheduler.h",
164     "ipc/CompositorVsyncSchedulerOwner.h",
165     "ipc/ContentCompositorBridgeParent.h",
166     "ipc/ImageBridgeChild.h",
167     "ipc/ImageBridgeParent.h",
168     "ipc/ISurfaceAllocator.h",
169     "ipc/KnowsCompositor.h",
170     "ipc/LayersMessageUtils.h",
171     "ipc/LayerTreeOwnerTracker.h",
172     "ipc/RefCountedShmem.h",
173     "ipc/RemoteContentController.h",
174     "ipc/SharedPlanarYCbCrImage.h",
175     "ipc/SharedRGBImage.h",
176     "ipc/SharedSurfacesChild.h",
177     "ipc/SharedSurfacesMemoryReport.h",
178     "ipc/SharedSurfacesParent.h",
179     "ipc/SynchronousTask.h",
180     "ipc/TextureForwarder.h",
181     "ipc/UiCompositorControllerChild.h",
182     "ipc/UiCompositorControllerMessageTypes.h",
183     "ipc/UiCompositorControllerParent.h",
184     "ipc/VideoBridgeChild.h",
185     "ipc/VideoBridgeParent.h",
186     "ipc/VideoBridgeUtils.h",
187     "LayersTypes.h",
188     "MemoryPressureObserver.h",
189     "NativeLayer.h",
190     "OOPCanvasRenderer.h",
191     "opengl/CompositingRenderTargetOGL.h",
192     "opengl/CompositorOGL.h",
193     "opengl/MacIOSurfaceTextureClientOGL.h",
194     "opengl/MacIOSurfaceTextureHostOGL.h",
195     "opengl/TextureClientOGL.h",
196     "opengl/TextureHostOGL.h",
197     "PersistentBufferProvider.h",
198     "ProfilerScreenshots.h",
199     "RecordedCanvasEventImpl.h",
200     "RemoteTextureMap.h",
201     "RepaintRequest.h",
202     "SampleTime.h",
203     "ScreenshotGrabber.h",
204     "ScrollableLayerGuid.h",
205     "ScrollbarData.h",
206     "ShareableCanvasRenderer.h",
207     "SourceSurfaceSharedData.h",
208     "SurfacePool.h",
209     "SyncObject.h",
210     "TextureSourceProvider.h",
211     "TextureWrapperImage.h",
212     "TransactionIdAllocator.h",
213     "TreeTraversal.h",
214     "UpdateImageHelper.h",
215     "wr/AsyncImagePipelineManager.h",
216     "wr/AsyncImagePipelineOp.h",
217     "wr/ClipManager.h",
218     "wr/DisplayItemCache.h",
219     "wr/HitTestInfoManager.h",
220     "wr/IpcResourceUpdateQueue.h",
221     "wr/OMTAController.h",
222     "wr/OMTASampler.h",
223     "wr/RenderRootStateManager.h",
224     "wr/RenderRootTypes.h",
225     "wr/StackingContextHelper.h",
226     "wr/WebRenderBridgeChild.h",
227     "wr/WebRenderBridgeParent.h",
228     "wr/WebRenderCanvasRenderer.h",
229     "wr/WebRenderCommandBuilder.h",
230     "wr/WebRenderDrawEventRecorder.h",
231     "wr/WebRenderImageHost.h",
232     "wr/WebRenderLayerManager.h",
233     "wr/WebRenderMessageUtils.h",
234     "wr/WebRenderScrollData.h",
235     "wr/WebRenderScrollDataWrapper.h",
236     "wr/WebRenderTextureHost.h",
237     "wr/WebRenderUserData.h",
238     "ZoomConstraints.h",
241 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
242     EXPORTS.mozilla.layers += [
243         "DMABUFSurfaceImage.h",
244         "opengl/DMABUFTextureClientOGL.h",
245         "opengl/DMABUFTextureHostOGL.h",
246     ]
247     SOURCES += [
248         "DMABUFSurfaceImage.cpp",
249         "opengl/DMABUFTextureClientOGL.cpp",
250         "opengl/DMABUFTextureHostOGL.cpp",
251     ]
253 if CONFIG["MOZ_WAYLAND"]:
254     EXPORTS.mozilla.layers += [
255         "NativeLayerWayland.h",
256         "SurfacePoolWayland.h",
257     ]
258     UNIFIED_SOURCES += [
259         "NativeLayerWayland.cpp",
260         "SurfacePoolWayland.cpp",
261     ]
263 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
264     EXPORTS.mozilla.layers += [
265         "NativeLayerCA.h",
266         "SurfacePoolCA.h",
267     ]
268     EXPORTS += [
269         "MacIOSurfaceHelpers.h",
270         "MacIOSurfaceImage.h",
271     ]
272     UNIFIED_SOURCES += [
273         "NativeLayerCA.mm",
274         "SurfacePoolCA.mm",
275     ]
276     SOURCES += [
277         "MacIOSurfaceHelpers.cpp",
278         "MacIOSurfaceImage.cpp",
279     ]
280     OS_LIBS += [
281         "-framework IOSurface",
282     ]
284 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
285     EXPORTS.mozilla.layers += [
286         "AndroidHardwareBuffer.h",
287     ]
288     UNIFIED_SOURCES += [
289         "AndroidHardwareBuffer.cpp",
290         "apz/src/AndroidAPZ.cpp",
291         "apz/src/AndroidFlingPhysics.cpp",
292         "apz/src/AndroidVelocityTracker.cpp",
293     ]
295 UNIFIED_SOURCES += [
296     "AnimationHelper.cpp",
297     "AnimationInfo.cpp",
298     "apz/src/APZCTreeManager.cpp",
299     "apz/src/APZInputBridge.cpp",
300     "apz/src/APZPublicUtils.cpp",
301     "apz/src/APZSampler.cpp",
302     "apz/src/APZUpdater.cpp",
303     "apz/src/APZUtils.cpp",
304     "apz/src/AsyncPanZoomController.cpp",
305     "apz/src/AutoscrollAnimation.cpp",
306     "apz/src/Axis.cpp",
307     "apz/src/CheckerboardEvent.cpp",
308     "apz/src/DragTracker.cpp",
309     "apz/src/ExpectedGeckoMetrics.cpp",
310     "apz/src/FlingAccelerator.cpp",
311     "apz/src/FocusState.cpp",
312     "apz/src/FocusTarget.cpp",
313     "apz/src/GenericScrollAnimation.cpp",
314     "apz/src/GestureEventListener.cpp",
315     "apz/src/HitTestingTreeNode.cpp",
316     "apz/src/IAPZHitTester.cpp",
317     "apz/src/InputBlockState.cpp",
318     "apz/src/InputQueue.cpp",
319     "apz/src/KeyboardMap.cpp",
320     "apz/src/KeyboardScrollAction.cpp",
321     "apz/src/OverscrollHandoffState.cpp",
322     "apz/src/OvershootDetector.cpp",
323     "apz/src/PotentialCheckerboardDurationTracker.cpp",
324     "apz/src/QueuedInput.cpp",
325     "apz/src/SampledAPZCState.cpp",
326     "apz/src/ScrollThumbUtils.cpp",
327     "apz/src/SimpleVelocityTracker.cpp",
328     "apz/src/SmoothMsdScrollAnimation.cpp",
329     "apz/src/SmoothScrollAnimation.cpp",
330     "apz/src/WheelScrollAnimation.cpp",
331     "apz/src/WRHitTester.cpp",
332     "apz/testutil/APZTestData.cpp",
333     "apz/util/ActiveElementManager.cpp",
334     "apz/util/APZCCallbackHelper.cpp",
335     "apz/util/APZEventState.cpp",
336     "apz/util/APZTaskRunnable.cpp",
337     "apz/util/APZThreadUtils.cpp",
338     "apz/util/CheckerboardReportService.cpp",
339     "apz/util/ChromeProcessController.cpp",
340     "apz/util/ContentProcessController.cpp",
341     "apz/util/DoubleTapToZoom.cpp",
342     "apz/util/InputAPZContext.cpp",
343     "apz/util/ScrollingInteractionContext.cpp",
344     "apz/util/ScrollLinkedEffectDetector.cpp",
345     "apz/util/TouchActionHelper.cpp",
346     "apz/util/TouchCounter.cpp",
347     "AxisPhysicsModel.cpp",
348     "AxisPhysicsMSDModel.cpp",
349     "BSPTree.cpp",
350     "BufferTexture.cpp",
351     "CanvasDrawEventRecorder.cpp",
352     "CanvasRenderer.cpp",
353     "client/CanvasClient.cpp",
354     "client/CompositableClient.cpp",
355     "client/GPUVideoTextureClient.cpp",
356     "client/ImageClient.cpp",
357     "client/TextureClientPool.cpp",
358     "client/TextureClientRecycleAllocator.cpp",
359     "client/TextureClientSharedSurface.cpp",
360     "client/TextureRecorded.cpp",
361     "composite/CompositableHost.cpp",
362     "composite/FrameUniformityData.cpp",
363     "composite/GPUVideoTextureHost.cpp",
364     "composite/ImageComposite.cpp",
365     "composite/RemoteTextureHostWrapper.cpp",
366     "CompositionRecorder.cpp",
367     "Compositor.cpp",
368     "CompositorAnimationStorage.cpp",
369     "CompositorTypes.cpp",
370     "Effects.cpp",
371     "FrameMetrics.cpp",
372     "GLImages.cpp",
373     "ImageDataSerializer.cpp",
374     "ipc/APZChild.cpp",
375     "ipc/APZCTreeManagerChild.cpp",
376     "ipc/APZCTreeManagerParent.cpp",
377     "ipc/APZInputBridgeChild.cpp",
378     "ipc/APZInputBridgeParent.cpp",
379     "ipc/CanvasChild.cpp",
380     "ipc/CanvasTranslator.cpp",
381     "ipc/CompositableForwarder.cpp",
382     "ipc/CompositableTransactionParent.cpp",
383     "ipc/CompositorBench.cpp",
384     "ipc/CompositorBridgeChild.cpp",
385     "ipc/CompositorBridgeParent.cpp",
386     "ipc/CompositorManagerChild.cpp",
387     "ipc/CompositorManagerParent.cpp",
388     "ipc/CompositorThread.cpp",
389     "ipc/CompositorVsyncScheduler.cpp",
390     "ipc/ContentCompositorBridgeParent.cpp",
391     "ipc/ImageBridgeChild.cpp",
392     "ipc/ImageBridgeParent.cpp",
393     "ipc/ISurfaceAllocator.cpp",
394     "ipc/KnowsCompositor.cpp",
395     "ipc/LayerTreeOwnerTracker.cpp",
396     "ipc/RefCountedShmem.cpp",
397     "ipc/RemoteContentController.cpp",
398     "ipc/SharedPlanarYCbCrImage.cpp",
399     "ipc/SharedRGBImage.cpp",
400     "ipc/SharedSurfacesChild.cpp",
401     "ipc/SharedSurfacesParent.cpp",
402     "ipc/UiCompositorControllerChild.cpp",
403     "ipc/UiCompositorControllerParent.cpp",
404     "ipc/VideoBridgeChild.cpp",
405     "ipc/VideoBridgeParent.cpp",
406     "LayersTypes.cpp",
407     "MemoryPressureObserver.cpp",
408     "opengl/CompositingRenderTargetOGL.cpp",
409     "opengl/CompositorOGL.cpp",
410     "opengl/OGLShaderProgram.cpp",
411     "opengl/TextureClientOGL.cpp",
412     "opengl/TextureHostOGL.cpp",
413     "ProfilerScreenshots.cpp",
414     "RemoteTextureMap.cpp",
415     "RepaintRequest.cpp",
416     "SampleTime.cpp",
417     "ScreenshotGrabber.cpp",
418     "ScrollableLayerGuid.cpp",
419     "ShareableCanvasRenderer.cpp",
420     "SourceSurfaceSharedData.cpp",
421     "SyncObject.cpp",
422     "TextureSourceProvider.cpp",
423     "TextureWrapperImage.cpp",
424     "wr/AsyncImagePipelineManager.cpp",
425     "wr/AsyncImagePipelineOp.cpp",
426     "wr/ClipManager.cpp",
427     "wr/DisplayItemCache.cpp",
428     "wr/HitTestInfoManager.cpp",
429     "wr/IpcResourceUpdateQueue.cpp",
430     "wr/OMTAController.cpp",
431     "wr/OMTASampler.cpp",
432     "wr/RenderRootStateManager.cpp",
433     "wr/RenderRootTypes.cpp",
434     "wr/StackingContextHelper.cpp",
435     "wr/WebRenderBridgeChild.cpp",
436     "wr/WebRenderBridgeParent.cpp",
437     "wr/WebRenderCanvasRenderer.cpp",
438     "wr/WebRenderCommandBuilder.cpp",
439     "wr/WebRenderDrawEventRecorder.cpp",
440     "wr/WebRenderImageHost.cpp",
441     "wr/WebRenderLayerManager.cpp",
442     "wr/WebRenderScrollData.cpp",
443     "wr/WebRenderUserData.cpp",
444     "ZoomConstraints.cpp",
445     # XXX here are some unified build error.
446     #'wr/WebRenderTextureHost.cpp'
449 SOURCES += [
450     "client/TextureClient.cpp",
451     "composite/TextureHost.cpp",
452     "ImageContainer.cpp",
453     "PersistentBufferProvider.cpp",
454     "wr/WebRenderTextureHost.cpp",
457 DEFINES["GOOGLE_PROTOBUF_NO_RTTI"] = True
458 DEFINES["GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER"] = True
459 DEFINES["MOZ_APP_VERSION"] = CONFIG["MOZ_APP_VERSION"]
461 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
462     SOURCES += [
463         "opengl/MacIOSurfaceTextureClientOGL.cpp",
464         "opengl/MacIOSurfaceTextureHostOGL.cpp",
465     ]
467 IPDL_SOURCES += [
468     "ipc/LayersMessages.ipdlh",
469     "ipc/LayersSurfaces.ipdlh",
470     "ipc/PAPZ.ipdl",
471     "ipc/PAPZCTreeManager.ipdl",
472     "ipc/PAPZInputBridge.ipdl",
473     "ipc/PCanvas.ipdl",
474     "ipc/PCompositorBridge.ipdl",
475     "ipc/PCompositorBridgeTypes.ipdlh",
476     "ipc/PCompositorManager.ipdl",
477     "ipc/PImageBridge.ipdl",
478     "ipc/PTexture.ipdl",
479     "ipc/PUiCompositorController.ipdl",
480     "ipc/PVideoBridge.ipdl",
481     "ipc/PWebRenderBridge.ipdl",
482     "ipc/WebRenderMessages.ipdlh",
485 include("/ipc/chromium/chromium-config.mozbuild")
487 if CONFIG["COMPILE_ENVIRONMENT"] and CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
488     GeneratedFile(
489         "CompositorD3D11Shaders.h",
490         script="d3d11/genshaders.py",
491         inputs=["d3d11/shaders.manifest"],
492     )
494 LOCAL_INCLUDES += [
495     "/docshell/base",  # for nsDocShell.h
496     "/dom/canvas",  # for intertwined WebGL headers
497     "/gfx/cairo/cairo/src",
498     "/layout/base",  # for TouchManager.h
499     "/layout/generic",  # for nsTextFrame.h
500     "/media/libyuv/libyuv/include",  # for libyuv.h
503 FINAL_LIBRARY = "xul"
505 if CONFIG["MOZ_DEBUG"]:
506     DEFINES["D3D_DEBUG_INFO"] = True
508 if CONFIG["MOZ_ENABLE_D3D10_LAYER"]:
509     DEFINES["MOZ_ENABLE_D3D10_LAYER"] = True
511 if CONFIG["ENABLE_TESTS"]:
512     DIRS += ["apz/test/gtest"]
513     DIRS += ["apz/test/gtest/mvm"]
515 MOCHITEST_MANIFESTS += ["apz/test/mochitest/mochitest.toml"]
516 BROWSER_CHROME_MANIFESTS += ["apz/test/mochitest/browser.toml"]
518 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
519     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
521 CXXFLAGS += ["-Werror=switch"]
523 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
525 # Suppress warnings in third-party code.
526 if CONFIG["CC_TYPE"] == "gcc":
527     CXXFLAGS += ["-Wno-maybe-uninitialized"]
529 UNIFIED_SOURCES += []
531 # Add libFuzzer configuration directives
532 include("/tools/fuzzing/libfuzzer-config.mozbuild")