Bug 1732694: Prevent NativeLayerRootCA from isolating video layers while mouse is...
[gecko.git] / widget / cocoa / nsChildView.h
blob20b339d657dbc8496d6b9a2f7b1ae0e52f9c720a
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsChildView_h_
7 #define nsChildView_h_
9 // formal protocols
10 #include "mozView.h"
11 #ifdef ACCESSIBILITY
12 # include "mozilla/a11y/LocalAccessible.h"
13 # include "mozAccessibleProtocol.h"
14 #endif
16 #include "nsISupports.h"
17 #include "nsBaseWidget.h"
18 #include "nsIWeakReferenceUtils.h"
19 #include "TextInputHandler.h"
20 #include "nsCocoaUtils.h"
21 #include "gfxQuartzSurface.h"
22 #include "GLContextTypes.h"
23 #include "mozilla/DataMutex.h"
24 #include "mozilla/Mutex.h"
25 #include "nsRegion.h"
26 #include "mozilla/MouseEvents.h"
27 #include "mozilla/UniquePtr.h"
28 #include "mozilla/webrender/WebRenderTypes.h"
30 #include "nsString.h"
31 #include "nsIDragService.h"
32 #include "ViewRegion.h"
33 #include "CFTypeRefPtr.h"
35 #import <Carbon/Carbon.h>
36 #import <Cocoa/Cocoa.h>
37 #import <AppKit/NSOpenGL.h>
39 class nsChildView;
40 class nsCocoaWindow;
42 namespace {
43 class GLPresenter;
44 } // namespace
46 namespace mozilla {
47 class InputData;
48 class PanGestureInput;
49 class SwipeTracker;
50 struct SwipeEventQueue;
51 class VibrancyManager;
52 namespace layers {
53 class GLManager;
54 class IAPZCTreeManager;
55 class NativeLayerRootCA;
56 class NativeLayerCA;
57 } // namespace layers
58 namespace widget {
59 class WidgetRenderingContext;
60 } // namespace widget
61 } // namespace mozilla
63 @class PixelHostingView;
65 @interface NSEvent (Undocumented)
67 // Return Cocoa event's corresponding Carbon event. Not initialized (on
68 // synthetic events) until the OS actually "sends" the event. This method
69 // has been present in the same form since at least OS X 10.2.8.
70 - (EventRef)_eventRef;
72 // stage From 10.10.3 for force touch event
73 @property(readonly) NSInteger stage;
75 @end
77 @interface NSView (Undocumented)
79 // Undocumented method of one or more of NSFrameView's subclasses. Called
80 // when one or more of the titlebar buttons needs to be repositioned, to
81 // disappear, or to reappear (say if the window's style changes). If
82 // 'redisplay' is true, the entire titlebar (the window's top 22 pixels) is
83 // marked as needing redisplay. This method has been present in the same
84 // format since at least OS X 10.5.
85 - (void)_tileTitlebarAndRedisplay:(BOOL)redisplay;
87 // The following undocumented methods are used to work around bug 1069658,
88 // which is an Apple bug or design flaw that effects Yosemite. None of them
89 // were present prior to Yosemite (OS X 10.10).
90 - (NSView*)titlebarView; // Method of NSThemeFrame
91 - (NSView*)titlebarContainerView; // Method of NSThemeFrame
92 - (BOOL)transparent; // Method of NSTitlebarView and NSTitlebarContainerView
93 - (void)setTransparent:(BOOL)transparent; // Method of NSTitlebarView and
94 // NSTitlebarContainerView
96 // Available since 10.7.4:
97 - (void)viewDidChangeBackingProperties;
98 @end
100 @interface ChildView : NSView <
101 #ifdef ACCESSIBILITY
102 mozAccessible,
103 #endif
104 mozView,
105 NSTextInputClient,
106 NSDraggingSource,
107 NSDraggingDestination,
108 NSPasteboardItemDataProvider> {
109 @private
110 // the nsChildView that created the view. It retains this NSView, so
111 // the link back to it must be weak.
112 nsChildView* mGeckoChild;
114 // Text input handler for mGeckoChild and us. Note that this is a weak
115 // reference. Ideally, this should be a strong reference but a ChildView
116 // object can live longer than the mGeckoChild that owns it. And if
117 // mTextInputHandler were a strong reference, this would make it difficult
118 // for Gecko's leak detector to detect leaked TextInputHandler objects.
119 // This is initialized by [mozView installTextInputHandler:aHandler] and
120 // cleared by [mozView uninstallTextInputHandler].
121 mozilla::widget::TextInputHandler* mTextInputHandler; // [WEAK]
123 // when mouseDown: is called, we store its event here (strong)
124 NSEvent* mLastMouseDownEvent;
126 // Needed for IME support in e10s mode. Strong.
127 NSEvent* mLastKeyDownEvent;
129 // Whether the last mouse down event was blocked from Gecko.
130 BOOL mBlockedLastMouseDown;
132 // when acceptsFirstMouse: is called, we store the event here (strong)
133 NSEvent* mClickThroughMouseDownEvent;
135 // WheelStart/Stop events should always come in pairs. This BOOL records the
136 // last received event so that, when we receive one of the events, we make sure
137 // to send its pair event first, in case we didn't yet for any reason.
138 BOOL mExpectingWheelStop;
140 // Whether we're inside updateRootCALayer at the moment.
141 BOOL mIsUpdatingLayer;
143 // Holds our drag service across multiple drag calls. The reference to the
144 // service is obtained when the mouse enters the view and is released when
145 // the mouse exits or there is a drop. This prevents us from having to
146 // re-establish the connection to the service manager many times per second
147 // when handling |draggingUpdated:| messages.
148 nsIDragService* mDragService;
150 // Gestures support
152 // mGestureState is used to detect when Cocoa has called both
153 // magnifyWithEvent and rotateWithEvent within the same
154 // beginGestureWithEvent and endGestureWithEvent sequence. We
155 // discard the spurious gesture event so as not to confuse Gecko.
157 // mCumulativeRotation keeps track of the total amount of rotation
158 // performed during a rotate gesture so we can send that value with
159 // the final MozRotateGesture event.
160 enum {
161 eGestureState_None,
162 eGestureState_StartGesture,
163 eGestureState_MagnifyGesture,
164 eGestureState_RotateGesture
165 } mGestureState;
166 float mCumulativeRotation;
168 #ifdef __LP64__
169 // Support for fluid swipe tracking.
170 BOOL* mCancelSwipeAnimation;
171 #endif
173 // Whether this uses off-main-thread compositing.
174 BOOL mUsingOMTCompositor;
176 // Subviews of self, which act as container views for vibrancy views and
177 // non-draggable views.
178 NSView* mVibrancyViewsContainer; // [STRONG]
179 NSView* mNonDraggableViewsContainer; // [STRONG]
181 // The layer-backed view that hosts our drawing. Always non-null.
182 // This is a subview of self so that it can be ordered on top of mVibrancyViewsContainer.
183 PixelHostingView* mPixelHostingView;
185 // The CALayer that wraps Gecko's rendered contents. It's a sublayer of
186 // mPixelHostingView's backing layer. Always non-null.
187 CALayer* mRootCALayer; // [STRONG]
189 // Last pressure stage by trackpad's force click
190 NSInteger mLastPressureStage;
193 // class initialization
194 + (void)initialize;
196 + (void)registerViewForDraggedTypes:(NSView*)aView;
198 // these are sent to the first responder when the window key status changes
199 - (void)viewsWindowDidBecomeKey;
200 - (void)viewsWindowDidResignKey;
202 // Stop NSView hierarchy being changed during [ChildView drawRect:]
203 - (void)delayedTearDown;
205 - (void)handleMouseMoved:(NSEvent*)aEvent;
207 - (void)sendMouseEnterOrExitEvent:(NSEvent*)aEvent
208 enter:(BOOL)aEnter
209 exitFrom:(mozilla::WidgetMouseEvent::ExitFrom)aExitFrom;
211 // Call this during operations that will likely trigger a main thread
212 // CoreAnimation paint of the window, during which Gecko should do its own
213 // painting and present the results atomically with that main thread transaction.
214 // This method will suspend off-thread window updates so that the upcoming paint
215 // can be atomic, and mark the layer as needing display so that
216 // HandleMainThreadCATransaction gets called and Gecko gets a chance to paint.
217 - (void)ensureNextCompositeIsAtomicWithMainThreadPaint;
219 - (NSView*)vibrancyViewsContainer;
220 - (NSView*)nonDraggableViewsContainer;
221 - (NSView*)pixelHostingView;
223 - (BOOL)isCoveringTitlebar;
225 - (void)viewWillStartLiveResize;
226 - (void)viewDidEndLiveResize;
229 * Gestures support
231 * The prototypes swipeWithEvent, beginGestureWithEvent, smartMagnifyWithEvent,
232 * rotateWithEvent and endGestureWithEvent were obtained from the following
233 * links:
234 * https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSResponder_Class/Reference/Reference.html
235 * https://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKit.html
237 - (void)swipeWithEvent:(NSEvent*)anEvent;
238 - (void)beginGestureWithEvent:(NSEvent*)anEvent;
239 - (void)magnifyWithEvent:(NSEvent*)anEvent;
240 - (void)smartMagnifyWithEvent:(NSEvent*)anEvent;
241 - (void)rotateWithEvent:(NSEvent*)anEvent;
242 - (void)endGestureWithEvent:(NSEvent*)anEvent;
244 - (void)scrollWheel:(NSEvent*)anEvent;
246 - (void)setUsingOMTCompositor:(BOOL)aUseOMTC;
248 - (NSEvent*)lastKeyDownEvent;
250 + (uint32_t)sUniqueKeyEventId;
252 + (NSMutableDictionary*)sNativeKeyEventsMap;
253 @end
255 class ChildViewMouseTracker {
256 public:
257 static void MouseMoved(NSEvent* aEvent);
258 static void MouseScrolled(NSEvent* aEvent);
259 static void OnDestroyView(ChildView* aView);
260 static void OnDestroyWindow(NSWindow* aWindow);
261 static BOOL WindowAcceptsEvent(NSWindow* aWindow, NSEvent* aEvent, ChildView* aView,
262 BOOL isClickThrough = NO);
263 static void MouseExitedWindow(NSEvent* aEvent);
264 static void MouseEnteredWindow(NSEvent* aEvent);
265 static void NativeMenuOpened();
266 static void NativeMenuClosed();
267 static void ReEvaluateMouseEnterState(NSEvent* aEvent = nil, ChildView* aOldView = nil);
268 static void ResendLastMouseMoveEvent();
269 static ChildView* ViewForEvent(NSEvent* aEvent);
271 static ChildView* sLastMouseEventView;
272 static NSEvent* sLastMouseMoveEvent;
273 static NSWindow* sWindowUnderMouse;
274 static NSPoint sLastScrollEventScreenLocation;
277 //-------------------------------------------------------------------------
279 // nsChildView
281 //-------------------------------------------------------------------------
283 class nsChildView final : public nsBaseWidget {
284 private:
285 typedef nsBaseWidget Inherited;
286 typedef mozilla::layers::IAPZCTreeManager IAPZCTreeManager;
288 public:
289 nsChildView();
291 // nsIWidget interface
292 [[nodiscard]] virtual nsresult Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
293 const LayoutDeviceIntRect& aRect,
294 nsWidgetInitData* aInitData = nullptr) override;
296 virtual void Destroy() override;
298 virtual void Show(bool aState) override;
299 virtual bool IsVisible() const override;
301 virtual void SetParent(nsIWidget* aNewParent) override;
302 virtual nsIWidget* GetParent(void) override;
303 virtual float GetDPI() override;
305 virtual void Move(double aX, double aY) override;
306 virtual void Resize(double aWidth, double aHeight, bool aRepaint) override;
307 virtual void Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
309 virtual void Enable(bool aState) override;
310 virtual bool IsEnabled() const override;
311 virtual void SetFocus(Raise, mozilla::dom::CallerType aCallerType) override;
312 virtual LayoutDeviceIntRect GetBounds() override;
313 virtual LayoutDeviceIntRect GetClientBounds() override;
314 virtual LayoutDeviceIntRect GetScreenBounds() override;
316 // Refresh mBounds with up-to-date values from [mView frame].
317 // Only called if this nsChildView is the popup content view of a popup window.
318 // For popup windows, the nsIWidget interface to Gecko is provided by
319 // nsCocoaWindow, not by nsChildView. So nsCocoaWindow manages resize requests
320 // from Gecko, fires resize events, and resizes the native NSWindow and NSView.
321 void UpdateBoundsFromView();
323 // Returns the "backing scale factor" of the view's window, which is the
324 // ratio of pixels in the window's backing store to Cocoa points. Prior to
325 // HiDPI support in OS X 10.7, this was always 1.0, but in HiDPI mode it
326 // will be 2.0 (and might potentially other values as screen resolutions
327 // evolve). This gives the relationship between what Gecko calls "device
328 // pixels" and the Cocoa "points" coordinate system.
329 CGFloat BackingScaleFactor() const;
331 mozilla::DesktopToLayoutDeviceScale GetDesktopToDeviceScale() final {
332 return mozilla::DesktopToLayoutDeviceScale(BackingScaleFactor());
335 // Call if the window's backing scale factor changes - i.e., it is moved
336 // between HiDPI and non-HiDPI screens
337 void BackingScaleFactorChanged();
339 virtual double GetDefaultScaleInternal() override;
341 virtual int32_t RoundsWidgetCoordinatesTo() override;
343 virtual void Invalidate(const LayoutDeviceIntRect& aRect) override;
344 void EnsureContentLayerForMainThreadPainting();
346 virtual void* GetNativeData(uint32_t aDataType) override;
347 virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
348 virtual bool ShowsResizeIndicator(LayoutDeviceIntRect* aResizerRect) override { return false; }
350 static bool ConvertStatus(nsEventStatus aStatus) {
351 return aStatus == nsEventStatus_eConsumeNoDefault;
353 virtual nsresult DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus) override;
355 virtual bool WidgetTypeSupportsAcceleration() override;
356 virtual bool ShouldUseOffMainThreadCompositing() override;
358 virtual void SetCursor(const Cursor&) override;
360 virtual nsresult SetTitle(const nsAString& title) override;
362 [[nodiscard]] virtual nsresult GetAttention(int32_t aCycleCount) override;
364 virtual bool HasPendingInputEvent() override;
366 bool SendEventToNativeMenuSystem(NSEvent* aEvent);
367 virtual void PostHandleKeyEvent(mozilla::WidgetKeyboardEvent* aEvent) override;
368 virtual nsresult ActivateNativeMenuItemAt(const nsAString& indexString) override;
369 virtual nsresult ForceUpdateNativeMenuAt(const nsAString& indexString) override;
370 [[nodiscard]] virtual nsresult GetSelectionAsPlaintext(nsAString& aResult) override;
372 virtual void SetInputContext(const InputContext& aContext,
373 const InputContextAction& aAction) override;
374 virtual InputContext GetInputContext() override;
375 virtual TextEventDispatcherListener* GetNativeTextEventDispatcherListener() override;
376 [[nodiscard]] virtual nsresult AttachNativeKeyEvent(
377 mozilla::WidgetKeyboardEvent& aEvent) override;
378 MOZ_CAN_RUN_SCRIPT virtual bool GetEditCommands(
379 NativeKeyBindingsType aType, const mozilla::WidgetKeyboardEvent& aEvent,
380 nsTArray<mozilla::CommandInt>& aCommands) override;
382 virtual void SuppressAnimation(bool aSuppress) override;
384 virtual nsresult SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout, int32_t aNativeKeyCode,
385 uint32_t aModifierFlags, const nsAString& aCharacters,
386 const nsAString& aUnmodifiedCharacters,
387 nsIObserver* aObserver) override;
389 virtual nsresult SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
390 NativeMouseMessage aNativeMessage,
391 mozilla::MouseButton aButton,
392 nsIWidget::Modifiers aModifierFlags,
393 nsIObserver* aObserver) override;
395 virtual nsresult SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
396 nsIObserver* aObserver) override {
397 return SynthesizeNativeMouseEvent(aPoint, NativeMouseMessage::Move,
398 mozilla::MouseButton::eNotPressed,
399 nsIWidget::Modifiers::NO_MODIFIERS, aObserver);
401 virtual nsresult SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint,
402 uint32_t aNativeMessage, double aDeltaX,
403 double aDeltaY, double aDeltaZ,
404 uint32_t aModifierFlags,
405 uint32_t aAdditionalFlags,
406 nsIObserver* aObserver) override;
407 virtual nsresult SynthesizeNativeTouchPoint(uint32_t aPointerId, TouchPointerState aPointerState,
408 LayoutDeviceIntPoint aPoint, double aPointerPressure,
409 uint32_t aPointerOrientation,
410 nsIObserver* aObserver) override;
412 virtual nsresult SynthesizeNativeTouchpadDoubleTap(LayoutDeviceIntPoint aPoint,
413 uint32_t aModifierFlags) override;
415 // Mac specific methods
417 virtual bool DispatchWindowEvent(mozilla::WidgetGUIEvent& event);
419 void WillPaintWindow();
420 bool PaintWindow(LayoutDeviceIntRegion aRegion);
421 bool PaintWindowInDrawTarget(mozilla::gfx::DrawTarget* aDT, const LayoutDeviceIntRegion& aRegion,
422 const mozilla::gfx::IntSize& aSurfaceSize);
424 void PaintWindowInContentLayer();
425 void HandleMainThreadCATransaction();
427 #ifdef ACCESSIBILITY
428 already_AddRefed<mozilla::a11y::LocalAccessible> GetDocumentAccessible();
429 #endif
431 virtual void CreateCompositor() override;
433 virtual bool WidgetPaintsBackground() override { return true; }
435 virtual bool PreRender(mozilla::widget::WidgetRenderingContext* aContext) override;
436 virtual void PostRender(mozilla::widget::WidgetRenderingContext* aContext) override;
437 virtual RefPtr<mozilla::layers::NativeLayerRoot> GetNativeLayerRoot() override;
439 virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) override;
441 virtual void UpdateWindowDraggingRegion(const LayoutDeviceIntRegion& aRegion) override;
442 LayoutDeviceIntRegion GetNonDraggableRegion() { return mNonDraggableRegion.Region(); }
444 virtual void ReportSwipeStarted(uint64_t aInputBlockId, bool aStartSwipe) override;
446 virtual void LookUpDictionary(const nsAString& aText,
447 const nsTArray<mozilla::FontRange>& aFontRangeArray,
448 const bool aIsVertical,
449 const LayoutDeviceIntPoint& aPoint) override;
451 void ResetParent();
453 static bool DoHasPendingInputEvent();
454 static uint32_t GetCurrentInputEventCount();
455 static void UpdateCurrentInputEventCount();
457 NSView<mozView>* GetEditorView();
459 nsCocoaWindow* GetAppWindowWidget() const;
461 virtual void ReparentNativeWidget(nsIWidget* aNewParent) override;
463 mozilla::widget::TextInputHandler* GetTextInputHandler() { return mTextInputHandler; }
465 // unit conversion convenience functions
466 int32_t CocoaPointsToDevPixels(CGFloat aPts) const {
467 return nsCocoaUtils::CocoaPointsToDevPixels(aPts, BackingScaleFactor());
469 LayoutDeviceIntPoint CocoaPointsToDevPixels(const NSPoint& aPt) const {
470 return nsCocoaUtils::CocoaPointsToDevPixels(aPt, BackingScaleFactor());
472 LayoutDeviceIntPoint CocoaPointsToDevPixelsRoundDown(const NSPoint& aPt) const {
473 return nsCocoaUtils::CocoaPointsToDevPixelsRoundDown(aPt, BackingScaleFactor());
475 LayoutDeviceIntRect CocoaPointsToDevPixels(const NSRect& aRect) const {
476 return nsCocoaUtils::CocoaPointsToDevPixels(aRect, BackingScaleFactor());
478 CGFloat DevPixelsToCocoaPoints(int32_t aPixels) const {
479 return nsCocoaUtils::DevPixelsToCocoaPoints(aPixels, BackingScaleFactor());
481 NSRect DevPixelsToCocoaPoints(const LayoutDeviceIntRect& aRect) const {
482 return nsCocoaUtils::DevPixelsToCocoaPoints(aRect, BackingScaleFactor());
485 virtual LayoutDeviceIntPoint GetClientOffset() override;
487 void DispatchAPZWheelInputEvent(mozilla::InputData& aEvent, bool aCanTriggerSwipe);
488 nsEventStatus DispatchAPZInputEvent(mozilla::InputData& aEvent);
490 void DispatchDoubleTapGesture(mozilla::TimeStamp aEventTimeStamp,
491 LayoutDeviceIntPoint aScreenPosition,
492 mozilla::Modifiers aModifiers);
494 void SwipeFinished();
496 // Called when the main thread enters a phase during which visual changes
497 // are imminent and any layer updates on the compositor thread would interfere
498 // with visual atomicity.
499 // "Async" CATransactions are CATransactions which happen on a thread that's
500 // not the main thread.
501 void SuspendAsyncCATransactions();
503 // Called when we know that the current main thread paint will be completed once
504 // the main thread goes back to the event loop.
505 void MaybeScheduleUnsuspendAsyncCATransactions();
507 // Called from the runnable dispatched by MaybeScheduleUnsuspendAsyncCATransactions().
508 // At this point we know that the main thread is done handling the visual change
509 // (such as a window resize) and we can start modifying CALayers from the
510 // compositor thread again.
511 void UnsuspendAsyncCATransactions();
513 // Called by nsCocoaWindow when the window's fullscreen state changes.
514 void UpdateFullscreen(bool aFullscreen);
516 // Called by nsCocoaWindow when a mouse move has occurred.
517 void NoteMouseMoveAtTime(const mozilla::TimeStamp& aTime);
519 protected:
520 virtual ~nsChildView();
522 void ReportMoveEvent();
523 void ReportSizeEvent();
525 void TearDownView();
527 virtual already_AddRefed<nsIWidget> AllocateChildPopupWidget() override {
528 return nsIWidget::CreateTopLevelWindow();
531 void ConfigureAPZCTreeManager() override;
532 void ConfigureAPZControllerThread() override;
534 void UpdateVibrancy(const nsTArray<ThemeGeometry>& aThemeGeometries);
535 mozilla::VibrancyManager& EnsureVibrancyManager();
537 nsIWidget* GetWidgetForListenerEvents();
539 struct SwipeInfo {
540 bool wantsSwipe;
541 uint32_t allowedDirections;
544 SwipeInfo SendMayStartSwipe(const mozilla::PanGestureInput& aSwipeStartEvent);
545 void TrackScrollEventAsSwipe(const mozilla::PanGestureInput& aSwipeStartEvent,
546 uint32_t aAllowedDirections);
548 protected:
549 ChildView* mView; // my parallel cocoa view, [STRONG]
550 RefPtr<mozilla::widget::TextInputHandler> mTextInputHandler;
551 InputContext mInputContext;
553 NSView* mParentView;
554 nsIWidget* mParentWidget;
556 #ifdef ACCESSIBILITY
557 // weak ref to this childview's associated mozAccessible for speed reasons
558 // (we get queried for it *a lot* but don't want to own it)
559 nsWeakPtr mAccessible;
560 #endif
562 // Held while the compositor (or WR renderer) thread is compositing.
563 // Protects from tearing down the view during compositing and from presenting
564 // half-composited layers to the screen.
565 mozilla::Mutex mCompositingLock;
567 mozilla::ViewRegion mNonDraggableRegion;
569 // Cached value of [mView backingScaleFactor], to avoid sending two obj-c
570 // messages (respondsToSelector, backingScaleFactor) every time we need to
571 // use it.
572 // ** We'll need to reinitialize this if the backing resolution changes. **
573 mutable CGFloat mBackingScaleFactor;
575 bool mVisible;
576 bool mDrawing;
577 bool mIsDispatchPaint; // Is a paint event being dispatched
579 RefPtr<mozilla::layers::NativeLayerRootCA> mNativeLayerRoot;
581 // In BasicLayers mode, this is the CoreAnimation layer that contains the
582 // rendering from Gecko. It is a sublayer of mNativeLayerRoot's underlying
583 // wrapper layer.
584 // Lazily created by EnsureContentLayerForMainThreadPainting().
585 RefPtr<mozilla::layers::NativeLayerCA> mContentLayer;
586 RefPtr<mozilla::layers::SurfacePoolHandle> mPoolHandle;
588 // In BasicLayers mode, this is the invalid region of mContentLayer.
589 LayoutDeviceIntRegion mContentLayerInvalidRegion;
591 mozilla::UniquePtr<mozilla::VibrancyManager> mVibrancyManager;
592 RefPtr<mozilla::SwipeTracker> mSwipeTracker;
593 mozilla::UniquePtr<mozilla::SwipeEventQueue> mSwipeEventQueue;
595 RefPtr<mozilla::CancelableRunnable> mUnsuspendAsyncCATransactionsRunnable;
597 // This flag is only used when APZ is off. It indicates that the current pan
598 // gesture was processed as a swipe. Sometimes the swipe animation can finish
599 // before momentum events of the pan gesture have stopped firing, so this
600 // flag tells us that we shouldn't allow the remaining events to cause
601 // scrolling. It is reset to false once a new gesture starts (as indicated by
602 // a PANGESTURE_(MAY)START event).
603 bool mCurrentPanGestureBelongsToSwipe;
605 static uint32_t sLastInputEventCount;
607 // This is used by SynthesizeNativeTouchPoint to maintain state between
608 // multiple synthesized points
609 mozilla::UniquePtr<mozilla::MultiTouchInput> mSynthesizedTouchInput;
612 #endif // nsChildView_h_