Bug 734668; rename files and classes. r=roc

--HG--
rename : content/canvas/src/nsCanvasRenderingContext2DAzure.cpp => content/canvas/src/CanvasRenderingContext2D.cpp
rename : content/canvas/src/nsCanvasRenderingContext2DAzure.h => content/canvas/src/CanvasRenderingContext2D.h
extra : rebase_source : ded29b0c029bbcee232c4760c49539f465d40399
This commit is contained in:
Nicholas Cameron 2012-10-12 22:42:52 +13:00
Родитель 7eb091b2eb
Коммит 5df4e02871
5 изменённых файлов: 351 добавлений и 347 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -2,8 +2,8 @@
* 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 nsCanvasRenderingContext2DAzure_h
#define nsCanvasRenderingContext2DAzure_h
#ifndef CanvasRenderingContext2D_h
#define CanvasRenderingContext2D_h
#include <vector>
#include "nsIDOMCanvasRenderingContext2D.h"
@ -19,24 +19,26 @@
#include "mozilla/dom/ImageData.h"
#include "mozilla/dom/UnionTypes.h"
#define NS_CANVASGRADIENTAZURE_PRIVATE_IID \
{0x28425a6a, 0x90e0, 0x4d42, {0x9c, 0x75, 0xff, 0x60, 0x09, 0xb3, 0x10, 0xa8}}
#define NS_CANVASPATTERNAZURE_PRIVATE_IID \
{0xc9bacc25, 0x28da, 0x421e, {0x9a, 0x4b, 0xbb, 0xd6, 0x93, 0x05, 0x12, 0xbc}}
namespace mozilla {
namespace dom {
template<typename T> class Optional;
}
namespace gfx {
struct Rect;
class SourceSurface;
}
}
namespace dom {
extern const mozilla::gfx::Float SIGMA_MAX;
template<typename T> class Optional;
/**
** nsCanvasGradientAzure
** CanvasGradient
**/
#define NS_CANVASGRADIENTAZURE_PRIVATE_IID \
{0x28425a6a, 0x90e0, 0x4d42, {0x9c, 0x75, 0xff, 0x60, 0x09, 0xb3, 0x10, 0xa8}}
class nsCanvasGradientAzure : public nsIDOMCanvasGradient
class CanvasGradient : public nsIDOMCanvasGradient
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASGRADIENTAZURE_PRIVATE_IID)
@ -71,21 +73,19 @@ public:
NS_IMETHOD AddColorStop(float offset, const nsAString& colorstr);
protected:
nsCanvasGradientAzure(Type aType) : mType(aType)
CanvasGradient(Type aType) : mType(aType)
{}
nsTArray<mozilla::gfx::GradientStop> mRawStops;
mozilla::RefPtr<mozilla::gfx::GradientStops> mStops;
Type mType;
virtual ~nsCanvasGradientAzure() {}
virtual ~CanvasGradient() {}
};
/**
** nsCanvasPatternAzure
** CanvasPattern
**/
#define NS_CANVASPATTERNAZURE_PRIVATE_IID \
{0xc9bacc25, 0x28da, 0x421e, {0x9a, 0x4b, 0xbb, 0xd6, 0x93, 0x05, 0x12, 0xbc}}
class nsCanvasPatternAzure MOZ_FINAL : public nsIDOMCanvasPattern
class CanvasPattern MOZ_FINAL : public nsIDOMCanvasPattern
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASPATTERNAZURE_PRIVATE_IID)
@ -98,7 +98,7 @@ public:
NOREPEAT
};
nsCanvasPatternAzure(mozilla::gfx::SourceSurface* aSurface,
CanvasPattern(mozilla::gfx::SourceSurface* aSurface,
RepeatMode aRepeat,
nsIPrincipal* principalForSecurityCheck,
bool forceWriteOnly,
@ -120,13 +120,13 @@ public:
const bool mCORSUsed;
};
struct nsCanvasBidiProcessorAzure;
class CanvasRenderingContext2DUserDataAzure;
struct CanvasBidiProcessor;
class CanvasRenderingContext2DUserData;
/**
** nsCanvasRenderingContext2DAzure
** CanvasRenderingContext2D
**/
class nsCanvasRenderingContext2DAzure :
class CanvasRenderingContext2D :
public nsIDOMCanvasRenderingContext2D,
public nsICanvasRenderingContextInternal,
public nsWrapperCache
@ -135,8 +135,8 @@ typedef mozilla::dom::HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement
HTMLImageOrCanvasOrVideoElement;
public:
nsCanvasRenderingContext2DAzure();
virtual ~nsCanvasRenderingContext2DAzure();
CanvasRenderingContext2D();
virtual ~CanvasRenderingContext2D();
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap);
@ -495,7 +495,7 @@ public:
// nsISupports interface + CC
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsCanvasRenderingContext2DAzure,
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(CanvasRenderingContext2D,
nsIDOMCanvasRenderingContext2D)
// nsIDOMCanvasRenderingContext2D interface
@ -535,7 +535,7 @@ public:
}
}
friend class CanvasRenderingContext2DUserDataAzure;
friend class CanvasRenderingContext2DUserData;
protected:
nsresult GetImageDataArray(JSContext* aCx, int32_t aX, int32_t aY,
@ -572,12 +572,12 @@ protected:
void SetStyleFromJSValue(JSContext* cx, JS::Value& value, Style whichStyle);
void SetStyleFromString(const nsAString& str, Style whichStyle);
void SetStyleFromGradient(nsCanvasGradientAzure *gradient, Style whichStyle)
void SetStyleFromGradient(CanvasGradient *gradient, Style whichStyle)
{
CurrentState().SetGradientStyle(whichStyle, gradient);
}
void SetStyleFromPattern(nsCanvasPatternAzure *pattern, Style whichStyle)
void SetStyleFromPattern(CanvasPattern *pattern, Style whichStyle)
{
CurrentState().SetPatternStyle(whichStyle, pattern);
}
@ -704,7 +704,7 @@ protected:
// This is needed for drawing in drawAsyncXULElement
bool mIPC;
nsTArray<CanvasRenderingContext2DUserDataAzure*> mUserDatas;
nsTArray<CanvasRenderingContext2DUserData*> mUserDatas;
// If mCanvasElement is not provided, then a docshell is
nsCOMPtr<nsIDocShell> mDocShell;
@ -892,12 +892,12 @@ protected:
patternStyles[whichStyle] = nullptr;
}
void SetPatternStyle(Style whichStyle, nsCanvasPatternAzure* pat) {
void SetPatternStyle(Style whichStyle, CanvasPattern* pat) {
gradientStyles[whichStyle] = nullptr;
patternStyles[whichStyle] = pat;
}
void SetGradientStyle(Style whichStyle, nsCanvasGradientAzure* grad) {
void SetGradientStyle(Style whichStyle, CanvasGradient* grad) {
gradientStyles[whichStyle] = grad;
patternStyles[whichStyle] = nullptr;
}
@ -914,8 +914,8 @@ protected:
std::vector<mozilla::RefPtr<mozilla::gfx::Path> > clipsPushed;
nsRefPtr<gfxFontGroup> fontGroup;
nsRefPtr<nsCanvasGradientAzure> gradientStyles[STYLE_MAX];
nsRefPtr<nsCanvasPatternAzure> patternStyles[STYLE_MAX];
nsRefPtr<CanvasGradient> gradientStyles[STYLE_MAX];
nsRefPtr<CanvasPattern> patternStyles[STYLE_MAX];
nsString font;
TextAlign textAlign;
@ -972,7 +972,10 @@ protected:
*perCSSPixel = cssPixel;
}
friend struct nsCanvasBidiProcessorAzure;
friend struct CanvasBidiProcessor;
};
#endif /* nsCanvasRenderingContext2DAzure_h */
}
}
#endif /* CanvasRenderingContext2D_h */

Просмотреть файл

@ -33,7 +33,7 @@ EXPORTS_mozilla/dom = \
CPPSRCS = \
CanvasImageCache.cpp \
CanvasUtils.cpp \
nsCanvasRenderingContext2DAzure.cpp \
CanvasRenderingContext2D.cpp \
DocumentRendererParent.cpp \
DocumentRendererChild.cpp \
ImageData.cpp \

Просмотреть файл

@ -936,11 +936,3 @@ nsHTMLCanvasElement::RenderContextsExternal(gfxContext *aContext, gfxPattern::Gr
return mCurrentContext->Render(aContext, aFilter, aFlags);
}
nsresult NS_NewCanvasRenderingContext2DAzure(nsIDOMCanvasRenderingContext2D** aResult);
nsresult
NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult)
{
Telemetry::Accumulate(Telemetry::CANVAS_2D_USED, 1);
return NS_NewCanvasRenderingContext2DAzure(aResult);
}

Просмотреть файл

@ -109,7 +109,8 @@ DOMInterfaces = {
'CanvasRenderingContext2D': [
{
'nativeType': 'nsCanvasRenderingContext2DAzure',
'nativeType': 'mozilla::dom::CanvasRenderingContext2D',
'headerFile': 'CanvasRenderingContext2D.h',
'implicitJSContext': [
'createImageData', 'getImageData', 'putImageData', 'strokeStyle',
'fillStyle', 'mozDash'