Bug 1335895 - part 20: Update nsIWidget and nsBaseWidget with four Android only virtual functions used by UiCompositorControllerChild r=jchen,kats draft
authorRandall Barker <rbarker@mozilla.com>
Fri, 07 Apr 2017 13:31:12 -0700
changeset 561586 269193854e69bb66b876a8f7c3e7308bab78ae96
parent 561585 9f1faa111e53c4d216e8e3766e4975f4d1093abf
child 561587 99387c6120e5597fd1390783935f76cf8bc73883
push id53787
push userbmo:rbarker@mozilla.com
push dateWed, 12 Apr 2017 22:56:58 +0000
reviewersjchen, kats
bugs1335895
milestone55.0a1
Bug 1335895 - part 20: Update nsIWidget and nsBaseWidget with four Android only virtual functions used by UiCompositorControllerChild r=jchen,kats MozReview-Commit-ID: AF7faYAmn6T
widget/nsBaseWidget.h
widget/nsIWidget.h
--- a/widget/nsBaseWidget.h
+++ b/widget/nsBaseWidget.h
@@ -400,16 +400,24 @@ 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(float aScrollX, float aScrollY, float aZoom,
+                                        float aCssPageLeft, float aCssPageTop,
+                                        float aCssPageRight, float aCssPageBottom) override {};
+  void RecvScreenPixels(int32_t aWidth, int32_t aHeight, mozilla::ipc::Shmem& aMem) 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;
@@ -2007,16 +2012,51 @@ 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
+                              NOTE: The aCss values must be multiplied by aZoom to
+                              get them in the parent layer coordinates.
+     *
+     * @param aScrollX       page X scroll value in pixels.
+     * @param aScrollY       page Y scroll value in pixels.
+     * @param aZoom          current page zoom.
+     * @param aCssPageLeft   left bounds of the page in CSS coordinates.
+     * @param aCssPageTop    top bounds of the page in CSS coordinates.
+     * @param aCssPageRight  right most bounds of the page in CSS coordinates.
+     * @param aCssPageBottom bottom most bound of the page in CSS coordinates.
+     */
+
+    virtual void UpdateRootFrameMetrics(float aScrollX, float aScrollY, float aZoom,
+                                        float aCssPageLeft, float aCssPageTop,
+                                        float aCssPageRight, float aCssPageBottom) = 0;
+    /**
+     * RecvScreenPixels Buffer containing the pixel from the frame buffer. Used for android robocop tests.
+     *
+     * @param aWidth  width of the buffer.
+     * @param aHeight height of the buffer.
+     * @param aMem    shared memory containing the frame buffer pixels.
+     */
+    virtual void RecvScreenPixels(int32_t aWidth, int32_t aHeight, mozilla::ipc::Shmem& aMem) = 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.