Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / canvas / CanvasPattern.h
blobf87ae8d5dd8b87f00bd9fd0a7ebd4044d462ed95
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_dom_CanvasPattern_h
6 #define mozilla_dom_CanvasPattern_h
8 #include "mozilla/Attributes.h"
9 #include "mozilla/dom/CanvasRenderingContext2DBinding.h"
10 #include "mozilla/dom/CanvasRenderingContext2D.h"
11 #include "mozilla/RefPtr.h"
12 #include "nsISupports.h"
13 #include "nsWrapperCache.h"
15 class nsIPrincipal;
17 namespace mozilla {
18 namespace gfx {
19 class SourceSurface;
22 namespace dom {
23 class SVGMatrix;
25 class CanvasPattern MOZ_FINAL : public nsWrapperCache
27 ~CanvasPattern() {}
28 public:
29 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPattern)
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPattern)
32 MOZ_BEGIN_NESTED_ENUM_CLASS(RepeatMode, uint8_t)
33 REPEAT,
34 REPEATX,
35 REPEATY,
36 NOREPEAT
37 MOZ_END_NESTED_ENUM_CLASS(RepeatMode)
39 CanvasPattern(CanvasRenderingContext2D* aContext,
40 gfx::SourceSurface* aSurface,
41 RepeatMode aRepeat,
42 nsIPrincipal* principalForSecurityCheck,
43 bool forceWriteOnly,
44 bool CORSUsed)
45 : mContext(aContext)
46 , mSurface(aSurface)
47 , mPrincipal(principalForSecurityCheck)
48 , mTransform()
49 , mForceWriteOnly(forceWriteOnly)
50 , mCORSUsed(CORSUsed)
51 , mRepeat(aRepeat)
53 SetIsDOMBinding();
56 JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
58 return CanvasPatternBinding::Wrap(aCx, this);
61 CanvasRenderingContext2D* GetParentObject()
63 return mContext;
66 // WebIDL
67 void SetTransform(SVGMatrix& matrix);
69 nsRefPtr<CanvasRenderingContext2D> mContext;
70 RefPtr<gfx::SourceSurface> mSurface;
71 nsCOMPtr<nsIPrincipal> mPrincipal;
72 mozilla::gfx::Matrix mTransform;
73 const bool mForceWriteOnly;
74 const bool mCORSUsed;
75 const RepeatMode mRepeat;
78 MOZ_FINISH_NESTED_ENUM_CLASS(CanvasPattern::RepeatMode)
83 #endif // mozilla_dom_CanvasPattern_h