Files
palemoon27/gfx/layers/basic/BasicImplData.h
T
roytam1 aa93536920 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1208300 (part 1) - Remove unused default arguments from ClearThebesSurface. r=jwatt. (bcb2009a23)
- Bug 1208300 (part 2) - Convert gfxRGBA uses to gfx::Color in CompositorBench.cpp. r=jwatt. (ea9b6e5e4e)
- Bug 1208300 (part 3) - Convert gfxRGBA uses to gfx::Color in LayerScope.cpp. r=jwatt. (cdee85cd56)
-  Bg 1155249 - Prescale image with an intermediate surface if repeated often on OS X. r=mstange (de799a164a)
- Bug 1181554 - Snap the spread radius for inset box shadows to device pixels. (af015ea088)
- Bug 1137148. Fix painting of ridge/groove borders for border-collapsed tables. r=jwatt (702e4fbe9b)
- Bug 1185636 - Part 4b - don't use a css border skirt when printing. r=mstange (2e66f01772)
- Bug 1178575 - Intersect the clip rect with aDirtyRect. r=roc (88848e836a)
- Bug 1193519 pt 1 - Update coordinate conversions in WritingModes.h to account for sideways-lr writing mode. r=dholbert (b89824bcb6)
- Bug 1193519 pt 2 - Handle sideways-left orientation in gfx text-drawing code. r=dholbert (4cdc8e0c38)
- Bug 1193519 pt 3 - Handle writing-mode:sideways-lr in nsTextFrame selection and rendering. r=dholbert (b774d26992)
- Bug 1159729 - Use the adjusted |offset| value in GetTextDecorationRectInternal, instead of ignoring it. r=smontagu (b1c735a0b0)
- Bug 1193519 pt 4 - Reverse the direction of text-decoration offsets in sideways-lr mode. r=dholbert (585bcf555a)
- Bug 1205787 - Map the writing-mode values from SVG1.1 to their CSS equivalents. r=heycam (dd8e0d9767)
- Bug 1193488 - Update values of writing-mode and text-orientation to reflect the CSS WG decision to revise them in the Writing Modes spec. r=dholbert (4399949445)
- Bug 1193519 pt 5 - Expose the sideways-lr value for writing-mode to CSS. r=dholbert (ece6e331d1)
- Bug 1193519 pt 6 - Adjust the position of the caret bidi indicator appropriately for sideways-lr mode. r=dholbert (b09478c428)
- Bug 1205787 - Reftest using legacy SVG1.1 writing-mode values. r=heycam (062df44279)
- Bug 1193519 pt 7 - Basic reftests for sideways-lr writing mode. r=dholbert (2c66b9e399)
- Bug 1180528 - Reftest for table row progression in vertical-rl writing mode with ltr and rtl directionality. r=dholbert (e2a5c6cadb)
- Bug 1193519 pt 8 - Reftests for table row and cell ordering in sideways-* writing modes. r=dholbert (6487fce57d)
- Bug 1193519 pt 9 - Reftests with floats in writing-mode: sideways-lr. r=dholbert (9f51c048c6)
- Bug 1193519 pt 10 - Clean up remaining mentions of 'sideways-left' in code comments. r=dholbert (8483886936)
- Bug 1193519 pt 11 - Reftest for sideways-lr writing mode with text-decoration. r=dholbert (bcfd28b4e8)
- Bug 1193519 followup - annotate test for antialiasing fuzz on OS X. (1b8a465d1f)
- Bug 1155828 - Draw box-shadows using an approach inspired by border-image. r=mstange (744997a069)
- Bug 1162824 - Change box shadow cache to cache the colored blurred box shadow. r=mstange (813107388f)
- convert TemporaryRef to already_AddRefed (626bbcb2ec)
- Bug 1179049. Properly null check for draw target in box shadow code. r=mstange (8f3c03253c)
- Bug 1188075 - Speed up inner box-shadow drawing by using a border-image style approach. r=mstange (61e4564172)
- Bug 1208345 - Remove gfxContext::GraphicsOperator. r=jwatt. (884be741db)
- Bug 1199534. Only set TabChild canvas background for the background of root PresContexts. r=mats (9a37268f31)
- remove special transparent case, not found in FF45/52 nor TFF (a2577d8a0c)
- Bug 1202320 - Fall back to platform APZ enabled in PresShell. r=kats (5a62e3e058)
- bug 1171131 - Make dom/plugins/ipc build for iOS. r=jimm (cba4193b6e)
- Bug 1207741 - Remove gfxIntSize. r=nical. (13b99abb9c)
- Bug 591600 - CSS gradients should work on premultiplied colors. r=mstange (b0c6e73961)
2022-08-24 10:13:19 +08:00

133 lines
4.7 KiB
C++

/* 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_BASICIMPLDATA_H
#define GFX_BASICIMPLDATA_H
#include "Layers.h" // for Layer (ptr only), etc
#include "gfxContext.h" // for gfxContext, etc
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
#include "mozilla/gfx/Types.h"
namespace mozilla {
namespace layers {
class ReadbackProcessor;
/**
* This is the ImplData for all Basic layers. It also exposes methods
* private to the Basic implementation that are common to all Basic layer types.
* In particular, there is an internal Paint() method that we can use
* to paint the contents of non-PaintedLayers.
*
* The class hierarchy for Basic layers is like this:
* BasicImplData
* Layer | | |
* | | | |
* +-> ContainerLayer | | |
* | | | | |
* | +-> BasicContainerLayer <--+ | |
* | | |
* +-> PaintedLayer | |
* | | | |
* | +-> BasicPaintedLayer <---------+ |
* | |
* +-> ImageLayer |
* | |
* +-> BasicImageLayer <--------------+
*/
class BasicImplData {
public:
BasicImplData() : mHidden(false),
mClipToVisibleRegion(false),
mDrawAtomically(false),
mOperator(gfx::CompositionOp::OP_OVER)
{
MOZ_COUNT_CTOR(BasicImplData);
}
virtual ~BasicImplData()
{
MOZ_COUNT_DTOR(BasicImplData);
}
/**
* Layers that paint themselves, such as ImageLayers, should paint
* in response to this method call. aContext will already have been
* set up to account for all the properties of the layer (transform,
* opacity, etc).
*/
virtual void Paint(gfx::DrawTarget* aDT,
const gfx::Point& aDeviceOffset,
Layer* aMaskLayer) {}
/**
* Like Paint() but called for PaintedLayers with the additional parameters
* they need.
* If mClipToVisibleRegion is set, then the layer must clip to its
* effective visible region (snapped or unsnapped, it doesn't matter).
*/
virtual void PaintThebes(gfxContext* aContext,
Layer* aMasklayer,
LayerManager::DrawPaintedLayerCallback aCallback,
void* aCallbackData) {}
virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
void* aCallbackData,
ReadbackProcessor* aReadback) {}
/**
* Layers will get this call when their layer manager is destroyed, this
* indicates they should clear resources they don't really need after their
* LayerManager ceases to exist.
*/
virtual void ClearCachedResources() {}
/**
* This variable is set by MarkLayersHidden() before painting. It indicates
* that the layer should not be composited during this transaction.
*/
void SetHidden(bool aCovered) { mHidden = aCovered; }
bool IsHidden() const { return false; }
/**
* This variable is set by MarkLayersHidden() before painting. This is
* the operator to be used when compositing the layer in this transaction. It must
* be OVER or SOURCE.
*/
void SetOperator(gfx::CompositionOp aOperator)
{
NS_ASSERTION(aOperator == gfx::CompositionOp::OP_OVER ||
aOperator == gfx::CompositionOp::OP_SOURCE,
"Bad composition operator");
mOperator = aOperator;
}
gfx::CompositionOp GetOperator() const { return mOperator; }
/**
* Return a surface for this layer. Will use an existing surface, if
* possible, or may create a temporary surface. Implement this
* method for any layers that might be used as a mask. Should only
* return false if a surface cannot be created. If true is
* returned, only one of |aSurface| or |aDescriptor| is valid.
*/
virtual already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() { return nullptr; }
bool GetClipToVisibleRegion() { return mClipToVisibleRegion; }
void SetClipToVisibleRegion(bool aClip) { mClipToVisibleRegion = aClip; }
void SetDrawAtomically(bool aDrawAtomically) { mDrawAtomically = aDrawAtomically; }
protected:
bool mHidden;
bool mClipToVisibleRegion;
bool mDrawAtomically;
gfx::CompositionOp mOperator;
};
} // namespace layers
} // namespace mozilla
#endif