Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef __NS_SVGPAINTSERVERFRAME_H__ |
michael@0 | 7 | #define __NS_SVGPAINTSERVERFRAME_H__ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Attributes.h" |
michael@0 | 10 | #include "nsCOMPtr.h" |
michael@0 | 11 | #include "nsFrame.h" |
michael@0 | 12 | #include "nsIFrame.h" |
michael@0 | 13 | #include "nsQueryFrame.h" |
michael@0 | 14 | #include "nsSVGContainerFrame.h" |
michael@0 | 15 | #include "nsSVGUtils.h" |
michael@0 | 16 | |
michael@0 | 17 | class gfxContext; |
michael@0 | 18 | class gfxPattern; |
michael@0 | 19 | class nsStyleContext; |
michael@0 | 20 | |
michael@0 | 21 | struct gfxRect; |
michael@0 | 22 | |
michael@0 | 23 | typedef nsSVGContainerFrame nsSVGPaintServerFrameBase; |
michael@0 | 24 | |
michael@0 | 25 | class nsSVGPaintServerFrame : public nsSVGPaintServerFrameBase |
michael@0 | 26 | { |
michael@0 | 27 | protected: |
michael@0 | 28 | nsSVGPaintServerFrame(nsStyleContext* aContext) |
michael@0 | 29 | : nsSVGPaintServerFrameBase(aContext) |
michael@0 | 30 | { |
michael@0 | 31 | AddStateBits(NS_FRAME_IS_NONDISPLAY); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | public: |
michael@0 | 35 | NS_DECL_FRAMEARENA_HELPERS |
michael@0 | 36 | |
michael@0 | 37 | /** |
michael@0 | 38 | * Constructs a gfxPattern of the paint server rendering. |
michael@0 | 39 | * |
michael@0 | 40 | * @param aContextMatrix The transform matrix that is currently applied to |
michael@0 | 41 | * the gfxContext that is being drawn to. This is needed by SVG patterns so |
michael@0 | 42 | * that surfaces of the correct size can be created. (SVG gradients are |
michael@0 | 43 | * vector based, so it's not used there.) |
michael@0 | 44 | */ |
michael@0 | 45 | virtual already_AddRefed<gfxPattern> |
michael@0 | 46 | GetPaintServerPattern(nsIFrame *aSource, |
michael@0 | 47 | const gfxMatrix& aContextMatrix, |
michael@0 | 48 | nsStyleSVGPaint nsStyleSVG::*aFillOrStroke, |
michael@0 | 49 | float aOpacity, |
michael@0 | 50 | const gfxRect *aOverrideBounds = nullptr) = 0; |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | * Configure paint server prior to rendering |
michael@0 | 54 | * @return false to skip rendering |
michael@0 | 55 | */ |
michael@0 | 56 | virtual bool SetupPaintServer(gfxContext *aContext, |
michael@0 | 57 | nsIFrame *aSource, |
michael@0 | 58 | nsStyleSVGPaint nsStyleSVG::*aFillOrStroke, |
michael@0 | 59 | float aOpacity); |
michael@0 | 60 | |
michael@0 | 61 | // nsIFrame methods: |
michael@0 | 62 | virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, |
michael@0 | 63 | const nsRect& aDirtyRect, |
michael@0 | 64 | const nsDisplayListSet& aLists) MOZ_OVERRIDE {} |
michael@0 | 65 | |
michael@0 | 66 | virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE |
michael@0 | 67 | { |
michael@0 | 68 | return nsSVGPaintServerFrameBase::IsFrameOfType(aFlags & ~nsIFrame::eSVGPaintServer); |
michael@0 | 69 | } |
michael@0 | 70 | }; |
michael@0 | 71 | |
michael@0 | 72 | #endif // __NS_SVGPAINTSERVERFRAME_H__ |