Line data Source code
1 : /* This Source Code Form is subject to the terms of the Mozilla Public
2 : * License, v. 2.0. If a copy of the MPL was not distributed with this
3 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 :
5 : #ifndef mozilla_widget_InProcessCompositorWidget_h__
6 : #define mozilla_widget_InProcessCompositorWidget_h__
7 :
8 : #include "CompositorWidget.h"
9 :
10 : namespace mozilla {
11 : namespace widget {
12 :
13 : // This version of CompositorWidget implements a wrapper around
14 : // nsBaseWidget.
15 0 : class InProcessCompositorWidget : public CompositorWidget
16 : {
17 : public:
18 : explicit InProcessCompositorWidget(const layers::CompositorOptions& aOptions,
19 : nsBaseWidget* aWidget);
20 :
21 : virtual bool PreRender(WidgetRenderingContext* aManager) override;
22 : virtual void PostRender(WidgetRenderingContext* aManager) override;
23 : virtual void DrawWindowUnderlay(WidgetRenderingContext* aContext,
24 : LayoutDeviceIntRect aRect) override;
25 : virtual void DrawWindowOverlay(WidgetRenderingContext* aContext,
26 : LayoutDeviceIntRect aRect) override;
27 : virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override;
28 : virtual already_AddRefed<gfx::DrawTarget>
29 : StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
30 : layers::BufferMode* aBufferMode) override;
31 : virtual void EndRemoteDrawing() override;
32 : virtual void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
33 : LayoutDeviceIntRegion& aInvalidRegion) override;
34 : virtual void CleanupRemoteDrawing() override;
35 : virtual void CleanupWindowEffects() override;
36 : virtual bool InitCompositor(layers::Compositor* aCompositor) override;
37 : virtual LayoutDeviceIntSize GetClientSize() override;
38 : virtual uint32_t GetGLFrameBufferFormat() override;
39 : virtual void ObserveVsync(VsyncObserver* aObserver) override;
40 : virtual uintptr_t GetWidgetKey() override;
41 :
42 : // If you can override this method, inherit from CompositorWidget instead.
43 : nsIWidget* RealWidget() override;
44 :
45 : protected:
46 : nsBaseWidget* mWidget;
47 : };
48 :
49 : } // namespace widget
50 : } // namespace mozilla
51 :
52 : #endif
|