mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
15db8f16bf
- Bug 1132854 - Remove the gfx::ToIntSize conversion helper. r=Bas (0ee451e53) - Bug 1020179 - Let PContent manage PContentPermissionRequest. r=fabrice, r=khuey (caf96b54e) - Bug 1153023 - Convert TabParent::mChromeOffset to a LayoutDeviceIntPoint. r=billm (ba338584a) - Bug 1139033 - Don't schedule an unnecessary repeat transaction when doing a non-progressive paint. r=nical (9c77d9318) - Bug 1137203 - Ignore the critical displayport when a layer is subject to OMTA relative to the scrolling ancestor. r=BenWa (c9bedfb1e) - Bug 1137203 - Cleanup to ditch the fast-path code entirely and just prevent progressive drawing in the equivalent scenarios. r=BenWa (6bc5b8813) - Bug 1128042 - Don't round critical displayport out as it should already be tile aligned and rounding error can increase tile usage. r=botond (03e34e2c5) - Bug 1149461 - Disable progressive drawing unless the compositor is actively scrolling a tiled layer. r=nical (7a3de28cb) - Bug 1152838 - Correctly inflate valid regions to tile boundaries. r=mattwoodrow (7a496f645) - Bug 1148971 - Make nsITheme::GetMinimumWidgetSize return a LayoutDeviceIntSize result instead of the unit-less nsIntSize type. r=roc (c34ddc478) - Bug 1155621 - Make nsIntRect and nsIntPoint typedefs of mozilla::gfx::IntRect and mozilla::gfx::IntPoint. r=Bas (9901a37f6) - Bug 1156632 - Remove unused forward class declarations - patch 5 - rdf, parser, layout and something else, r=ehsan (794739bd3) - Bug 1156632 - Remove unused forward class declarations - patch 6 - the rest of the tree, r=ehsan (63a2c4cb4) - Bug 1161634 - Allow synthesizing native mouse-scroll events on Linux. r=karlt (b88c1f367) - Bug 1161634 - Enable the test_wheel_scroll on Linux as well. r=mstange (7dab62ad4) - Bug 1144643 - Render tooltips as transparent on Gtk3. r=karlt (80f7fa312) - Bug 1174966 part 1 - Change type of mCancelledPointerLockRequests field from uint32_t to bit field. r=smaug (ef235c33e) - Bug 1155030 - Fix asterix/asterisk misspelling. r=ehsan (edb769304) - Bug 1149194 - Don't use uninitialized value in ComputedTimingFunction::operator==. r=bbirtles (6bc804d45) - Bug 1151346 - Make ActiveLayerTracker::IsOffsetOrMarginStyleAnimated respect CSS animations. r=roc (2c3f24ba0) - Bug 1151346 - Back out the important part again because of bug 1151889. (002b0e67b) - Bug 1122414 part 1 - Factor out a TransitionProperty method in ElementPropertyTransition; r=jwatt (ddbbdb04c) - Bug 1122414 part 2 - Return the transitionProperty from Animation.name for CSS transitions; r=jwatt (689251b93) - Bug 1122414 part 3 - Update DevTools tests to expect a name for transitions; r=pbrosset (f0d7e57e9) - Bug 1149999 - 1 - Display transition names in animation-panel now that they have names; r=past (ea3d8d552) - Bug 1120343 - 1 - Allow setting animations' currentTime by clicking/dragging the timeline; r=miker (936996d21) - Bug 1120343 - 2 - Add rewind and fast-forward buttons to animation player widgets; r=miker (95eddc465) - Bug 1120343 - 3 - Tests for the current time control in the animation panel; r=miker (b8a93f858) - Bug 1110762 - Add a setCurrentTime method to the animation actor; r=past (d0dae8967) - Bug 1123851 - 1 - Element geometry highlighter; r=bgrins (89b1a83bf) - Bug 1123851 - 2 - Tests for the element geometry highlighter; r=bgrins (7542bcab0) - add missing part of accessing first element from Bug 1139925 - Make the BoxModelHighlighter highlight all quads (b5c6076c1) - Bug 1139186 - 1 - Refactor to the native anon nodes manipulation in highlighters; r=bgrins (a454aefbf) - Bug 1139186 - 2 - Add event handling support to CanvasFrameAnonymousContentHelper; r=bgrins (a705c2716) - Bug 1120339 - Add setPlaybackRate method to AnimationPlayerActor; r=past (efa167a19) - Bug 1120833 - 2 - Fire events about changed animations in the AnimationsActor; r=past (4b5fddd23) - Bug 1120833 - 1 - Remove EventEmitter usage in AnimationPlayerFront (21186e616)
202 lines
8.0 KiB
C++
202 lines
8.0 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
* 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 GFX_BASICLAYERS_H
|
|
#define GFX_BASICLAYERS_H
|
|
|
|
#include <stdint.h> // for INT32_MAX, int32_t
|
|
#include "Layers.h" // for Layer (ptr only), etc
|
|
#include "gfxTypes.h"
|
|
#include "gfxContext.h" // for gfxContext
|
|
#include "mozilla/Attributes.h" // for override
|
|
#include "mozilla/WidgetUtils.h" // for ScreenRotation
|
|
#include "mozilla/layers/LayersTypes.h" // for BufferMode, LayersBackend, etc
|
|
#include "nsAString.h"
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
#include "nsISupportsImpl.h" // for gfxContext::AddRef, etc
|
|
#include "nsRegion.h" // for nsIntRegion
|
|
#include "nscore.h" // for nsAString, etc
|
|
|
|
class nsIWidget;
|
|
|
|
namespace mozilla {
|
|
namespace layers {
|
|
|
|
class ImageFactory;
|
|
class ImageLayer;
|
|
class PaintLayerContext;
|
|
class ReadbackLayer;
|
|
|
|
/**
|
|
* This is a cairo/Thebes-only, main-thread-only implementation of layers.
|
|
*
|
|
* In each transaction, the client sets up the layer tree and then during
|
|
* the drawing phase, each PaintedLayer is painted directly into the target
|
|
* context (with appropriate clipping and Push/PopGroups performed
|
|
* between layers).
|
|
*/
|
|
class BasicLayerManager final :
|
|
public LayerManager
|
|
{
|
|
public:
|
|
enum BasicLayerManagerType {
|
|
BLM_WIDGET,
|
|
BLM_OFFSCREEN,
|
|
BLM_INACTIVE
|
|
};
|
|
/**
|
|
* Construct a BasicLayerManager which will have no default
|
|
* target context. SetDefaultTarget or BeginTransactionWithTarget
|
|
* must be called for any rendering to happen. PaintedLayers will not
|
|
* be retained.
|
|
*/
|
|
explicit BasicLayerManager(BasicLayerManagerType aType);
|
|
/**
|
|
* Construct a BasicLayerManager which will have no default
|
|
* target context. SetDefaultTarget or BeginTransactionWithTarget
|
|
* must be called for any rendering to happen. PaintedLayers will be
|
|
* retained; that is, we will try to retain the visible contents of
|
|
* PaintedLayers as cairo surfaces. We create PaintedLayer buffers by
|
|
* creating similar surfaces to the default target context, or to
|
|
* aWidget's GetThebesSurface if there is no default target context, or
|
|
* to the passed-in context if there is no widget and no default
|
|
* target context.
|
|
*
|
|
* This does not keep a strong reference to the widget, so the caller
|
|
* must ensure that the widget outlives the layer manager or call
|
|
* ClearWidget before the widget dies.
|
|
*/
|
|
explicit BasicLayerManager(nsIWidget* aWidget);
|
|
|
|
protected:
|
|
virtual ~BasicLayerManager();
|
|
|
|
public:
|
|
/**
|
|
* Set the default target context that will be used when BeginTransaction
|
|
* is called. This can only be called outside a transaction.
|
|
*
|
|
* aDoubleBuffering can request double-buffering for drawing to the
|
|
* default target. When BUFFERED, the layer manager avoids blitting
|
|
* temporary results to aContext and then overpainting them with final
|
|
* results, by using a temporary buffer when necessary. In BUFFERED
|
|
* mode we always completely overwrite the contents of aContext's
|
|
* destination surface (within the clip region) using OPERATOR_SOURCE.
|
|
*/
|
|
void SetDefaultTarget(gfxContext* aContext);
|
|
virtual void SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation);
|
|
gfxContext* GetDefaultTarget() { return mDefaultTarget; }
|
|
|
|
nsIWidget* GetRetainerWidget() { return mWidget; }
|
|
void ClearRetainerWidget() { mWidget = nullptr; }
|
|
|
|
virtual bool IsWidgetLayerManager() override { return mWidget != nullptr; }
|
|
virtual bool IsInactiveLayerManager() override { return mType == BLM_INACTIVE; }
|
|
|
|
virtual void BeginTransaction() override;
|
|
virtual void BeginTransactionWithTarget(gfxContext* aTarget) override;
|
|
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) override;
|
|
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
|
void* aCallbackData,
|
|
EndTransactionFlags aFlags = END_DEFAULT) override;
|
|
virtual bool ShouldAvoidComponentAlphaLayers() override { return IsWidgetLayerManager(); }
|
|
|
|
void AbortTransaction();
|
|
|
|
virtual void SetRoot(Layer* aLayer) override;
|
|
|
|
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() override;
|
|
virtual already_AddRefed<ContainerLayer> CreateContainerLayer() override;
|
|
virtual already_AddRefed<ImageLayer> CreateImageLayer() override;
|
|
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() override;
|
|
virtual already_AddRefed<ColorLayer> CreateColorLayer() override;
|
|
virtual already_AddRefed<ReadbackLayer> CreateReadbackLayer() override;
|
|
virtual ImageFactory *GetImageFactory();
|
|
|
|
virtual LayersBackend GetBackendType() override { return LayersBackend::LAYERS_BASIC; }
|
|
virtual void GetBackendName(nsAString& name) override { name.AssignLiteral("Basic"); }
|
|
|
|
bool InConstruction() { return mPhase == PHASE_CONSTRUCTION; }
|
|
#ifdef DEBUG
|
|
bool InDrawing() { return mPhase == PHASE_DRAWING; }
|
|
bool InForward() { return mPhase == PHASE_FORWARD; }
|
|
#endif
|
|
bool InTransaction() { return mPhase != PHASE_NONE; }
|
|
|
|
gfxContext* GetTarget() { return mTarget; }
|
|
void SetTarget(gfxContext* aTarget) { mUsingDefaultTarget = false; mTarget = aTarget; }
|
|
bool IsRetained() { return mWidget != nullptr; }
|
|
|
|
virtual const char* Name() const override { return "Basic"; }
|
|
|
|
// Clear the cached contents of this layer tree.
|
|
virtual void ClearCachedResources(Layer* aSubtree = nullptr) override;
|
|
|
|
void SetTransactionIncomplete() { mTransactionIncomplete = true; }
|
|
bool IsTransactionIncomplete() { return mTransactionIncomplete; }
|
|
|
|
already_AddRefed<gfxContext> PushGroupForLayer(gfxContext* aContext, Layer* aLayer,
|
|
const nsIntRegion& aRegion,
|
|
bool* aNeedsClipToVisibleRegion);
|
|
|
|
virtual bool IsCompositingCheap() override { return false; }
|
|
virtual int32_t GetMaxTextureSize() const override { return INT32_MAX; }
|
|
bool CompositorMightResample() { return mCompositorMightResample; }
|
|
|
|
virtual bool SupportsMixBlendModes(EnumSet<gfx::CompositionOp>& aMixBlendModes) override { return true; }
|
|
|
|
protected:
|
|
enum TransactionPhase {
|
|
PHASE_NONE, PHASE_CONSTRUCTION, PHASE_DRAWING, PHASE_FORWARD
|
|
};
|
|
TransactionPhase mPhase;
|
|
|
|
// This is the main body of the PaintLayer routine which will if it has
|
|
// children, recurse into PaintLayer() otherwise it will paint using the
|
|
// underlying Paint() method of the Layer. It will not do both.
|
|
void PaintSelfOrChildren(PaintLayerContext& aPaintContext, gfxContext* aGroupTarget);
|
|
|
|
// Paint the group onto the underlying target. This is used by PaintLayer to
|
|
// flush the group to the underlying target.
|
|
void FlushGroup(PaintLayerContext& aPaintContext, bool aNeedsClipToVisibleRegion);
|
|
|
|
// Paints aLayer to mTarget.
|
|
void PaintLayer(gfxContext* aTarget,
|
|
Layer* aLayer,
|
|
DrawPaintedLayerCallback aCallback,
|
|
void* aCallbackData);
|
|
|
|
// Clear the contents of a layer
|
|
void ClearLayer(Layer* aLayer);
|
|
|
|
bool EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
|
void* aCallbackData,
|
|
EndTransactionFlags aFlags = END_DEFAULT);
|
|
|
|
void FlashWidgetUpdateArea(gfxContext* aContext);
|
|
|
|
// Widget whose surface should be used as the basis for PaintedLayer
|
|
// buffers.
|
|
nsIWidget* mWidget;
|
|
// The default context for BeginTransaction.
|
|
nsRefPtr<gfxContext> mDefaultTarget;
|
|
// The context to draw into.
|
|
nsRefPtr<gfxContext> mTarget;
|
|
// Image factory we use.
|
|
nsRefPtr<ImageFactory> mFactory;
|
|
|
|
BufferMode mDoubleBuffering;
|
|
BasicLayerManagerType mType;
|
|
bool mUsingDefaultTarget;
|
|
bool mTransactionIncomplete;
|
|
bool mCompositorMightResample;
|
|
};
|
|
|
|
} // namespace layers
|
|
} // namespace mozilla
|
|
|
|
#endif /* GFX_BASICLAYERS_H */
|