Bumping manifests a=b2g-bump
[gecko.git] / layout / base / FrameLayerBuilder.h
blob74e3be0a4d95964cc87aa53c2af96ef18b041105
1 /* -*- Mode: C++; tab-width: 20; 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 FRAMELAYERBUILDER_H_
7 #define FRAMELAYERBUILDER_H_
9 #include "nsTHashtable.h"
10 #include "nsHashKeys.h"
11 #include "nsTArray.h"
12 #include "nsRegion.h"
13 #include "nsIFrame.h"
14 #include "ImageLayers.h"
15 #include "DisplayItemClip.h"
16 #include "mozilla/layers/LayersTypes.h"
17 #include "LayerState.h"
19 class nsDisplayListBuilder;
20 class nsDisplayList;
21 class nsDisplayItem;
22 class gfxContext;
23 class nsDisplayItemGeometry;
25 namespace mozilla {
26 namespace layers {
27 class ContainerLayer;
28 class LayerManager;
29 class BasicLayerManager;
30 class ThebesLayer;
33 namespace gfx {
34 class Matrix4x4;
37 class FrameLayerBuilder;
38 class LayerManagerData;
39 class ThebesLayerData;
40 class ContainerState;
42 class RefCountedRegion {
43 private:
44 ~RefCountedRegion() {}
45 public:
46 NS_INLINE_DECL_REFCOUNTING(RefCountedRegion)
48 RefCountedRegion() : mIsInfinite(false) {}
49 nsRegion mRegion;
50 bool mIsInfinite;
53 struct NewLayerEntry;
55 struct ContainerLayerParameters {
56 ContainerLayerParameters()
57 : mXScale(1)
58 , mYScale(1)
59 , mLayerContentsVisibleRect(nullptr)
60 , mInTransformedSubtree(false)
61 , mInActiveTransformedSubtree(false)
62 , mDisableSubpixelAntialiasingInDescendants(false)
63 , mInLowPrecisionDisplayPort(false)
65 ContainerLayerParameters(float aXScale, float aYScale)
66 : mXScale(aXScale)
67 , mYScale(aYScale)
68 , mLayerContentsVisibleRect(nullptr)
69 , mInTransformedSubtree(false)
70 , mInActiveTransformedSubtree(false)
71 , mDisableSubpixelAntialiasingInDescendants(false)
72 , mInLowPrecisionDisplayPort(false)
74 ContainerLayerParameters(float aXScale, float aYScale,
75 const nsIntPoint& aOffset,
76 const ContainerLayerParameters& aParent)
77 : mXScale(aXScale)
78 , mYScale(aYScale)
79 , mLayerContentsVisibleRect(nullptr)
80 , mOffset(aOffset)
81 , mInTransformedSubtree(aParent.mInTransformedSubtree)
82 , mInActiveTransformedSubtree(aParent.mInActiveTransformedSubtree)
83 , mDisableSubpixelAntialiasingInDescendants(aParent.mDisableSubpixelAntialiasingInDescendants)
84 , mInLowPrecisionDisplayPort(aParent.mInLowPrecisionDisplayPort)
86 float mXScale, mYScale;
87 /**
88 * If non-null, the rectangle in which BuildContainerLayerFor stores the
89 * visible rect of the layer, in the coordinate system of the created layer.
91 nsIntRect* mLayerContentsVisibleRect;
92 /**
93 * An offset to apply to all child layers created.
95 nsIntPoint mOffset;
97 bool mInTransformedSubtree;
98 bool mInActiveTransformedSubtree;
99 bool mDisableSubpixelAntialiasingInDescendants;
100 bool mInLowPrecisionDisplayPort;
102 * When this is false, ThebesLayer coordinates are drawn to with an integer
103 * translation and the scale in mXScale/mYScale.
105 bool AllowResidualTranslation()
107 // If we're in a transformed subtree, but no ancestor transform is actively
108 // changing, we'll use the residual translation when drawing into the
109 // ThebesLayer to ensure that snapping exactly matches the ideal transform.
110 return mInTransformedSubtree && !mInActiveTransformedSubtree;
115 * The FrameLayerBuilder is responsible for converting display lists
116 * into layer trees. Every LayerManager needs a unique FrameLayerBuilder
117 * to build layers.
119 * The most important API in this class is BuildContainerLayerFor. This
120 * method takes a display list as input and constructs a ContainerLayer
121 * with child layers that render the contents of the display list. It
122 * records the relationship between frames and layers.
124 * That data enables us to retain layer trees. When constructing a
125 * ContainerLayer, we first check to see if there's an existing
126 * ContainerLayer for the same frame that can be recycled. If we recycle
127 * it, we also try to reuse its existing ThebesLayer children to render
128 * the display items without layers of their own. The idea is that by
129 * recycling layers deterministically, we can ensure that when nothing
130 * changes in a display list, we will reuse the existing layers without
131 * changes.
133 * We expose a GetLeafLayerFor method that can be called by display items
134 * that make their own layers (e.g. canvas and video); this method
135 * locates the last layer used to render the display item, if any, and
136 * return it as a candidate for recycling.
138 * FrameLayerBuilder sets up ThebesLayers so that 0,0 in the Thebes layer
139 * corresponds to the (pixel-snapped) top-left of the aAnimatedGeometryRoot.
140 * It sets up ContainerLayers so that 0,0 in the container layer
141 * corresponds to the snapped top-left of the display item reference frame.
143 * When we construct a container layer, we know the transform that will be
144 * applied to the layer. If the transform scales the content, we can get
145 * better results when intermediate buffers are used by pushing some scale
146 * from the container's transform down to the children. For ThebesLayer
147 * children, the scaling can be achieved by changing the size of the layer
148 * and drawing into it with increased or decreased resolution. By convention,
149 * integer types (nsIntPoint/nsIntSize/nsIntRect/nsIntRegion) are all in layer
150 * coordinates, post-scaling, whereas appunit types are all pre-scaling.
152 class FrameLayerBuilder : public layers::LayerUserData {
153 public:
154 typedef layers::ContainerLayer ContainerLayer;
155 typedef layers::Layer Layer;
156 typedef layers::ThebesLayer ThebesLayer;
157 typedef layers::ImageLayer ImageLayer;
158 typedef layers::LayerManager LayerManager;
159 typedef layers::BasicLayerManager BasicLayerManager;
160 typedef layers::EventRegions EventRegions;
162 FrameLayerBuilder() :
163 mRetainingManager(nullptr),
164 mDetectedDOMModification(false),
165 mInvalidateAllLayers(false),
166 mInLayerTreeCompressionMode(false),
167 mContainerLayerGeneration(0),
168 mMaxContainerLayerGeneration(0)
170 MOZ_COUNT_CTOR(FrameLayerBuilder);
172 ~FrameLayerBuilder()
174 MOZ_COUNT_DTOR(FrameLayerBuilder);
177 static void Shutdown();
179 void Init(nsDisplayListBuilder* aBuilder, LayerManager* aManager,
180 ThebesLayerData* aLayerData = nullptr);
183 * Call this to notify that we have just started a transaction on the
184 * retained layer manager aManager.
186 void DidBeginRetainedLayerTransaction(LayerManager* aManager);
189 * Call this just before we end a transaction.
191 void WillEndTransaction();
194 * Call this after we end a transaction.
196 void DidEndTransaction();
198 enum {
199 CONTAINER_NOT_CLIPPED_BY_ANCESTORS = 0x01
202 * Build a container layer for a display item that contains a child
203 * list, either reusing an existing one or creating a new one. It
204 * sets the container layer children to layers which together render
205 * the contents of the display list. It reuses existing layers from
206 * the retained layer manager if possible.
207 * aContainer may be null, in which case we construct a root layer.
208 * This gets called by display list code. It calls BuildLayer on the
209 * items in the display list, making items with their own layers
210 * children of the new container, and assigning all other items to
211 * ThebesLayer children created and managed by the FrameLayerBuilder.
212 * Returns a layer with clip rect cleared; it is the
213 * caller's responsibility to add any clip rect. The visible region
214 * is set based on what's in the layer.
215 * The container layer is transformed by aTransform (if non-null), and
216 * the result is transformed by the scale factors in aContainerParameters.
217 * aChildren is modified due to display item merging and flattening.
218 * The visible region of the returned layer is set only if aContainerItem
219 * is null.
221 already_AddRefed<ContainerLayer>
222 BuildContainerLayerFor(nsDisplayListBuilder* aBuilder,
223 LayerManager* aManager,
224 nsIFrame* aContainerFrame,
225 nsDisplayItem* aContainerItem,
226 nsDisplayList* aChildren,
227 const ContainerLayerParameters& aContainerParameters,
228 const gfx::Matrix4x4* aTransform,
229 uint32_t aFlags = 0);
232 * Get a retained layer for a display item that needs to create its own
233 * layer for rendering (i.e. under nsDisplayItem::BuildLayer). Returns
234 * null if no retained layer is available, which usually means that this
235 * display item didn't have a layer before so the caller will
236 * need to create one.
237 * Returns a layer with clip rect cleared; it is the
238 * caller's responsibility to add any clip rect and set the visible
239 * region.
241 Layer* GetLeafLayerFor(nsDisplayListBuilder* aBuilder,
242 nsDisplayItem* aItem);
245 * Call this to force all retained layers to be discarded and recreated at
246 * the next paint.
248 static void InvalidateAllLayers(LayerManager* aManager);
249 static void InvalidateAllLayersForFrame(nsIFrame *aFrame);
252 * Call this to determine if a frame has a dedicated (non-Thebes) layer
253 * for the given display item key. If there isn't one, we return null,
254 * otherwise we return the layer.
256 static Layer* GetDedicatedLayer(nsIFrame* aFrame, uint32_t aDisplayItemKey);
259 * This callback must be provided to EndTransaction. The callback data
260 * must be the nsDisplayListBuilder containing this FrameLayerBuilder.
261 * This function can be called multiple times in a row to draw
262 * different regions.
264 static void DrawThebesLayer(ThebesLayer* aLayer,
265 gfxContext* aContext,
266 const nsIntRegion& aRegionToDraw,
267 mozilla::layers::DrawRegionClip aClip,
268 const nsIntRegion& aRegionToInvalidate,
269 void* aCallbackData);
271 #ifdef MOZ_DUMP_PAINTING
273 * Dumps this FrameLayerBuilder's retained layer manager's retained
274 * layer tree. Defaults to dumping to stdout in non-HTML format.
276 static void DumpRetainedLayerTree(LayerManager* aManager, std::stringstream& aStream, bool aDumpHtml = false);
277 #endif
279 /******* PRIVATE METHODS to FrameLayerBuilder.cpp ********/
280 /* These are only in the public section because they need
281 * to be called by file-scope helper functions in FrameLayerBuilder.cpp.
285 * Record aItem as a display item that is rendered by aLayer.
287 * @param aLayer Layer that the display item will be rendered into
288 * @param aItem Display item to be drawn.
289 * @param aLayerState What LayerState the item is using.
290 * @param aTopLeft offset from active scrolled root to reference frame
291 * @param aManager If the layer is in the LAYER_INACTIVE state,
292 * then this is the temporary layer manager to draw with.
294 void AddLayerDisplayItem(Layer* aLayer,
295 nsDisplayItem* aItem,
296 LayerState aLayerState,
297 const nsPoint& aTopLeft,
298 BasicLayerManager* aManager);
301 * Record aItem as a display item that is rendered by the ThebesLayer
302 * aLayer, with aClipRect, where aContainerLayerFrame is the frame
303 * for the container layer this ThebesItem belongs to.
304 * aItem must have an underlying frame.
305 * @param aTopLeft offset from active scrolled root to reference frame
307 void AddThebesDisplayItem(ThebesLayerData* aLayer,
308 nsDisplayItem* aItem,
309 const DisplayItemClip& aClip,
310 const nsIntRect& aItemVisibleRect,
311 const ContainerState& aContainerState,
312 LayerState aLayerState,
313 const nsPoint& aTopLeft);
316 * Gets the frame property descriptor for the given manager, or for the current
317 * widget layer manager if nullptr is passed.
319 static const FramePropertyDescriptor* GetDescriptorForManager(LayerManager* aManager);
322 * Calls GetOldLayerForFrame on the underlying frame of the display item,
323 * and each subsequent merged frame if no layer is found for the underlying
324 * frame.
326 Layer* GetOldLayerFor(nsDisplayItem* aItem,
327 nsDisplayItemGeometry** aOldGeometry = nullptr,
328 DisplayItemClip** aOldClip = nullptr);
330 void ClearCachedGeometry(nsDisplayItem* aItem);
332 static Layer* GetDebugOldLayerFor(nsIFrame* aFrame, uint32_t aDisplayItemKey);
335 * Destroy any stored LayerManagerDataProperty and the associated data for
336 * aFrame.
338 static void DestroyDisplayItemDataFor(nsIFrame* aFrame);
340 LayerManager* GetRetainingLayerManager() { return mRetainingManager; }
343 * Returns true if the given display item was rendered during the previous
344 * paint. Returns false otherwise.
346 static bool HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey);
348 class DisplayItemData;
349 typedef void (*DisplayItemDataCallback)(nsIFrame *aFrame, DisplayItemData* aItem);
351 static void IterateRetainedDataFor(nsIFrame* aFrame, DisplayItemDataCallback aCallback);
354 * Save transform that was in aLayer when we last painted, and the position
355 * of the active scrolled root frame. It must be an integer
356 * translation.
358 void SavePreviousDataForLayer(ThebesLayer* aLayer, uint32_t aClipCount);
360 * Get the translation transform that was in aLayer when we last painted. It's either
361 * the transform saved by SaveLastPaintTransform, or else the transform
362 * that's currently in the layer (which must be an integer translation).
364 nsIntPoint GetLastPaintOffset(ThebesLayer* aLayer);
367 * Return the resolution at which we expect to render aFrame's contents,
368 * assuming they are being painted to retained layers. This takes into account
369 * the resolution the contents of the ContainerLayer containing aFrame are
370 * being rendered at, as well as any currently-inactive transforms between
371 * aFrame and that container layer.
373 static gfxSize GetThebesLayerScaleForFrame(nsIFrame* aFrame);
376 * Stores a Layer as the dedicated layer in the DisplayItemData for a given frame/key pair.
378 * Used when we optimize a ThebesLayer into an ImageLayer and want to retroactively update the
379 * DisplayItemData so we can retrieve the layer from within layout.
381 void StoreOptimizedLayerForFrame(nsDisplayItem* aItem, Layer* aLayer);
383 NS_DECLARE_FRAME_PROPERTY_WITH_FRAME_IN_DTOR(LayerManagerDataProperty,
384 RemoveFrameFromLayerManager)
387 * Retained data storage:
389 * Each layer manager (widget, and inactive) stores a LayerManagerData object
390 * that keeps a hash-set of DisplayItemData items that were drawn into it.
391 * Each frame also keeps a list of DisplayItemData pointers that were
392 * created for that frame. DisplayItemData objects manage these lists automatically.
394 * During layer construction we update the data in the LayerManagerData object, marking
395 * items that are modified. At the end we sweep the LayerManagerData hash-set and remove
396 * all items that haven't been modified.
400 * Retained data for a display item.
402 class DisplayItemData MOZ_FINAL {
403 public:
404 friend class FrameLayerBuilder;
406 uint32_t GetDisplayItemKey() { return mDisplayItemKey; }
407 Layer* GetLayer() { return mLayer; }
408 void Invalidate() { mIsInvalid = true; }
410 private:
411 DisplayItemData(LayerManagerData* aParent,
412 uint32_t aKey,
413 nsIFrame* aFrame = nullptr);
414 DisplayItemData(DisplayItemData &toCopy);
417 * Removes any references to this object from frames
418 * in mFrameList.
420 ~DisplayItemData();
422 NS_INLINE_DECL_REFCOUNTING(DisplayItemData)
426 * Associates this DisplayItemData with a frame, and adds it
427 * to the LayerManagerDataProperty list on the frame.
429 void AddFrame(nsIFrame* aFrame);
430 void RemoveFrame(nsIFrame* aFrame);
431 const nsTArray<nsIFrame*>& GetFrameListChanges();
434 * Updates the contents of this item to a new set of data, instead of allocating a new
435 * object.
436 * Set the passed in parameters, and clears the opt layer and inactive manager.
437 * Parent, and display item key are assumed to be the same.
439 * EndUpdate must be called before the end of the transaction to complete the update.
441 void BeginUpdate(Layer* aLayer, LayerState aState,
442 uint32_t aContainerLayerGeneration, nsDisplayItem* aItem = nullptr);
445 * Completes the update of this, and removes any references to data that won't live
446 * longer than the transaction.
448 * Updates the geometry, frame list and clip.
449 * For items within a ThebesLayer, a geometry object must be specifed to retain
450 * until the next transaction.
453 void EndUpdate(nsAutoPtr<nsDisplayItemGeometry> aGeometry);
454 void EndUpdate();
456 LayerManagerData* mParent;
457 nsRefPtr<Layer> mLayer;
458 nsRefPtr<Layer> mOptLayer;
459 nsRefPtr<BasicLayerManager> mInactiveManager;
460 nsAutoTArray<nsIFrame*, 1> mFrameList;
461 nsAutoPtr<nsDisplayItemGeometry> mGeometry;
462 DisplayItemClip mClip;
463 uint32_t mDisplayItemKey;
464 uint32_t mContainerLayerGeneration;
465 LayerState mLayerState;
468 * Temporary stoarage of the display item being referenced, only valid between
469 * BeginUpdate and EndUpdate.
471 nsDisplayItem* mItem;
472 nsAutoTArray<nsIFrame*, 1> mFrameListChanges;
475 * Used to track if data currently stored in mFramesWithLayers (from an existing
476 * paint) has been updated in the current paint.
478 bool mUsed;
479 bool mIsInvalid;
482 protected:
484 friend class LayerManagerData;
486 static void RemoveFrameFromLayerManager(nsIFrame* aFrame, void* aPropertyValue);
489 * Given a frame and a display item key that uniquely identifies a
490 * display item for the frame, find the layer that was last used to
491 * render that display item. Returns null if there is no such layer.
492 * This could be a dedicated layer for the display item, or a ThebesLayer
493 * that renders many display items.
495 DisplayItemData* GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey);
498 * Stores DisplayItemData associated with aFrame, stores the data in
499 * mNewDisplayItemData.
501 DisplayItemData* StoreDataForFrame(nsDisplayItem* aItem, Layer* aLayer, LayerState aState);
502 void StoreDataForFrame(nsIFrame* aFrame,
503 uint32_t aDisplayItemKey,
504 Layer* aLayer,
505 LayerState aState);
507 // Flash the area within the context clip if paint flashing is enabled.
508 static void FlashPaint(gfxContext *aContext);
511 * Get the DisplayItemData array associated with this frame, or null if one
512 * doesn't exist.
514 * Note that the pointer returned here is only valid so long as you don't
515 * poke the LayerManagerData's mFramesWithLayers hashtable.
517 DisplayItemData* GetDisplayItemData(nsIFrame *aFrame, uint32_t aKey);
520 * Get the DisplayItemData associated with this frame / display item pair,
521 * using the LayerManager instead of FrameLayerBuilder.
523 static DisplayItemData* GetDisplayItemDataForManager(nsIFrame* aFrame,
524 uint32_t aDisplayItemKey,
525 LayerManager* aManager);
526 static DisplayItemData* GetDisplayItemDataForManager(nsIFrame* aFrame,
527 uint32_t aDisplayItemKey);
528 static DisplayItemData* GetDisplayItemDataForManager(nsDisplayItem* aItem, LayerManager* aManager);
529 static DisplayItemData* GetDisplayItemDataForManager(nsIFrame* aFrame,
530 uint32_t aDisplayItemKey,
531 LayerManagerData* aData);
533 static PLDHashOperator DumpDisplayItemDataForFrame(nsRefPtrHashKey<DisplayItemData>* aEntry,
534 void* aClosure);
536 * We store one of these for each display item associated with a
537 * ThebesLayer, in a hashtable that maps each ThebesLayer to an array
538 * of ClippedDisplayItems. (ThebesLayerItemsEntry is the hash entry
539 * for that hashtable.)
540 * These are only stored during the paint process, so that the
541 * DrawThebesLayer callback can figure out which items to draw for the
542 * ThebesLayer.
544 struct ClippedDisplayItem {
545 ClippedDisplayItem(nsDisplayItem* aItem, uint32_t aGeneration)
546 : mItem(aItem), mContainerLayerGeneration(aGeneration)
550 ~ClippedDisplayItem();
552 nsDisplayItem* mItem;
555 * If the display item is being rendered as an inactive
556 * layer, then this stores the layer manager being
557 * used for the inactive transaction.
559 nsRefPtr<LayerManager> mInactiveLayerManager;
561 uint32_t mContainerLayerGeneration;
565 static void RecomputeVisibilityForItems(nsTArray<ClippedDisplayItem>& aItems,
566 nsDisplayListBuilder* aBuilder,
567 const nsIntRegion& aRegionToDraw,
568 const nsIntPoint& aOffset,
569 int32_t aAppUnitsPerDevPixel,
570 float aXScale,
571 float aYScale);
573 void PaintItems(nsTArray<ClippedDisplayItem>& aItems,
574 const nsIntRect& aRect,
575 gfxContext* aContext,
576 nsRenderingContext* aRC,
577 nsDisplayListBuilder* aBuilder,
578 nsPresContext* aPresContext,
579 const nsIntPoint& aOffset,
580 float aXScale, float aYScale,
581 int32_t aCommonClipCount);
584 * We accumulate ClippedDisplayItem elements in a hashtable during
585 * the paint process. This is the hashentry for that hashtable.
587 public:
588 class ThebesLayerItemsEntry : public nsPtrHashKey<ThebesLayer> {
589 public:
590 explicit ThebesLayerItemsEntry(const ThebesLayer *key)
591 : nsPtrHashKey<ThebesLayer>(key)
592 , mContainerLayerFrame(nullptr)
593 , mLastCommonClipCount(0)
594 , mContainerLayerGeneration(0)
595 , mHasExplicitLastPaintOffset(false)
596 , mCommonClipCount(0)
598 ThebesLayerItemsEntry(const ThebesLayerItemsEntry &toCopy) :
599 nsPtrHashKey<ThebesLayer>(toCopy.mKey), mItems(toCopy.mItems)
601 NS_ERROR("Should never be called, since we ALLOW_MEMMOVE");
604 nsTArray<ClippedDisplayItem> mItems;
605 nsIFrame* mContainerLayerFrame;
606 // The translation set on this ThebesLayer before we started updating the
607 // layer tree.
608 nsIntPoint mLastPaintOffset;
609 uint32_t mLastCommonClipCount;
611 uint32_t mContainerLayerGeneration;
612 bool mHasExplicitLastPaintOffset;
614 * The first mCommonClipCount rounded rectangle clips are identical for
615 * all items in the layer. Computed in ThebesLayerData.
617 uint32_t mCommonClipCount;
619 enum { ALLOW_MEMMOVE = true };
623 * Get the ThebesLayerItemsEntry object associated with aLayer in this
624 * FrameLayerBuilder
626 ThebesLayerItemsEntry* GetThebesLayerItemsEntry(ThebesLayer* aLayer)
628 return mThebesLayerItems.GetEntry(aLayer);
631 ThebesLayerData* GetContainingThebesLayerData()
633 return mContainingThebesLayer;
636 bool IsBuildingRetainedLayers()
638 return !mContainingThebesLayer && mRetainingManager;
642 * Attempt to build the most compressed layer tree possible, even if it means
643 * throwing away existing retained buffers.
645 void SetLayerTreeCompressionMode() { mInLayerTreeCompressionMode = true; }
646 bool CheckInLayerTreeCompressionMode();
648 void ComputeGeometryChangeForItem(DisplayItemData* aData);
650 protected:
651 void RemoveThebesItemsAndOwnerDataForLayerSubtree(Layer* aLayer,
652 bool aRemoveThebesItems,
653 bool aRemoveOwnerData);
655 static PLDHashOperator ProcessRemovedDisplayItems(nsRefPtrHashKey<DisplayItemData>* aEntry,
656 void* aUserArg);
657 static PLDHashOperator RestoreDisplayItemData(nsRefPtrHashKey<DisplayItemData>* aEntry,
658 void *aUserArg);
660 static PLDHashOperator RestoreThebesLayerItemEntries(ThebesLayerItemsEntry* aEntry,
661 void *aUserArg);
664 * Returns true if the DOM has been modified since we started painting,
665 * in which case we should bail out and not paint anymore. This should
666 * never happen, but plugins can trigger it in some cases.
668 bool CheckDOMModified();
671 * The layer manager belonging to the widget that is being retained
672 * across paints.
674 LayerManager* mRetainingManager;
676 * The root prescontext for the display list builder reference frame
678 nsRefPtr<nsRootPresContext> mRootPresContext;
681 * The display list builder being used.
683 nsDisplayListBuilder* mDisplayListBuilder;
685 * A map from ThebesLayers to the list of display items (plus
686 * clipping data) to be rendered in the layer.
688 nsTHashtable<ThebesLayerItemsEntry> mThebesLayerItems;
691 * When building layers for an inactive layer, this is where the
692 * inactive layer will be placed.
694 ThebesLayerData* mContainingThebesLayer;
697 * Saved generation counter so we can detect DOM changes.
699 uint32_t mInitialDOMGeneration;
701 * Set to true if we have detected and reported DOM modification during
702 * the current paint.
704 bool mDetectedDOMModification;
706 * Indicates that the entire layer tree should be rerendered
707 * during this paint.
709 bool mInvalidateAllLayers;
711 bool mInLayerTreeCompressionMode;
713 uint32_t mContainerLayerGeneration;
714 uint32_t mMaxContainerLayerGeneration;
719 #endif /* FRAMELAYERBUILDER_H_ */