Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/gfx/layers/apz/src/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  SampledAPZCState.h   Sprache: C

 
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef mozilla_layers_SampledAPZCState_h
#define mozilla_layers_SampledAPZCState_h

#include "FrameMetrics.h"
#include "mozilla/Maybe.h"
#include "mozilla/ScrollGeneration.h"

namespace mozilla {
namespace layers {

class SampledAPZCState {
 public:
  SampledAPZCState();
  explicit SampledAPZCState(const FrameMetrics& aMetrics);
  SampledAPZCState(const FrameMetrics& aMetrics,
                   Maybe<CompositionPayload>&& aPayload,
                   APZScrollGeneration aGeneration);

  bool operator==(const SampledAPZCState& aOther) const;
  bool operator!=(const SampledAPZCState& aOther) const;

  CSSRect GetLayoutViewport() const { return mLayoutViewport; }
  CSSPoint GetVisualScrollOffset() const { return mVisualScrollOffset; }
  CSSToParentLayerScale GetZoom() const { return mZoom; }
  Maybe<CompositionPayload> TakeScrollPayload();
  const APZScrollGeneration& Generation() const { return mGeneration; }

  void UpdateScrollProperties(const FrameMetrics& aMetrics);
  void UpdateScrollPropertiesWithRelativeDelta(const FrameMetrics& aMetrics,
                                               const CSSPoint& aRelativeDelta);

  void UpdateZoomProperties(const FrameMetrics& aMetrics);

  /**
   * Re-clamp mVisualScrollOffset to the scroll range specified by the provided
   * metrics. This only needs to be called if the scroll offset changes
   * outside of AsyncPanZoomController::SampleCompositedAsyncTransform().
   * It also recalculates mLayoutViewport so that it continues to enclose
   * the visual viewport. This only needs to be called if the
   * layout viewport changes outside of SampleCompositedAsyncTransform().
   */

  void ClampVisualScrollOffset(const FrameMetrics& aMetrics);

  void ZoomBy(float aScale);

 private:
  // These variables cache the layout viewport, scroll offset, and zoom stored
  // in |Metrics()| at the time this class was constructed.
  CSSRect mLayoutViewport;
  CSSPoint mVisualScrollOffset;
  CSSToParentLayerScale mZoom;
  // An optional payload that rides along with the sampled state.
  Maybe<CompositionPayload> mScrollPayload;
  APZScrollGeneration mGeneration;

  void RemoveFractionalAsyncDelta();
  // A handy wrapper to call
  // FrameMetrics::KeepLayoutViewportEnclosingVisualViewport with this
  // SampledAPZCState and the given |aMetrics|.
  void KeepLayoutViewportEnclosingVisualViewport(const FrameMetrics& aMetrics);
};

}  // namespace layers
}  // namespace mozilla

#endif  // mozilla_layers_SampledAPZCState_h

Messung V0.5
C=83 H=100 G=91

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.