InProcessCompositorWidget.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #ifndef mozilla_widget_InProcessCompositorWidget_h__
  5. #define mozilla_widget_InProcessCompositorWidget_h__
  6. #include "CompositorWidget.h"
  7. namespace mozilla {
  8. namespace widget {
  9. // This version of CompositorWidget implements a wrapper around
  10. // nsBaseWidget.
  11. class InProcessCompositorWidget : public CompositorWidget
  12. {
  13. public:
  14. explicit InProcessCompositorWidget(nsBaseWidget* aWidget);
  15. virtual bool PreRender(WidgetRenderingContext* aManager) override;
  16. virtual void PostRender(WidgetRenderingContext* aManager) override;
  17. virtual void DrawWindowUnderlay(WidgetRenderingContext* aContext,
  18. LayoutDeviceIntRect aRect) override;
  19. virtual void DrawWindowOverlay(WidgetRenderingContext* aContext,
  20. LayoutDeviceIntRect aRect) override;
  21. virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override;
  22. virtual already_AddRefed<gfx::DrawTarget>
  23. StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
  24. layers::BufferMode* aBufferMode) override;
  25. virtual void EndRemoteDrawing() override;
  26. virtual void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
  27. LayoutDeviceIntRegion& aInvalidRegion) override;
  28. virtual void CleanupRemoteDrawing() override;
  29. virtual void CleanupWindowEffects() override;
  30. virtual bool InitCompositor(layers::Compositor* aCompositor) override;
  31. virtual LayoutDeviceIntSize GetClientSize() override;
  32. virtual uint32_t GetGLFrameBufferFormat() override;
  33. virtual layers::Composer2D* GetComposer2D() override;
  34. virtual void ObserveVsync(VsyncObserver* aObserver) override;
  35. virtual uintptr_t GetWidgetKey() override;
  36. // If you can override this method, inherit from CompositorWidget instead.
  37. nsIWidget* RealWidget() override;
  38. private:
  39. nsBaseWidget* mWidget;
  40. };
  41. } // namespace widget
  42. } // namespace mozilla
  43. #endif