ScrollThumbUtils.h (2107B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_layers_ScrollThumbUtils_h 8 #define mozilla_layers_ScrollThumbUtils_h 9 10 #include "LayersTypes.h" 11 #include "Units.h" 12 13 namespace mozilla { 14 namespace layers { 15 16 class AsyncPanZoomController; 17 18 struct FrameMetrics; 19 struct ScrollbarData; 20 21 namespace apz { 22 /** 23 * Compute the updated shadow transform for a scroll thumb layer that 24 * reflects async scrolling of the associated scroll frame. 25 * 26 * @param aCurrentTransform The current shadow transform on the scroll thumb 27 * layer, as returned by Layer::GetLocalTransform() or similar. 28 * @param aScrollableContentTransform The current content transform on the 29 * scrollable content, as returned by Layer::GetTransform(). 30 * @param aApzc The APZC that scrolls the scroll frame. 31 * @param aMetrics The metrics associated with the scroll frame, reflecting 32 * the last paint of the associated content. Note: this metrics should 33 * NOT reflect async scrolling or zooming, i.e. they should be the layer 34 * tree's copy of the metrics, or APZC's last-content-paint metrics. 35 * @param aScrollbarData The scrollbar data for the the scroll thumb layer. 36 * @param aScrollbarIsDescendant True iff. the scroll thumb layer is a 37 * descendant of the layer bearing the scroll frame's metrics. 38 * @return The new shadow transform for the scroll thumb layer, including 39 * any pre- or post-scales. 40 */ 41 LayerToParentLayerMatrix4x4 ComputeTransformForScrollThumb( 42 const LayerToParentLayerMatrix4x4& aCurrentTransform, 43 const gfx::Matrix4x4& aScrollableContentTransform, 44 AsyncPanZoomController* aApzc, const FrameMetrics& aMetrics, 45 const ScrollbarData& aScrollbarData, bool aScrollbarIsDescendant); 46 47 } // namespace apz 48 } // namespace layers 49 } // namespace mozilla 50 51 #endif // mozilla_layers_ScrollThumbUtils_h