Bug 1335895 - part 20: Update nsIWidget and nsBaseWidget with four Android only virtual functions used by UiCompositorControllerChild r=jchen,kats
MozReview-Commit-ID: AF7faYAmn6T
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -400,16 +400,22 @@ public:
// These functions should be called at the start and end of a "live" widget
// resize (i.e. when the window contents are repainting during the resize,
// such as when the user drags a window border). It will suppress the
// displayport during the live resize to avoid unneccessary overpainting.
void NotifyLiveResizeStarted();
void NotifyLiveResizeStopped();
+#if defined(MOZ_WIDGET_ANDROID)
+ void RecvToolbarAnimatorMessageFromCompositor(int32_t) override {};
+ void UpdateRootFrameMetrics(const ScreenPoint& aScrollOffset, const CSSToScreenScale& aZoom, const CSSRect& aPage) override {};
+ void RecvScreenPixels(mozilla::ipc::Shmem&& aMem, const ScreenIntSize& aSize) override {};
+#endif
+
protected:
// These are methods for CompositorWidgetWrapper, and should only be
// accessed from that class. Derived widgets can choose which methods to
// implement, or none if supporting out-of-process compositing.
virtual bool PreRender(mozilla::widget::WidgetRenderingContext* aContext) {
return true;
}
virtual void PostRender(mozilla::widget::WidgetRenderingContext* aContext)
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -37,16 +37,21 @@ class nsIRollupListener;
class imgIContainer;
class nsIContent;
class ViewWrapper;
class nsIScreen;
class nsIRunnable;
class nsIKeyEventInPluginCallback;
namespace mozilla {
+#if defined(MOZ_WIDGET_ANDROID)
+namespace ipc {
+class Shmem;
+}
+#endif // defined(MOZ_WIDGET_ANDROID)
namespace dom {
class TabChild;
} // namespace dom
namespace plugins {
class PluginWidgetChild;
} // namespace plugins
namespace layers {
class AsyncDragMetrics;
@@ -353,16 +358,19 @@ class nsIWidget : public nsISupports
typedef mozilla::widget::TextEventDispatcherListener
TextEventDispatcherListener;
typedef mozilla::LayoutDeviceIntMargin LayoutDeviceIntMargin;
typedef mozilla::LayoutDeviceIntPoint LayoutDeviceIntPoint;
typedef mozilla::LayoutDeviceIntRect LayoutDeviceIntRect;
typedef mozilla::LayoutDeviceIntRegion LayoutDeviceIntRegion;
typedef mozilla::LayoutDeviceIntSize LayoutDeviceIntSize;
typedef mozilla::ScreenIntPoint ScreenIntPoint;
+ typedef mozilla::ScreenIntSize ScreenIntSize;
+ typedef mozilla::ScreenPoint ScreenPoint;
+ typedef mozilla::CSSToScreenScale CSSToScreenScale;
typedef mozilla::DesktopIntRect DesktopIntRect;
typedef mozilla::CSSRect CSSRect;
// Used in UpdateThemeGeometries.
struct ThemeGeometry {
// The ThemeGeometryType value for the themed widget, see
// nsITheme::ThemeGeometryTypeForWidget.
nsITheme::ThemeGeometryType mType;
@@ -2002,16 +2010,42 @@ public:
*/
virtual void LookUpDictionary(
const nsAString& aText,
const nsTArray<mozilla::FontRange>& aFontRangeArray,
const bool aIsVertical,
const LayoutDeviceIntPoint& aPoint)
{ }
+#if defined(MOZ_WIDGET_ANDROID)
+ /**
+ * RecvToolbarAnimatorMessageFromCompositor receive message from compositor thread.
+ *
+ * @param aMessage message being sent to Android UI thread.
+ */
+ virtual void RecvToolbarAnimatorMessageFromCompositor(int32_t aMessage) = 0;
+
+ /**
+ * UpdateRootFrameMetrics steady state frame metrics send from compositor thread
+ *
+ * @param aScrollOffset page scroll offset value in screen pixels.
+ * @param aZoom current page zoom.
+ * @param aPage bounds of the page in CSS coordinates.
+ */
+ virtual void UpdateRootFrameMetrics(const ScreenPoint& aScrollOffset, const CSSToScreenScale& aZoom, const CSSRect& aPage) = 0;
+
+ /**
+ * RecvScreenPixels Buffer containing the pixel from the frame buffer. Used for android robocop tests.
+ *
+ * @param aMem shared memory containing the frame buffer pixels.
+ * @param aSize size of the buffer in screen pixels.
+ */
+ virtual void RecvScreenPixels(mozilla::ipc::Shmem&& aMem, const ScreenIntSize& aSize) = 0;
+#endif
+
protected:
/**
* Like GetDefaultScale, but taking into account only the system settings
* and ignoring Gecko preferences.
*/
virtual double GetDefaultScaleInternal() { return 1.0; }
// keep the list of children. We also keep track of our siblings.