mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Bug 989337 - 3/3 - Convert Canvas2D to typed enums and EnumeratedArray, final manual changes - r=Bas
This commit is contained in:
parent
db3b2f8c3e
commit
e1cf083e14
@ -166,7 +166,7 @@ public:
|
||||
CanvasRadialGradient(CanvasRenderingContext2D* aContext,
|
||||
const Point &aBeginOrigin, Float aBeginRadius,
|
||||
const Point &aEndOrigin, Float aEndRadius)
|
||||
: CanvasGradient(aContext, RADIAL)
|
||||
: CanvasGradient(aContext, Type::RADIAL)
|
||||
, mCenter1(aBeginOrigin)
|
||||
, mCenter2(aEndOrigin)
|
||||
, mRadius1(aBeginRadius)
|
||||
@ -185,7 +185,7 @@ class CanvasLinearGradient : public CanvasGradient
|
||||
public:
|
||||
CanvasLinearGradient(CanvasRenderingContext2D* aContext,
|
||||
const Point &aBegin, const Point &aEnd)
|
||||
: CanvasGradient(aContext, LINEAR)
|
||||
: CanvasGradient(aContext, Type::LINEAR)
|
||||
, mBegin(aBegin)
|
||||
, mEnd(aEnd)
|
||||
{
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "gfx2DGlue.h"
|
||||
#include "imgIEncoder.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "mozilla/EnumeratedArray.h"
|
||||
|
||||
class nsGlobalWindow;
|
||||
class nsXULElement;
|
||||
@ -870,6 +871,9 @@ protected:
|
||||
|
||||
ContextState(const ContextState& other)
|
||||
: fontGroup(other.fontGroup),
|
||||
gradientStyles(other.gradientStyles),
|
||||
patternStyles(other.patternStyles),
|
||||
colorStyles(other.colorStyles),
|
||||
font(other.font),
|
||||
textAlign(other.textAlign),
|
||||
textBaseline(other.textBaseline),
|
||||
@ -887,13 +891,7 @@ protected:
|
||||
lineCap(other.lineCap),
|
||||
lineJoin(other.lineJoin),
|
||||
imageSmoothingEnabled(other.imageSmoothingEnabled)
|
||||
{
|
||||
for (int i = 0; i < Style::MAX; i++) {
|
||||
colorStyles[i] = other.colorStyles[i];
|
||||
gradientStyles[i] = other.gradientStyles[i];
|
||||
patternStyles[i] = other.patternStyles[i];
|
||||
}
|
||||
}
|
||||
{ }
|
||||
|
||||
void SetColorStyle(Style whichStyle, nscolor color)
|
||||
{
|
||||
@ -926,14 +924,14 @@ protected:
|
||||
std::vector<mozilla::RefPtr<mozilla::gfx::Path> > clipsPushed;
|
||||
|
||||
nsRefPtr<gfxFontGroup> fontGroup;
|
||||
nsRefPtr<CanvasGradient> gradientStyles[Style::MAX];
|
||||
nsRefPtr<CanvasPattern> patternStyles[Style::MAX];
|
||||
EnumeratedArray<Style, Style::MAX, nsRefPtr<CanvasGradient>> gradientStyles;
|
||||
EnumeratedArray<Style, Style::MAX, nsRefPtr<CanvasPattern>> patternStyles;
|
||||
EnumeratedArray<Style, Style::MAX, nscolor> colorStyles;
|
||||
|
||||
nsString font;
|
||||
TextAlign textAlign;
|
||||
TextBaseline textBaseline;
|
||||
|
||||
nscolor colorStyles[Style::MAX];
|
||||
nscolor shadowColor;
|
||||
|
||||
mozilla::gfx::Matrix transform;
|
||||
|
Loading…
Reference in New Issue
Block a user