Backed out changeset 48baafc34055 (bug 1789166) for causing mochitests failures....
[gecko.git] / gfx / layers / moz.build
blobc6322c5507c34eacbf6061dc89b5667984d5ece6
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     EXPORTS.mozilla.layers += [
38         "d3d11/CompositorD3D11.h",
39         "d3d11/DeviceAttachmentsD3D11.h",
40         "d3d11/FenceD3D11.h",
41         "d3d11/GpuProcessD3D11QueryMap.h",
42         "d3d11/GpuProcessD3D11TextureMap.h",
43         "d3d11/HelpersD3D11.h",
44         "d3d11/ShaderDefinitionsD3D11.h",
45         "d3d11/TextureD3D11.h",
46         "d3d11/TextureHostWrapperD3D11.h",
47     ]
48     UNIFIED_SOURCES += [
49         "d3d11/FenceD3D11.cpp",
50         "d3d11/GpuProcessD3D11QueryMap.cpp",
51         "d3d11/GpuProcessD3D11TextureMap.cpp",
52         "d3d11/TextureD3D11.cpp",
53         "d3d11/TextureHostWrapperD3D11.cpp",
54     ]
55     SOURCES += [
56         "d3d11/CompositorD3D11.cpp",
57         "d3d11/DeviceAttachmentsD3D11.cpp",
58     ]
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/TextureClientRecycleAllocator.h",
129     "client/TextureClientSharedSurface.h",
130     "client/TextureRecorded.h",
131     "composite/Diagnostics.h",
132     "composite/FrameUniformityData.h",
133     "composite/GPUVideoTextureHost.h",
134     "composite/ImageComposite.h",
135     "composite/RemoteTextureHostWrapper.h",
136     "composite/TextureHost.h",
137     "CompositionRecorder.h",
138     "Compositor.h",
139     "CompositorAnimationStorage.h",
140     "CompositorTypes.h",
141     "D3D11ShareHandleImage.h",
142     "D3D11TextureIMFSampleImage.h",
143     "D3D11YCbCrImage.h",
144     "DirectionUtils.h",
145     "Effects.h",
146     "ImageDataSerializer.h",
147     "ipc/ActiveResource.h",
148     "ipc/APZChild.h",
149     "ipc/APZCTreeManagerChild.h",
150     "ipc/APZCTreeManagerParent.h",
151     "ipc/APZInputBridgeChild.h",
152     "ipc/APZInputBridgeParent.h",
153     "ipc/CanvasChild.h",
154     "ipc/CanvasTranslator.h",
155     "ipc/CompositableForwarder.h",
156     "ipc/CompositableTransactionParent.h",
157     "ipc/CompositorBridgeChild.h",
158     "ipc/CompositorBridgeParent.h",
159     "ipc/CompositorManagerChild.h",
160     "ipc/CompositorManagerParent.h",
161     "ipc/CompositorThread.h",
162     "ipc/CompositorVsyncScheduler.h",
163     "ipc/CompositorVsyncSchedulerOwner.h",
164     "ipc/ContentCompositorBridgeParent.h",
165     "ipc/ImageBridgeChild.h",
166     "ipc/ImageBridgeParent.h",
167     "ipc/ISurfaceAllocator.h",
168     "ipc/KnowsCompositor.h",
169     "ipc/LayersMessageUtils.h",
170     "ipc/LayerTreeOwnerTracker.h",
171     "ipc/RefCountedShmem.h",
172     "ipc/RemoteContentController.h",
173     "ipc/SharedPlanarYCbCrImage.h",
174     "ipc/SharedRGBImage.h",
175     "ipc/SharedSurfacesChild.h",
176     "ipc/SharedSurfacesMemoryReport.h",
177     "ipc/SharedSurfacesParent.h",
178     "ipc/SynchronousTask.h",
179     "ipc/TextureForwarder.h",
180     "ipc/UiCompositorControllerChild.h",
181     "ipc/UiCompositorControllerMessageTypes.h",
182     "ipc/UiCompositorControllerParent.h",
183     "ipc/VideoBridgeChild.h",
184     "ipc/VideoBridgeParent.h",
185     "ipc/VideoBridgeUtils.h",
186     "LayersTypes.h",
187     "MemoryPressureObserver.h",
188     "NativeLayer.h",
189     "OOPCanvasRenderer.h",
190     "opengl/CompositingRenderTargetOGL.h",
191     "opengl/CompositorOGL.h",
192     "opengl/MacIOSurfaceTextureClientOGL.h",
193     "opengl/MacIOSurfaceTextureHostOGL.h",
194     "opengl/TextureClientOGL.h",
195     "opengl/TextureHostOGL.h",
196     "PersistentBufferProvider.h",
197     "ProfilerScreenshots.h",
198     "RecordedCanvasEventImpl.h",
199     "RemoteTextureMap.h",
200     "RepaintRequest.h",
201     "SampleTime.h",
202     "ScreenshotGrabber.h",
203     "ScrollableLayerGuid.h",
204     "ScrollbarData.h",
205     "ShareableCanvasRenderer.h",
206     "SourceSurfaceSharedData.h",
207     "SurfacePool.h",
208     "SyncObject.h",
209     "TextureSourceProvider.h",
210     "TextureWrapperImage.h",
211     "TransactionIdAllocator.h",
212     "TreeTraversal.h",
213     "UpdateImageHelper.h",
214     "wr/AsyncImagePipelineManager.h",
215     "wr/AsyncImagePipelineOp.h",
216     "wr/ClipManager.h",
217     "wr/DisplayItemCache.h",
218     "wr/HitTestInfoManager.h",
219     "wr/IpcResourceUpdateQueue.h",
220     "wr/OMTAController.h",
221     "wr/OMTASampler.h",
222     "wr/RenderRootStateManager.h",
223     "wr/RenderRootTypes.h",
224     "wr/StackingContextHelper.h",
225     "wr/WebRenderBridgeChild.h",
226     "wr/WebRenderBridgeParent.h",
227     "wr/WebRenderCanvasRenderer.h",
228     "wr/WebRenderCommandBuilder.h",
229     "wr/WebRenderDrawEventRecorder.h",
230     "wr/WebRenderImageHost.h",
231     "wr/WebRenderLayerManager.h",
232     "wr/WebRenderMessageUtils.h",
233     "wr/WebRenderScrollData.h",
234     "wr/WebRenderScrollDataWrapper.h",
235     "wr/WebRenderTextureHost.h",
236     "wr/WebRenderUserData.h",
237     "ZoomConstraints.h",
240 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
241     EXPORTS.mozilla.layers += [
242         "DMABUFSurfaceImage.h",
243         "opengl/DMABUFTextureClientOGL.h",
244         "opengl/DMABUFTextureHostOGL.h",
245     ]
246     SOURCES += [
247         "DMABUFSurfaceImage.cpp",
248         "opengl/DMABUFTextureClientOGL.cpp",
249         "opengl/DMABUFTextureHostOGL.cpp",
250     ]
252 if CONFIG["MOZ_WAYLAND"]:
253     EXPORTS.mozilla.layers += [
254         "NativeLayerWayland.h",
255         "SurfacePoolWayland.h",
256     ]
257     UNIFIED_SOURCES += [
258         "NativeLayerWayland.cpp",
259         "SurfacePoolWayland.cpp",
260     ]
262 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"):
263     EXPORTS.mozilla.layers += [
264         "NativeLayerCA.h",
265         "SurfacePoolCA.h",
266     ]
267     EXPORTS += [
268         "MacIOSurfaceHelpers.h",
269         "MacIOSurfaceImage.h",
270     ]
271     UNIFIED_SOURCES += [
272         "NativeLayerCA.mm",
273         "SurfacePoolCA.mm",
274     ]
275     SOURCES += [
276         "MacIOSurfaceHelpers.cpp",
277         "MacIOSurfaceImage.cpp",
278     ]
279     OS_LIBS += [
280         "-framework IOSurface",
281     ]
283 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
284     EXPORTS.mozilla.layers += [
285         "AndroidHardwareBuffer.h",
286     ]
287     UNIFIED_SOURCES += [
288         "AndroidHardwareBuffer.cpp",
289         "apz/src/AndroidAPZ.cpp",
290         "apz/src/AndroidFlingPhysics.cpp",
291         "apz/src/AndroidVelocityTracker.cpp",
292     ]
294 UNIFIED_SOURCES += [
295     "AnimationHelper.cpp",
296     "AnimationInfo.cpp",
297     "apz/src/APZCTreeManager.cpp",
298     "apz/src/APZInputBridge.cpp",
299     "apz/src/APZPublicUtils.cpp",
300     "apz/src/APZSampler.cpp",
301     "apz/src/APZUpdater.cpp",
302     "apz/src/APZUtils.cpp",
303     "apz/src/AsyncPanZoomController.cpp",
304     "apz/src/AutoscrollAnimation.cpp",
305     "apz/src/Axis.cpp",
306     "apz/src/CheckerboardEvent.cpp",
307     "apz/src/DragTracker.cpp",
308     "apz/src/ExpectedGeckoMetrics.cpp",
309     "apz/src/FlingAccelerator.cpp",
310     "apz/src/FocusState.cpp",
311     "apz/src/FocusTarget.cpp",
312     "apz/src/GenericScrollAnimation.cpp",
313     "apz/src/GestureEventListener.cpp",
314     "apz/src/HitTestingTreeNode.cpp",
315     "apz/src/IAPZHitTester.cpp",
316     "apz/src/InputBlockState.cpp",
317     "apz/src/InputQueue.cpp",
318     "apz/src/KeyboardMap.cpp",
319     "apz/src/KeyboardScrollAction.cpp",
320     "apz/src/OverscrollHandoffState.cpp",
321     "apz/src/OvershootDetector.cpp",
322     "apz/src/PotentialCheckerboardDurationTracker.cpp",
323     "apz/src/QueuedInput.cpp",
324     "apz/src/SampledAPZCState.cpp",
325     "apz/src/ScrollThumbUtils.cpp",
326     "apz/src/SimpleVelocityTracker.cpp",
327     "apz/src/SmoothMsdScrollAnimation.cpp",
328     "apz/src/SmoothScrollAnimation.cpp",
329     "apz/src/WheelScrollAnimation.cpp",
330     "apz/src/WRHitTester.cpp",
331     "apz/testutil/APZTestData.cpp",
332     "apz/util/ActiveElementManager.cpp",
333     "apz/util/APZCCallbackHelper.cpp",
334     "apz/util/APZEventState.cpp",
335     "apz/util/APZTaskRunnable.cpp",
336     "apz/util/APZThreadUtils.cpp",
337     "apz/util/CheckerboardReportService.cpp",
338     "apz/util/ChromeProcessController.cpp",
339     "apz/util/ContentProcessController.cpp",
340     "apz/util/DoubleTapToZoom.cpp",
341     "apz/util/InputAPZContext.cpp",
342     "apz/util/ScrollingInteractionContext.cpp",
343     "apz/util/ScrollLinkedEffectDetector.cpp",
344     "apz/util/TouchActionHelper.cpp",
345     "apz/util/TouchCounter.cpp",
346     "AxisPhysicsModel.cpp",
347     "AxisPhysicsMSDModel.cpp",
348     "BSPTree.cpp",
349     "BufferTexture.cpp",
350     "CanvasDrawEventRecorder.cpp",
351     "CanvasRenderer.cpp",
352     "client/CanvasClient.cpp",
353     "client/CompositableClient.cpp",
354     "client/GPUVideoTextureClient.cpp",
355     "client/ImageClient.cpp",
356     "client/TextureClientRecycleAllocator.cpp",
357     "client/TextureClientSharedSurface.cpp",
358     "client/TextureRecorded.cpp",
359     "composite/CompositableHost.cpp",
360     "composite/FrameUniformityData.cpp",
361     "composite/GPUVideoTextureHost.cpp",
362     "composite/ImageComposite.cpp",
363     "composite/RemoteTextureHostWrapper.cpp",
364     "CompositionRecorder.cpp",
365     "Compositor.cpp",
366     "CompositorAnimationStorage.cpp",
367     "CompositorTypes.cpp",
368     "Effects.cpp",
369     "FrameMetrics.cpp",
370     "GLImages.cpp",
371     "ImageDataSerializer.cpp",
372     "ipc/APZChild.cpp",
373     "ipc/APZCTreeManagerChild.cpp",
374     "ipc/APZCTreeManagerParent.cpp",
375     "ipc/APZInputBridgeChild.cpp",
376     "ipc/APZInputBridgeParent.cpp",
377     "ipc/CanvasChild.cpp",
378     "ipc/CanvasTranslator.cpp",
379     "ipc/CompositableForwarder.cpp",
380     "ipc/CompositableTransactionParent.cpp",
381     "ipc/CompositorBench.cpp",
382     "ipc/CompositorBridgeChild.cpp",
383     "ipc/CompositorBridgeParent.cpp",
384     "ipc/CompositorManagerChild.cpp",
385     "ipc/CompositorManagerParent.cpp",
386     "ipc/CompositorThread.cpp",
387     "ipc/CompositorVsyncScheduler.cpp",
388     "ipc/ContentCompositorBridgeParent.cpp",
389     "ipc/ImageBridgeChild.cpp",
390     "ipc/ImageBridgeParent.cpp",
391     "ipc/ISurfaceAllocator.cpp",
392     "ipc/KnowsCompositor.cpp",
393     "ipc/LayerTreeOwnerTracker.cpp",
394     "ipc/RefCountedShmem.cpp",
395     "ipc/RemoteContentController.cpp",
396     "ipc/SharedPlanarYCbCrImage.cpp",
397     "ipc/SharedRGBImage.cpp",
398     "ipc/SharedSurfacesChild.cpp",
399     "ipc/SharedSurfacesParent.cpp",
400     "ipc/UiCompositorControllerChild.cpp",
401     "ipc/UiCompositorControllerParent.cpp",
402     "ipc/VideoBridgeChild.cpp",
403     "ipc/VideoBridgeParent.cpp",
404     "LayersTypes.cpp",
405     "MemoryPressureObserver.cpp",
406     "opengl/CompositingRenderTargetOGL.cpp",
407     "opengl/CompositorOGL.cpp",
408     "opengl/OGLShaderProgram.cpp",
409     "opengl/TextureClientOGL.cpp",
410     "opengl/TextureHostOGL.cpp",
411     "ProfilerScreenshots.cpp",
412     "RemoteTextureMap.cpp",
413     "RepaintRequest.cpp",
414     "SampleTime.cpp",
415     "ScreenshotGrabber.cpp",
416     "ScrollableLayerGuid.cpp",
417     "ShareableCanvasRenderer.cpp",
418     "SourceSurfaceSharedData.cpp",
419     "SyncObject.cpp",
420     "TextureSourceProvider.cpp",
421     "TextureWrapperImage.cpp",
422     "wr/AsyncImagePipelineManager.cpp",
423     "wr/AsyncImagePipelineOp.cpp",
424     "wr/ClipManager.cpp",
425     "wr/DisplayItemCache.cpp",
426     "wr/HitTestInfoManager.cpp",
427     "wr/IpcResourceUpdateQueue.cpp",
428     "wr/OMTAController.cpp",
429     "wr/OMTASampler.cpp",
430     "wr/RenderRootStateManager.cpp",
431     "wr/RenderRootTypes.cpp",
432     "wr/StackingContextHelper.cpp",
433     "wr/WebRenderBridgeChild.cpp",
434     "wr/WebRenderBridgeParent.cpp",
435     "wr/WebRenderCanvasRenderer.cpp",
436     "wr/WebRenderCommandBuilder.cpp",
437     "wr/WebRenderDrawEventRecorder.cpp",
438     "wr/WebRenderImageHost.cpp",
439     "wr/WebRenderLayerManager.cpp",
440     "wr/WebRenderScrollData.cpp",
441     "wr/WebRenderUserData.cpp",
442     "ZoomConstraints.cpp",
443     # XXX here are some unified build error.
444     #'wr/WebRenderTextureHost.cpp'
447 SOURCES += [
448     "client/TextureClient.cpp",
449     "composite/TextureHost.cpp",
450     "ImageContainer.cpp",
451     "PersistentBufferProvider.cpp",
452     "wr/WebRenderTextureHost.cpp",
455 DEFINES["GOOGLE_PROTOBUF_NO_RTTI"] = True
456 DEFINES["GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER"] = True
457 DEFINES["MOZ_APP_VERSION"] = CONFIG["MOZ_APP_VERSION"]
459 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("cocoa", "uikit"):
460     SOURCES += [
461         "opengl/MacIOSurfaceTextureClientOGL.cpp",
462         "opengl/MacIOSurfaceTextureHostOGL.cpp",
463     ]
465 IPDL_SOURCES += [
466     "ipc/LayersMessages.ipdlh",
467     "ipc/LayersSurfaces.ipdlh",
468     "ipc/PAPZ.ipdl",
469     "ipc/PAPZCTreeManager.ipdl",
470     "ipc/PAPZInputBridge.ipdl",
471     "ipc/PCanvas.ipdl",
472     "ipc/PCompositorBridge.ipdl",
473     "ipc/PCompositorBridgeTypes.ipdlh",
474     "ipc/PCompositorManager.ipdl",
475     "ipc/PImageBridge.ipdl",
476     "ipc/PTexture.ipdl",
477     "ipc/PUiCompositorController.ipdl",
478     "ipc/PVideoBridge.ipdl",
479     "ipc/PWebRenderBridge.ipdl",
480     "ipc/WebRenderMessages.ipdlh",
483 include("/ipc/chromium/chromium-config.mozbuild")
485 if CONFIG["COMPILE_ENVIRONMENT"] and CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
486     GeneratedFile(
487         "CompositorD3D11Shaders.h",
488         script="d3d11/genshaders.py",
489         inputs=["d3d11/shaders.manifest"],
490     )
492 LOCAL_INCLUDES += [
493     "/docshell/base",  # for nsDocShell.h
494     "/dom/canvas",  # for intertwined WebGL headers
495     "/gfx/cairo/cairo/src",
496     "/layout/base",  # for TouchManager.h
497     "/layout/generic",  # for nsTextFrame.h
498     "/media/libyuv/libyuv/include",  # for libyuv.h
501 FINAL_LIBRARY = "xul"
503 if CONFIG["MOZ_DEBUG"]:
504     DEFINES["D3D_DEBUG_INFO"] = True
506 if CONFIG["ENABLE_TESTS"]:
507     DIRS += ["apz/test/gtest"]
508     DIRS += ["apz/test/gtest/mvm"]
510 MOCHITEST_MANIFESTS += ["apz/test/mochitest/mochitest.toml"]
511 BROWSER_CHROME_MANIFESTS += [
512     "apz/test/mochitest/browser.toml",
513     "apz/test/mochitest/browserSidebarRevamp.toml",
516 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
517     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
519 CXXFLAGS += ["-Werror=switch"]
521 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
523 # Suppress warnings in third-party code.
524 if CONFIG["CC_TYPE"] == "gcc":
525     CXXFLAGS += ["-Wno-maybe-uninitialized"]
527 UNIFIED_SOURCES += []
529 # Add libFuzzer configuration directives
530 include("/tools/fuzzing/libfuzzer-config.mozbuild")