Browse Source
- Bug 1187401 (Part 1) - Simplify the condition that determines whether we set RasterImage::mHasBeenDecoded. r=tn (69be36e7ef) - Bug 1187401 (Part 2) - Eliminate the nsresult return value from RasterImage::SetMetadata, since it's not used anymore. r=tn (dc521c4b9f) - Bug 1187401 (Part 3) - For consistency, call DoError if SetMetadata sees a negative size. r=tn (d9ca8ec91b) - Bug 1207183 - micro-optimize removing work items from DecodePool's queues; r=seth (6bd2717e3a) - No bug - Fix out-of-date comment in Decoder.cpp. r=me (54fdbbd444) - Bug 1181324 - Eliminate the duplicate mRefCnt member in MultipartImage. r=seth (c4512a443e) - Bug 1180105 - Do not leak the SourceSurface returned from imgIContainer::GetFrame in BlockUntilDecodedAndFinishObserving; r=seth (1cadbffc53) - Bug 1181909 - Fix potential null dereference in NextPartObserver. r=tn (cfd8ad0119) - Bug 108603 - Remove NS_IMPL_QUERY_INTERFACE_INHERITED0. r=mccr8, r=froydnj (4bfa6771fc) - Bug 1159502 - Don't block onload for multipart images. r=tn (8b50eadf39) - Bug 1200413 - Part 1: Re-write RefCountedInsideLambdaChecker to use captures instead of checking for DeclRef instances, r=ehsan (80ef99efe2) - Bug 1200413 - Part 2: Make lambdas in ProgressTracker.cpp capture strong references, r=seth (9e4d96dffa) - Bug 1194557 - Ensure that if the image was locked before RecoverFromLossOfFrames() was called, it's still locked afterwards. r=tn (ea4dc6ea9f) - code style (ad3773ba42) - Bug 1167590 - Mark imgRequestProxy::mListener as MOZ_UNSAFE_REF. r=seth (946ffaed8a) - Bug 1148397 - Fix data race on imgRequest::mHadInsecureRedirect. r=tanvi (e73d0664f3) - No bug - Tweak formatting of logging statement in imgRequest. r=me (cab2bcb014) - Bug 1180126 - Read content disposition regardless of content type in imgRequest::PrepareForNewPart. r=tn (2934597743) - Bug 1139225 - Followup - Remove duplicate multiPartChannel variable. (7f7f555a0b) - Bug 1141398 - Do not always revalidate image cache entries for file URIs. r=tn (31d73cb508) - Bug 1183563 - Fix incorrect mixed content warning after internal redirects. r=tanvi, r=seth (12a6c8a15f) - Bug 1150127 - Stop leaking windows via imgCacheValidator. r=baku (a7809c5fa7) - bits of Bug 1102048 (Part 20, imgLoader) (b2098c8a5a) - (No bug) - Correct blatantly lying comment in imgLoader.cpp. r=me DONTBUILD (64c42a5b09) - Bug 1160592 - Report image source size again in about:memory. r=dholbert (4e04cf3c3e) - Add an assertion for the first argument of NewImageChannel, no bug (4c8f087a8f) - Bug 1127534 - Remove assertion before creating a channel (r=sicking) (988692dc91) - Bug 1175371 - Make VectorImage wait to deliver LOAD_COMPLETE until its size is available. r=dholbert (3c81e0daff) - Bug 1181323 - Move nsSVGRenderingObserver's isupports/refcounting decl to subclasses, since one subclass (nsSVGFilterReference) already has its own redundant copy of the decl. r=dholbert (6171171c2c) - Bug 1161722 - If we're shutting down, don't warn about untracked unlocked surfaces. r=dholbert (f7e18ce481) - Bug 1170877 - Track how many times the SurfaceCache has overflowed and report it in about:memory. r=dholbert (884176cb1d) - Bug 1161743 - Upgrade 'WARNING: Not expiration-tracking an unlocked surface' to an assertion. r=dholbert (9900169e7b) - Bug 1167557 - Crash when a null surface is passed to SurfaceCache::Insert. r=dholbert (b3c4cf60aa) - remove bypass cache not fonud either in FF nor TF (3ed4056a27) - Missing bit Bug 1102048 (Part 25, header guards) - Make image/src files comply (cb8ed2428f) - No bug - Remove obsolete comment in SourceBuffer.h. r=me (6e9c233448) - coding style (94b7269690) - Bug 1157065 - GFX: 2D: Add Loongson3 MMI helpers. r=jrmuizel (ebce946c91) - reverto to FF52 and TFF settings (e147a8c7b5) - Bug 1134599 - Fix rpi build target. r=jrmuizel, r=shuang (b9722f860c) - Bug 1129147 - Part 1. Take CanvasPath into a separate file, to avoid circular dependency. r=roc (859bcad807) - Bug 1129147 - Part 2. Path option to addHitRegion. r=ehsan r=gw280 (b2ab08a8a1) - Bug 1206076: Use a specialized PersistentBufferProvider for Canvas2D when using a SkiaGL DrawTarget. r=jrmuizel (859589caf8) - Bug 1188752 - Addendum: Make PersistentBufferProviderBasic constructor explicit. r=bustage on a CLOSED TREE (a27a4dc974) - style (72a65dcb26) - Bug 1198574 - Remove unnecessary argument for PersistentBufferProvider. r=bas (dca718bba8) - Bug 1163124 - The initial value of the canvas filter property should be "none". r=roc (59df6a01d8)master
45 changed files with 748 additions and 274 deletions
@ -0,0 +1,91 @@
|
||||
/* 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 CanvasPath_h |
||||
#define CanvasPath_h |
||||
|
||||
#include "mozilla/Attributes.h" |
||||
#include "mozilla/RefPtr.h" |
||||
#include "nsWrapperCache.h" |
||||
#include "mozilla/gfx/2D.h" |
||||
#include "mozilla/dom/BindingDeclarations.h" |
||||
#include "mozilla/ErrorResult.h" |
||||
|
||||
namespace mozilla { |
||||
namespace dom { |
||||
|
||||
enum class CanvasWindingRule : uint32_t; |
||||
class SVGMatrix; |
||||
|
||||
class CanvasPath final : |
||||
public nsWrapperCache |
||||
{ |
||||
public: |
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPath) |
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPath) |
||||
|
||||
nsCOMPtr<nsISupports> GetParentObject() { return mParent; } |
||||
|
||||
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
||||
|
||||
static already_AddRefed<CanvasPath> Constructor(const GlobalObject& aGlobal, |
||||
ErrorResult& rv); |
||||
static already_AddRefed<CanvasPath> Constructor(const GlobalObject& aGlobal, |
||||
CanvasPath& aCanvasPath, |
||||
ErrorResult& rv); |
||||
static already_AddRefed<CanvasPath> Constructor(const GlobalObject& aGlobal, |
||||
const nsAString& aPathString, |
||||
ErrorResult& rv); |
||||
|
||||
void ClosePath(); |
||||
void MoveTo(double x, double y); |
||||
void LineTo(double x, double y); |
||||
void QuadraticCurveTo(double cpx, double cpy, double x, double y); |
||||
void BezierCurveTo(double cp1x, double cp1y, |
||||
double cp2x, double cp2y, |
||||
double x, double y); |
||||
void ArcTo(double x1, double y1, double x2, double y2, double radius, |
||||
ErrorResult& error); |
||||
void Rect(double x, double y, double w, double h); |
||||
void Arc(double x, double y, double radius, |
||||
double startAngle, double endAngle, bool anticlockwise, |
||||
ErrorResult& error); |
||||
void Ellipse(double x, double y, double radiusX, double radiusY, |
||||
double rotation, double startAngle, double endAngle, |
||||
bool anticlockwise, ErrorResult& error); |
||||
|
||||
void LineTo(const gfx::Point& aPoint); |
||||
void BezierTo(const gfx::Point& aCP1, |
||||
const gfx::Point& aCP2, |
||||
const gfx::Point& aCP3); |
||||
|
||||
already_AddRefed<gfx::Path> GetPath(const CanvasWindingRule& aWinding, |
||||
const gfx::DrawTarget* aTarget) const; |
||||
|
||||
explicit CanvasPath(nsISupports* aParent); |
||||
// already_AddRefed arg because the return value from Path::CopyToBuilder()
|
||||
// is passed directly and we can't drop the only ref to have a raw pointer.
|
||||
CanvasPath(nsISupports* aParent, |
||||
already_AddRefed<gfx::PathBuilder> aPathBuilder); |
||||
|
||||
void AddPath(CanvasPath& aCanvasPath, |
||||
const Optional<NonNull<SVGMatrix>>& aMatrix); |
||||
|
||||
private: |
||||
virtual ~CanvasPath() {} |
||||
|
||||
nsCOMPtr<nsISupports> mParent; |
||||
static gfx::Float ToFloat(double aValue) { return gfx::Float(aValue); } |
||||
|
||||
mutable RefPtr<gfx::Path> mPath; |
||||
mutable RefPtr<gfx::PathBuilder> mPathBuilder; |
||||
|
||||
void EnsurePathBuilder() const; |
||||
}; |
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* CanvasPath_h */ |
||||
|
@ -0,0 +1,196 @@
|
||||
/*
|
||||
============================================================================ |
||||
Name : MMIHelpers.h |
||||
Author : Heiher <r@hev.cc> |
||||
Version : 0.0.1 |
||||
Copyright : Copyright (c) 2015 everyone. |
||||
Description : The helpers for x86 SSE to Loongson MMI. |
||||
============================================================================ |
||||
*/ |
||||
|
||||
#ifndef __MMI_HELPERS_H__ |
||||
#define __MMI_HELPERS_H__ |
||||
|
||||
#define __mm_packxxxx(_f, _D, _d, _s, _t) \ |
||||
#_f" %["#_t"], %["#_d"h], %["#_s"h] \n\t" \ |
||||
#_f" %["#_D"l], %["#_d"l], %["#_s"l] \n\t" \ |
||||
"punpckhwd %["#_D"h], %["#_D"l], %["#_t"] \n\t" \
|
||||
"punpcklwd %["#_D"l], %["#_D"l], %["#_t"] \n\t" |
||||
|
||||
#define _mm_or(_D, _d, _s) \ |
||||
"or %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"or %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
#define _mm_xor(_D, _d, _s) \ |
||||
"xor %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"xor %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
#define _mm_and(_D, _d, _s) \ |
||||
"and %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"and %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: pandn */ |
||||
#define _mm_pandn(_D, _d, _s) \ |
||||
"pandn %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"pandn %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: pshuflw */ |
||||
#define _mm_pshuflh(_D, _d, _s) \ |
||||
"mov.d %["#_D"h], %["#_d"h] \n\t" \
|
||||
"pshufh %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: psllw (bits) */ |
||||
#define _mm_psllh(_D, _d, _s) \ |
||||
"psllh %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"psllh %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: pslld (bits) */ |
||||
#define _mm_psllw(_D, _d, _s) \ |
||||
"psllw %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"psllw %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: psllq (bits) */ |
||||
#define _mm_pslld(_D, _d, _s) \ |
||||
"dsll %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"dsll %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: pslldq (bytes) */ |
||||
#define _mm_psllq(_D, _d, _s, _s64, _tf) \ |
||||
"subu %["#_tf"], %["#_s64"], %["#_s"] \n\t" \
|
||||
"dsrl %["#_tf"], %["#_d"l], %["#_tf"] \n\t" \
|
||||
"dsll %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"dsll %["#_D"l], %["#_d"l], %["#_s"] \n\t" \
|
||||
"or %["#_D"h], %["#_D"h], %["#_tf"] \n\t" |
||||
|
||||
/* SSE: psrlw (bits) */ |
||||
#define _mm_psrlh(_D, _d, _s) \ |
||||
"psrlh %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"psrlh %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: psrld (bits) */ |
||||
#define _mm_psrlw(_D, _d, _s) \ |
||||
"psrlw %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"psrlw %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: psrlq (bits) */ |
||||
#define _mm_psrld(_D, _d, _s) \ |
||||
"dsrl %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"dsrl %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: psrldq (bytes) */ |
||||
#define _mm_psrlq(_D, _d, _s, _s64, _tf) \ |
||||
"subu %["#_tf"], %["#_s64"], %["#_s"] \n\t" \
|
||||
"dsll %["#_tf"], %["#_d"h], %["#_tf"] \n\t" \
|
||||
"dsrl %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"dsrl %["#_D"l], %["#_d"l], %["#_s"] \n\t" \
|
||||
"or %["#_D"l], %["#_D"l], %["#_tf"] \n\t" |
||||
|
||||
/* SSE: psrad */ |
||||
#define _mm_psraw(_D, _d, _s) \ |
||||
"psraw %["#_D"h], %["#_d"h], %["#_s"] \n\t" \
|
||||
"psraw %["#_D"l], %["#_d"l], %["#_s"] \n\t" |
||||
|
||||
/* SSE: paddb */ |
||||
#define _mm_paddb(_D, _d, _s) \ |
||||
"paddb %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"paddb %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: paddw */ |
||||
#define _mm_paddh(_D, _d, _s) \ |
||||
"paddh %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"paddh %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: paddd */ |
||||
#define _mm_paddw(_D, _d, _s) \ |
||||
"paddw %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"paddw %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: paddq */ |
||||
#define _mm_paddd(_D, _d, _s) \ |
||||
"dadd %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"dadd %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: psubw */ |
||||
#define _mm_psubh(_D, _d, _s) \ |
||||
"psubh %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"psubh %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: psubd */ |
||||
#define _mm_psubw(_D, _d, _s) \ |
||||
"psubw %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"psubw %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: pmaxub */ |
||||
#define _mm_pmaxub(_D, _d, _s) \ |
||||
"pmaxub %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"pmaxub %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: pmullw */ |
||||
#define _mm_pmullh(_D, _d, _s) \ |
||||
"pmullh %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"pmullh %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: pmulhw */ |
||||
#define _mm_pmulhh(_D, _d, _s) \ |
||||
"pmulhh %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"pmulhh %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: pmuludq */ |
||||
#define _mm_pmuluw(_D, _d, _s) \ |
||||
"pmuluw %["#_D"h], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"pmuluw %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: packsswb */ |
||||
#define _mm_packsshb(_D, _d, _s, _t) \ |
||||
__mm_packxxxx(packsshb, _D, _d, _s, _t) |
||||
|
||||
/* SSE: packssdw */ |
||||
#define _mm_packsswh(_D, _d, _s, _t) \ |
||||
__mm_packxxxx(packsswh, _D, _d, _s, _t) |
||||
|
||||
/* SSE: packuswb */ |
||||
#define _mm_packushb(_D, _d, _s, _t) \ |
||||
__mm_packxxxx(packushb, _D, _d, _s, _t) |
||||
|
||||
/* SSE: punpcklbw */ |
||||
#define _mm_punpcklbh(_D, _d, _s) \ |
||||
"punpckhbh %["#_D"h], %["#_d"l], %["#_s"l] \n\t" \
|
||||
"punpcklbh %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: punpcklwd */ |
||||
#define _mm_punpcklhw(_D, _d, _s) \ |
||||
"punpckhhw %["#_D"h], %["#_d"l], %["#_s"l] \n\t" \
|
||||
"punpcklhw %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: punpckldq */ |
||||
#define _mm_punpcklwd(_D, _d, _s) \ |
||||
"punpckhwd %["#_D"h], %["#_d"l], %["#_s"l] \n\t" \
|
||||
"punpcklwd %["#_D"l], %["#_d"l], %["#_s"l] \n\t" |
||||
|
||||
/* SSE: punpcklqdq */ |
||||
#define _mm_punpckldq(_D, _d, _s) \ |
||||
"mov.d %["#_D"h], %["#_s"l] \n\t" \
|
||||
"mov.d %["#_D"l], %["#_d"l] \n\t" |
||||
|
||||
/* SSE: punpckhbw */ |
||||
#define _mm_punpckhbh(_D, _d, _s) \ |
||||
"punpcklbh %["#_D"l], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"punpckhbh %["#_D"h], %["#_d"h], %["#_s"h] \n\t" |
||||
|
||||
/* SSE: punpckhwd */ |
||||
#define _mm_punpckhhw(_D, _d, _s) \ |
||||
"punpcklhw %["#_D"l], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"punpckhhw %["#_D"h], %["#_d"h], %["#_s"h] \n\t" |
||||
|
||||
/* SSE: punpckhdq */ |
||||
#define _mm_punpckhwd(_D, _d, _s) \ |
||||
"punpcklwd %["#_D"l], %["#_d"h], %["#_s"h] \n\t" \
|
||||
"punpckhwd %["#_D"h], %["#_d"h], %["#_s"h] \n\t" |
||||
|
||||
/* SSE: punpckhqdq */ |
||||
#define _mm_punpckhdq(_D, _d, _s) \ |
||||
"mov.d %["#_D"l], %["#_d"h] \n\t" \
|
||||
"mov.d %["#_D"h], %["#_s"h] \n\t" |
||||
|
||||
#endif /* __MMI_HELPERS_H__ */ |
||||
|