diff --git a/browser/metro/base/content/helperui/MenuUI.js b/browser/metro/base/content/helperui/MenuUI.js index a937544b9cbd..74012e3cf5e2 100644 --- a/browser/metro/base/content/helperui/MenuUI.js +++ b/browser/metro/base/content/helperui/MenuUI.js @@ -352,6 +352,7 @@ MenuPopup.prototype = { window.addEventListener("keypress", this, true); window.addEventListener("mousedown", this, true); Elements.stack.addEventListener("PopupChanged", this, false); + Elements.browsers.addEventListener("PanBegin", this, false); this._panel.hidden = false; this._position(aPositionOptions || {}); @@ -382,6 +383,7 @@ MenuPopup.prototype = { window.removeEventListener("keypress", this, true); window.removeEventListener("mousedown", this, true); Elements.stack.removeEventListener("PopupChanged", this, false); + Elements.browsers.removeEventListener("PanBegin", this, false); let self = this; this._panel.addEventListener("transitionend", function () { @@ -497,6 +499,9 @@ MenuPopup.prototype = { this.hide(); } break; + case "PanBegin": + this.hide(); + break; } } }; diff --git a/config/system-headers b/config/system-headers index 7cf7c67e1f57..1035130f6a7a 100644 --- a/config/system-headers +++ b/config/system-headers @@ -1128,3 +1128,5 @@ sys/thr.h sys/user.h kvm.h spawn.h +err.h +xlocale.h diff --git a/content/base/public/nsIXMLHttpRequest.idl b/content/base/public/nsIXMLHttpRequest.idl index 42271d0360f8..139493301d3e 100644 --- a/content/base/public/nsIXMLHttpRequest.idl +++ b/content/base/public/nsIXMLHttpRequest.idl @@ -21,7 +21,7 @@ interface nsIDOMBlob; #include "jsapi.h" %} -[scriptable, builtinclass, uuid(5bc978f2-41e5-4349-a12d-b018092271f7)] +[scriptable, builtinclass, uuid(ac97e161-9f1d-4163-adc9-e9a59e18682c)] interface nsIXMLHttpRequestEventTarget : nsIDOMEventTarget { // event handler attributes [implicit_jscontext] attribute jsval onabort; @@ -133,7 +133,7 @@ interface nsIXMLHttpRequest : nsISupports * The string representing the status of the response for * HTTP requests. */ - readonly attribute DOMString statusText; + readonly attribute ACString statusText; /** * If the request has been sent already, this method will @@ -148,7 +148,7 @@ interface nsIXMLHttpRequest : nsISupports * @returns A string containing all of the response headers. * The empty string if the response has not yet been received. */ - DOMString getAllResponseHeaders(); + ACString getAllResponseHeaders(); /** * Returns the text of the header with the specified name for @@ -159,7 +159,7 @@ interface nsIXMLHttpRequest : nsISupports * NULL if the response has not yet been received or the * header does not exist in the response. */ - ACString getResponseHeader(in AUTF8String header); + ACString getResponseHeader(in ACString header); %{C++ // note this is NOT virtual so this won't muck with the vtable! @@ -189,7 +189,7 @@ interface nsIXMLHttpRequest : nsISupports * @param password (optional) A password for authentication if necessary. * The default value is the empty string */ - [optional_argc] void open(in AUTF8String method, in AUTF8String url, + [optional_argc] void open(in ACString method, in AUTF8String url, [optional] in boolean async, [optional,Undefined(Empty)] in DOMString user, [optional,Undefined(Empty)] in DOMString password); @@ -237,7 +237,7 @@ interface nsIXMLHttpRequest : nsISupports * @param header The name of the header to set in the request. * @param value The body of the header. */ - void setRequestHeader(in AUTF8String header, in AUTF8String value); + void setRequestHeader(in ACString header, in ACString value); /** * The amount of milliseconds a request can take before being terminated. diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 45fd22b2e58b..b9522c9151a8 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -139,11 +139,11 @@ using namespace mozilla::dom; #define NS_PROGRESS_EVENT_INTERVAL 50 -#define IMPL_STRING_GETTER(_name) \ +#define IMPL_CSTRING_GETTER(_name) \ NS_IMETHODIMP \ - nsXMLHttpRequest::_name(nsAString& aOut) \ + nsXMLHttpRequest::_name(nsACString& aOut) \ { \ - nsString tmp; \ + nsCString tmp; \ _name(tmp); \ aOut = tmp; \ return NS_OK; \ @@ -1128,9 +1128,9 @@ nsXMLHttpRequest::Status() return status; } -IMPL_STRING_GETTER(GetStatusText) +IMPL_CSTRING_GETTER(GetStatusText) void -nsXMLHttpRequest::GetStatusText(nsString& aStatusText) +nsXMLHttpRequest::GetStatusText(nsCString& aStatusText) { nsCOMPtr httpChannel = GetCurrentHttpChannel(); @@ -1152,17 +1152,8 @@ nsXMLHttpRequest::GetStatusText(nsString& aStatusText) } } - nsCString statusText; - httpChannel->GetResponseStatusText(statusText); - if (statusText.IsVoid()) { - aStatusText.SetIsVoid(true); - } else { - // We use UTF8ToNewUnicode here because it truncates after invalid UTF-8 - // characters, CopyUTF8toUTF16 just doesn't copy in that case. - uint32_t length; - PRUnichar* chars = UTF8ToNewUnicode(statusText, &length); - aStatusText.Adopt(chars, length); - } + httpChannel->GetResponseStatusText(aStatusText); + } void @@ -1286,10 +1277,10 @@ nsXMLHttpRequest::IsSafeHeader(const nsACString& header, nsIHttpChannel* httpCha return isSafe; } -/* DOMString getAllResponseHeaders(); */ -IMPL_STRING_GETTER(GetAllResponseHeaders) +/* ByteString getAllResponseHeaders(); */ +IMPL_CSTRING_GETTER(GetAllResponseHeaders) void -nsXMLHttpRequest::GetAllResponseHeaders(nsString& aResponseHeaders) +nsXMLHttpRequest::GetAllResponseHeaders(nsCString& aResponseHeaders) { aResponseHeaders.Truncate(); @@ -1303,7 +1294,7 @@ nsXMLHttpRequest::GetAllResponseHeaders(nsString& aResponseHeaders) if (nsCOMPtr httpChannel = GetCurrentHttpChannel()) { nsRefPtr visitor = new nsHeaderVisitor(this, httpChannel); if (NS_SUCCEEDED(httpChannel->VisitResponseHeaders(visitor))) { - CopyASCIItoUTF16(visitor->Headers(), aResponseHeaders); + aResponseHeaders = visitor->Headers(); } return; } @@ -1316,10 +1307,10 @@ nsXMLHttpRequest::GetAllResponseHeaders(nsString& aResponseHeaders) nsAutoCString value; if (NS_SUCCEEDED(mChannel->GetContentType(value))) { aResponseHeaders.AppendLiteral("Content-Type: "); - AppendASCIItoUTF16(value, aResponseHeaders); + aResponseHeaders.Append(value); if (NS_SUCCEEDED(mChannel->GetContentCharset(value)) && !value.IsEmpty()) { aResponseHeaders.AppendLiteral(";charset="); - AppendASCIItoUTF16(value, aResponseHeaders); + aResponseHeaders.Append(value); } aResponseHeaders.AppendLiteral("\r\n"); } @@ -2950,7 +2941,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable& aBody) return rv; } -/* void setRequestHeader (in AUTF8String header, in AUTF8String value); */ +/* void setRequestHeader (in ByteString header, in ByteString value); */ // http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader NS_IMETHODIMP nsXMLHttpRequest::SetRequestHeader(const nsACString& header, diff --git a/content/base/src/nsXMLHttpRequest.h b/content/base/src/nsXMLHttpRequest.h index 35833522f655..0cf38e57d67c 100644 --- a/content/base/src/nsXMLHttpRequest.h +++ b/content/base/src/nsXMLHttpRequest.h @@ -242,19 +242,18 @@ public: uint16_t ReadyState(); // request - void Open(const nsAString& aMethod, const nsAString& aUrl, bool aAsync, + void Open(const nsACString& aMethod, const nsAString& aUrl, bool aAsync, const mozilla::dom::Optional& aUser, const mozilla::dom::Optional& aPassword, ErrorResult& aRv) { - aRv = Open(NS_ConvertUTF16toUTF8(aMethod), NS_ConvertUTF16toUTF8(aUrl), + aRv = Open(aMethod, NS_ConvertUTF16toUTF8(aUrl), aAsync, aUser, aPassword); } - void SetRequestHeader(const nsAString& aHeader, const nsAString& aValue, + void SetRequestHeader(const nsACString& aHeader, const nsACString& aValue, ErrorResult& aRv) { - aRv = SetRequestHeader(NS_ConvertUTF16toUTF8(aHeader), - NS_ConvertUTF16toUTF8(aValue)); + aRv = SetRequestHeader(aHeader, aValue); } uint32_t Timeout() { @@ -400,7 +399,7 @@ public: // response uint32_t Status(); - void GetStatusText(nsString& aStatusText); + void GetStatusText(nsCString& aStatusText); void GetResponseHeader(const nsACString& aHeader, nsACString& aResult, ErrorResult& aRv); void GetResponseHeader(const nsAString& aHeader, nsString& aResult, @@ -416,7 +415,7 @@ public: CopyASCIItoUTF16(result, aResult); } } - void GetAllResponseHeaders(nsString& aResponseHeaders); + void GetAllResponseHeaders(nsCString& aResponseHeaders); bool IsSafeHeader(const nsACString& aHeaderName, nsIHttpChannel* aHttpChannel); void OverrideMimeType(const nsAString& aMimeType) { diff --git a/content/base/test/test_bug638112.html b/content/base/test/test_bug638112.html index b6be27dae90d..4f6741ed04cb 100644 --- a/content/base/test/test_bug638112.html +++ b/content/base/test/test_bug638112.html @@ -2,6 +2,7 @@ Test for Bug 638112 @@ -10,15 +11,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=638112 Mozilla Bug 638112 +Mozilla Bug 796850

 
+  
+
+
+Mozilla Bug 796850
+

+
+
+
+ + diff --git a/dom/webidl/XMLHttpRequest.webidl b/dom/webidl/XMLHttpRequest.webidl index e3a09983f65c..d5e4459b5b0a 100644 --- a/dom/webidl/XMLHttpRequest.webidl +++ b/dom/webidl/XMLHttpRequest.webidl @@ -71,10 +71,10 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { // request [Throws] - void open(DOMString method, DOMString url, optional boolean async = true, + void open(ByteString method, DOMString url, optional boolean async = true, optional DOMString? user, optional DOMString? password); [Throws] - void setRequestHeader(DOMString header, DOMString value); + void setRequestHeader(ByteString header, ByteString value); [SetterThrows] attribute unsigned long timeout; @@ -109,12 +109,12 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { [Throws=Workers] readonly attribute unsigned short status; - readonly attribute DOMString statusText; + readonly attribute ByteString statusText; [Throws] - DOMString? getResponseHeader(DOMString header); + ByteString? getResponseHeader(ByteString header); [Throws=Workers] - DOMString getAllResponseHeaders(); + ByteString getAllResponseHeaders(); [Throws=Workers] void overrideMimeType(DOMString mime); diff --git a/dom/workers/XMLHttpRequest.cpp b/dom/workers/XMLHttpRequest.cpp index 63c5f5a4d663..9299cadad7e2 100644 --- a/dom/workers/XMLHttpRequest.cpp +++ b/dom/workers/XMLHttpRequest.cpp @@ -523,7 +523,7 @@ class EventRunnable : public MainThreadProxyRunnable nsTArray > mClonedObjects; jsval mResponse; nsString mResponseText; - nsString mStatusText; + nsCString mStatusText; uint64_t mLoaded; uint64_t mTotal; uint32_t mEventStreamId; @@ -970,11 +970,11 @@ public: class GetAllResponseHeadersRunnable : public WorkerThreadProxySyncRunnable { - nsString& mResponseHeaders; + nsCString& mResponseHeaders; public: GetAllResponseHeadersRunnable(WorkerPrivate* aWorkerPrivate, Proxy* aProxy, - nsString& aResponseHeaders) + nsCString& aResponseHeaders) : WorkerThreadProxySyncRunnable(aWorkerPrivate, aProxy), mResponseHeaders(aResponseHeaders) { } @@ -994,7 +994,7 @@ class GetResponseHeaderRunnable : public WorkerThreadProxySyncRunnable public: GetResponseHeaderRunnable(WorkerPrivate* aWorkerPrivate, Proxy* aProxy, - const nsCString& aHeader, nsCString& aValue) + const nsACString& aHeader, nsCString& aValue) : WorkerThreadProxySyncRunnable(aWorkerPrivate, aProxy), mHeader(aHeader), mValue(aValue) { } @@ -1008,7 +1008,7 @@ public: class OpenRunnable : public WorkerThreadProxySyncRunnable { - nsString mMethod; + nsCString mMethod; nsString mURL; Optional mUser; nsString mUserStr; @@ -1020,7 +1020,7 @@ class OpenRunnable : public WorkerThreadProxySyncRunnable public: OpenRunnable(WorkerPrivate* aWorkerPrivate, Proxy* aProxy, - const nsAString& aMethod, const nsAString& aURL, + const nsACString& aMethod, const nsAString& aURL, const Optional& aUser, const Optional& aPassword, bool aBackgroundRequest, bool aWithCredentials, @@ -1201,7 +1201,7 @@ class SetRequestHeaderRunnable : public WorkerThreadProxySyncRunnable public: SetRequestHeaderRunnable(WorkerPrivate* aWorkerPrivate, Proxy* aProxy, - const nsCString& aHeader, const nsCString& aValue) + const nsACString& aHeader, const nsACString& aValue) : WorkerThreadProxySyncRunnable(aWorkerPrivate, aProxy), mHeader(aHeader), mValue(aValue) { } @@ -1716,7 +1716,7 @@ XMLHttpRequest::Notify(JSContext* aCx, Status aStatus) } void -XMLHttpRequest::Open(const nsAString& aMethod, const nsAString& aUrl, +XMLHttpRequest::Open(const nsACString& aMethod, const nsAString& aUrl, bool aAsync, const Optional& aUser, const Optional& aPassword, ErrorResult& aRv) { @@ -1754,8 +1754,8 @@ XMLHttpRequest::Open(const nsAString& aMethod, const nsAString& aUrl, } void -XMLHttpRequest::SetRequestHeader(const nsAString& aHeader, - const nsAString& aValue, ErrorResult& aRv) +XMLHttpRequest::SetRequestHeader(const nsACString& aHeader, + const nsACString& aValue, ErrorResult& aRv) { mWorkerPrivate->AssertIsOnWorkerThread(); @@ -1770,9 +1770,7 @@ XMLHttpRequest::SetRequestHeader(const nsAString& aHeader, } nsRefPtr runnable = - new SetRequestHeaderRunnable(mWorkerPrivate, mProxy, - NS_ConvertUTF16toUTF8(aHeader), - NS_ConvertUTF16toUTF8(aValue)); + new SetRequestHeaderRunnable(mWorkerPrivate, mProxy, aHeader, aValue); if (!runnable->Dispatch(GetJSContext())) { aRv.Throw(NS_ERROR_FAILURE); return; @@ -2012,8 +2010,8 @@ XMLHttpRequest::Abort(ErrorResult& aRv) } void -XMLHttpRequest::GetResponseHeader(const nsAString& aHeader, - nsAString& aResponseHeader, ErrorResult& aRv) +XMLHttpRequest::GetResponseHeader(const nsACString& aHeader, + nsACString& aResponseHeader, ErrorResult& aRv) { mWorkerPrivate->AssertIsOnWorkerThread(); @@ -2027,20 +2025,19 @@ XMLHttpRequest::GetResponseHeader(const nsAString& aHeader, return; } - nsCString value; + nsCString responseHeader; nsRefPtr runnable = - new GetResponseHeaderRunnable(mWorkerPrivate, mProxy, - NS_ConvertUTF16toUTF8(aHeader), value); + new GetResponseHeaderRunnable(mWorkerPrivate, mProxy, aHeader, + responseHeader); if (!runnable->Dispatch(GetJSContext())) { aRv.Throw(NS_ERROR_FAILURE); return; } - - aResponseHeader = NS_ConvertUTF8toUTF16(value); + aResponseHeader = responseHeader; } void -XMLHttpRequest::GetAllResponseHeaders(nsAString& aResponseHeaders, +XMLHttpRequest::GetAllResponseHeaders(nsACString& aResponseHeaders, ErrorResult& aRv) { mWorkerPrivate->AssertIsOnWorkerThread(); @@ -2055,7 +2052,7 @@ XMLHttpRequest::GetAllResponseHeaders(nsAString& aResponseHeaders, return; } - nsString responseHeaders; + nsCString responseHeaders; nsRefPtr runnable = new GetAllResponseHeadersRunnable(mWorkerPrivate, mProxy, responseHeaders); if (!runnable->Dispatch(GetJSContext())) { diff --git a/dom/workers/XMLHttpRequest.h b/dom/workers/XMLHttpRequest.h index b5b575aab767..1ce15261e4d9 100644 --- a/dom/workers/XMLHttpRequest.h +++ b/dom/workers/XMLHttpRequest.h @@ -29,7 +29,7 @@ public: { nsString mResponseText; uint32_t mStatus; - nsString mStatusText; + nsCString mStatusText; uint16_t mReadyState; jsval mResponse; nsresult mResponseTextResult; @@ -122,12 +122,12 @@ public: } void - Open(const nsAString& aMethod, const nsAString& aUrl, bool aAsync, + Open(const nsACString& aMethod, const nsAString& aUrl, bool aAsync, const Optional& aUser, const Optional& aPassword, ErrorResult& aRv); void - SetRequestHeader(const nsAString& aHeader, const nsAString& aValue, + SetRequestHeader(const nsACString& aHeader, const nsACString& aValue, ErrorResult& aRv); uint32_t @@ -199,17 +199,17 @@ public: } void - GetStatusText(nsAString& aStatusText) const + GetStatusText(nsACString& aStatusText) const { aStatusText = mStateData.mStatusText; } void - GetResponseHeader(const nsAString& aHeader, nsAString& aResponseHeader, + GetResponseHeader(const nsACString& aHeader, nsACString& aResponseHeader, ErrorResult& aRv); void - GetAllResponseHeaders(nsAString& aResponseHeaders, ErrorResult& aRv); + GetAllResponseHeaders(nsACString& aResponseHeaders, ErrorResult& aRv); void OverrideMimeType(const nsAString& aMimeType, ErrorResult& aRv); diff --git a/image/src/VectorImage.cpp b/image/src/VectorImage.cpp index 26c60135ad45..46849453a556 100644 --- a/image/src/VectorImage.cpp +++ b/image/src/VectorImage.cpp @@ -690,29 +690,50 @@ VectorImage::Draw(gfxContext* aContext, AutoSVGRenderingState autoSVGState(aSVGContext, time, mSVGDocumentWrapper->GetRootSVGElem()); - mSVGDocumentWrapper->UpdateViewportBounds(aViewportSize); + + // gfxUtils::DrawPixelSnapped may rasterize this image to a temporary surface + // if we hit the tiling path. Unfortunately, the temporary surface isn't + // created at the size at which we'll ultimately draw, causing fuzzy output. + // To fix this we pre-apply the transform's scaling to the drawing parameters + // and then remove the scaling from the transform, so the fact that temporary + // surfaces won't take the scaling into account doesn't matter. (Bug 600207.) + gfxSize scale(aUserSpaceToImageSpace.ScaleFactors(true)); + gfxPoint translation(aUserSpaceToImageSpace.GetTranslation()); + + // Rescale everything. + nsIntSize scaledViewport(aViewportSize.width / scale.width, + aViewportSize.height / scale.height); + gfxIntSize scaledViewportGfx(scaledViewport.width, scaledViewport.height); + nsIntRect scaledSubimage(aSubimage); + scaledSubimage.ScaleRoundOut(1.0 / scale.width, 1.0 / scale.height); + + // Remove the scaling from the transform. + gfxMatrix unscale; + unscale.Translate(gfxPoint(translation.x / scale.width, + translation.y / scale.height)); + unscale.Scale(1.0 / scale.width, 1.0 / scale.height); + unscale.Translate(-translation); + gfxMatrix unscaledTransform(aUserSpaceToImageSpace * unscale); + + mSVGDocumentWrapper->UpdateViewportBounds(scaledViewport); mSVGDocumentWrapper->FlushImageTransformInvalidation(); - // XXXdholbert Do we need to convert image size from - // CSS pixels to dev pixels here? (is gfxCallbackDrawable's 2nd arg in dev - // pixels?) - gfxIntSize imageSizeGfx(aViewportSize.width, aViewportSize.height); - // Based on imgFrame::Draw - gfxRect sourceRect = aUserSpaceToImageSpace.Transform(aFill); - gfxRect imageRect(0, 0, aViewportSize.width, aViewportSize.height); - gfxRect subimage(aSubimage.x, aSubimage.y, aSubimage.width, aSubimage.height); + gfxRect sourceRect = unscaledTransform.Transform(aFill); + gfxRect imageRect(0, 0, scaledViewport.width, scaledViewport.height); + gfxRect subimage(scaledSubimage.x, scaledSubimage.y, + scaledSubimage.width, scaledSubimage.height); nsRefPtr cb = new SVGDrawingCallback(mSVGDocumentWrapper, - nsIntRect(nsIntPoint(0, 0), aViewportSize), + nsIntRect(nsIntPoint(0, 0), scaledViewport), aFlags); - nsRefPtr drawable = new gfxCallbackDrawable(cb, imageSizeGfx); + nsRefPtr drawable = new gfxCallbackDrawable(cb, scaledViewportGfx); gfxUtils::DrawPixelSnapped(aContext, drawable, - aUserSpaceToImageSpace, + unscaledTransform, subimage, sourceRect, imageRect, aFill, gfxASurface::ImageFormatARGB32, aFilter, aFlags); diff --git a/js/src/config/system-headers b/js/src/config/system-headers index 7cf7c67e1f57..1035130f6a7a 100644 --- a/js/src/config/system-headers +++ b/js/src/config/system-headers @@ -1128,3 +1128,5 @@ sys/thr.h sys/user.h kvm.h spawn.h +err.h +xlocale.h diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index 7197bc978e49..43f198fd04f3 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -3991,7 +3991,7 @@ CheckDivOrMod(FunctionCompiler &f, ParseNode *expr, MDefinition **def, Type *typ return true; } - return f.failf(expr, "arguments to / or &% must both be double, signed, or unsigned, " + return f.failf(expr, "arguments to / or %% must both be double, signed, or unsigned; " "%s and %s are given", lhsType.toChars(), rhsType.toChars()); } @@ -4025,7 +4025,7 @@ CheckComparison(FunctionCompiler &f, ParseNode *comp, MDefinition **def, Type *t return true; } - return f.failf(comp, "arguments to a comparison must both be signed, unsigned or doubles, " + return f.failf(comp, "arguments to a comparison must both be signed, unsigned or doubles; " "%s and %s are given", lhsType.toChars(), rhsType.toChars()); } diff --git a/js/xpconnect/src/xpcpublic.h b/js/xpconnect/src/xpcpublic.h index 5c04f36dc885..1ce3db287c84 100644 --- a/js/xpconnect/src/xpcpublic.h +++ b/js/xpconnect/src/xpcpublic.h @@ -479,8 +479,14 @@ typedef JSObject* typedef JSObject* (*ConstructNavigatorProperty)(JSContext *cx, JS::Handle naviObj); +// Check whether a constructor should be enabled for the given object. +// Note that the object should NOT be an Xray, since Xrays will end up +// defining constructors on the underlying object. +// This is a typedef for the function type itself, not the function +// pointer, so it's more obvious that pointers to a ConstructorEnabled +// can be null. typedef bool -(*PrefEnabled)(); +(ConstructorEnabled)(JSContext* cx, JS::Handle obj); extern bool DefineStaticJSVals(JSContext *cx); diff --git a/layout/reftests/backgrounds/vector/empty/reftest.list b/layout/reftests/backgrounds/vector/empty/reftest.list index a7be83c99053..1a7af876cdca 100644 --- a/layout/reftests/backgrounds/vector/empty/reftest.list +++ b/layout/reftests/backgrounds/vector/empty/reftest.list @@ -2,17 +2,10 @@ == tall--contain--width.html ref-tall-empty.html == wide--contain--height.html ref-wide-empty.html == wide--contain--width.html ref-wide-empty.html - -# We don't really care about the failures for this -# extreme edge case (the test exists more to test for safety against division by -# zero), so there is no bug has been filed to fix it, although a patch would -# probably be accepted. -# They're still marked as failing though, rather than 'load', since -# we want to know if they start working when we upgrade to Azure. -fails == tall--cover--height.html ref-tall-lime.html -fails == tall--cover--width.html ref-tall-lime.html -fails == wide--cover--height.html ref-wide-lime.html -fails == wide--cover--width.html ref-wide-lime.html +== tall--cover--height.html ref-tall-lime.html +== tall--cover--width.html ref-tall-lime.html +== wide--cover--height.html ref-wide-lime.html +== wide--cover--width.html ref-wide-lime.html == zero-height-ratio-contain.html ref-tall-empty.html == zero-height-ratio-cover.html ref-tall-empty.html diff --git a/layout/reftests/backgrounds/vector/reftest.list b/layout/reftests/backgrounds/vector/reftest.list index 3ace266a19f7..2e538ab16532 100644 --- a/layout/reftests/backgrounds/vector/reftest.list +++ b/layout/reftests/backgrounds/vector/reftest.list @@ -84,16 +84,10 @@ skip-if(B2G) == tall--contain--nonpercent-width-omitted-height-viewbox.html ref- == tall--contain--percent-width-omitted-height-viewbox.html ref-tall-lime48x384-aqua48x384.html == tall--contain--percent-width-percent-height.html ref-tall-lime256x384-aqua256x384.html == tall--contain--percent-width-percent-height-viewbox.html ref-tall-lime48x384-aqua48x384.html - -# We smear the background image when scaling it in these two tests... -# Android uses FILTER_NEAREST for background images so the smear doesn't occur -fails-if(!(Android||B2G)) == tall--cover--nonpercent-width-nonpercent-height.html ref-tall-lime256x512-aqua256x256.html -fails-if(!(Android||B2G)) == tall--cover--nonpercent-width-nonpercent-height-viewbox.html ref-tall-lime256x512-aqua256x256.html - -# ...but we don't in identical tests with image-rendering: -moz-crisp-edges. +== tall--cover--nonpercent-width-nonpercent-height.html ref-tall-lime256x512-aqua256x256.html +== tall--cover--nonpercent-width-nonpercent-height-viewbox.html ref-tall-lime256x512-aqua256x256.html == tall--cover--nonpercent-width-nonpercent-height--crisp.html ref-tall-lime256x512-aqua256x256.html == tall--cover--nonpercent-width-nonpercent-height-viewbox--crisp.html ref-tall-lime256x512-aqua256x256.html - == tall--cover--nonpercent-width-omitted-height.html ref-tall-lime256x384-aqua256x384.html == tall--cover--nonpercent-width-omitted-height-viewbox.html ref-tall-lime256x768.html == tall--cover--nonpercent-width-percent-height.html ref-tall-lime256x384-aqua256x384.html diff --git a/layout/reftests/svg/as-image/reftest.list b/layout/reftests/svg/as-image/reftest.list index 229396ddc551..6ebd927f4bb4 100644 --- a/layout/reftests/svg/as-image/reftest.list +++ b/layout/reftests/svg/as-image/reftest.list @@ -154,4 +154,4 @@ HTTP == svg-stylesheet-external-1.html blue100x100.svg # XXXseth: The underlying problems also apply to media fragments, # but the test case would be much simpler. This should be switched # over to use media fragments once bug 790640 lands. -skip-if(B2G) == svg-border-image-repaint-1.html svg-border-image-repaint-1-ref.html +skip-if(B2G) fuzzy(2,1) == svg-border-image-repaint-1.html svg-border-image-repaint-1-ref.html diff --git a/layout/reftests/svg/as-image/zoom/circle-large.svg b/layout/reftests/svg/as-image/zoom/circle-large.svg new file mode 100644 index 000000000000..a097f3c666be --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/circle-large.svg @@ -0,0 +1,3 @@ + + + diff --git a/layout/reftests/svg/as-image/zoom/circle-small.svg b/layout/reftests/svg/as-image/zoom/circle-small.svg new file mode 100644 index 000000000000..b0cba24a65d7 --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/circle-small.svg @@ -0,0 +1,3 @@ + + + diff --git a/layout/reftests/svg/as-image/zoom/img-fuzzy-transform-zoomIn-1.html b/layout/reftests/svg/as-image/zoom/img-fuzzy-transform-zoomIn-1.html new file mode 100644 index 000000000000..b4eadba92e0c --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/img-fuzzy-transform-zoomIn-1.html @@ -0,0 +1,29 @@ + + + + + + + +
+ + diff --git a/layout/reftests/svg/as-image/zoom/img-fuzzy-transform-zoomOut-1.html b/layout/reftests/svg/as-image/zoom/img-fuzzy-transform-zoomOut-1.html new file mode 100644 index 000000000000..db0e6c06b9af --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/img-fuzzy-transform-zoomOut-1.html @@ -0,0 +1,29 @@ + + + + + + + +
+ + diff --git a/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomIn-1-ref.html b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomIn-1-ref.html new file mode 100644 index 000000000000..81e6011e629f --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomIn-1-ref.html @@ -0,0 +1,27 @@ + + + + + + + +
+ + diff --git a/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomIn-1.html b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomIn-1.html new file mode 100644 index 000000000000..de39990b9540 --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomIn-1.html @@ -0,0 +1,27 @@ + + + + + + + +
+ + diff --git a/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomOut-1-ref.html b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomOut-1-ref.html new file mode 100644 index 000000000000..48f2d05ff7ee --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomOut-1-ref.html @@ -0,0 +1,27 @@ + + + + + + + +
+ + diff --git a/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomOut-1.html b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomOut-1.html new file mode 100644 index 000000000000..75cd1d61af4a --- /dev/null +++ b/layout/reftests/svg/as-image/zoom/img-fuzzy-zoomOut-1.html @@ -0,0 +1,27 @@ + + + + + + + +
+ + diff --git a/layout/reftests/svg/as-image/zoom/reftest.list b/layout/reftests/svg/as-image/zoom/reftest.list index 3c11dfa8f7a7..035d39c51c04 100644 --- a/layout/reftests/svg/as-image/zoom/reftest.list +++ b/layout/reftests/svg/as-image/zoom/reftest.list @@ -4,3 +4,9 @@ == img-zoomIn-1.html squaredCircle-150x150-ref.html == img-zoomOut-1.html squaredCircle-50x50-ref.html + +# Ensure that scaled SVG images aren't fuzzy when tiled. +== img-fuzzy-zoomOut-1.html img-fuzzy-zoomOut-1-ref.html +== img-fuzzy-zoomIn-1.html img-fuzzy-zoomIn-1-ref.html +== img-fuzzy-transform-zoomOut-1.html img-fuzzy-zoomOut-1-ref.html +== img-fuzzy-transform-zoomIn-1.html img-fuzzy-zoomIn-1-ref.html diff --git a/layout/svg/nsSVGImageFrame.cpp b/layout/svg/nsSVGImageFrame.cpp index 01d0bce01e57..3f3721604edb 100644 --- a/layout/svg/nsSVGImageFrame.cpp +++ b/layout/svg/nsSVGImageFrame.cpp @@ -248,19 +248,20 @@ nsSVGImageFrame::TransformContextForPainting(gfxContext* aGfxContext) } imageTransform = GetRasterImageTransform(nativeWidth, nativeHeight, FOR_PAINTING); + + // NOTE: We need to cancel out the effects of Full-Page-Zoom, or else + // it'll get applied an extra time by DrawSingleUnscaledImage. + nscoord appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel(); + gfxFloat pageZoomFactor = + nsPresContext::AppUnitsToFloatCSSPixels(appUnitsPerDevPx); + imageTransform.Scale(pageZoomFactor, pageZoomFactor); } if (imageTransform.IsSingular()) { return false; } - // NOTE: We need to cancel out the effects of Full-Page-Zoom, or else - // it'll get applied an extra time by DrawSingleUnscaledImage. - nscoord appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel(); - gfxFloat pageZoomFactor = - nsPresContext::AppUnitsToFloatCSSPixels(appUnitsPerDevPx); - aGfxContext->Multiply(imageTransform.Scale(pageZoomFactor, pageZoomFactor)); - + aGfxContext->Multiply(imageTransform); return true; } diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h index 2432fd624339..3a595f40355a 100644 --- a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h +++ b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-port.h @@ -490,10 +490,10 @@ # define GTEST_ENV_HAS_TR1_TUPLE_ 1 # endif -// C++11 specifies that provides std::tuple. Users can't use -// gtest in C++11 mode until their standard library is at least that -// compliant. -# if GTEST_LANG_CXX11 +// C++11 specifies that provides std::tuple. Use that if gtest is used +// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6 +// can build with clang but need to use gcc4.2's libstdc++). +# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325) # define GTEST_ENV_HAS_STD_TUPLE_ 1 # endif diff --git a/media/webrtc/trunk/webrtc/build/common.gypi b/media/webrtc/trunk/webrtc/build/common.gypi index bee0432b8c5a..a086d3fdac01 100644 --- a/media/webrtc/trunk/webrtc/build/common.gypi +++ b/media/webrtc/trunk/webrtc/build/common.gypi @@ -124,6 +124,21 @@ # and Java Implementation 'enable_android_opensl%': 0, }], + ['OS=="linux"', { + 'include_alsa_audio%': 1, + }, { + 'include_alsa_audio%': 0, + }], + ['OS=="solaris" or os_bsd==1', { + 'include_pulse_audio%': 1, + }, { + 'include_pulse_audio%': 0, + }], + ['OS=="linux" or OS=="solaris" or os_bsd==1', { + 'include_v4l2_video_capture%': 1, + }, { + 'include_v4l2_video_capture%': 0, + }], ['OS=="ios"', { 'enable_video%': 0, 'enable_protobuf%': 0, @@ -215,6 +230,18 @@ }], ], }], + ['os_bsd==1', { + 'defines': [ + 'WEBRTC_BSD', + 'WEBRTC_THREAD_RR', + ], + }], + ['OS=="dragonfly" or OS=="netbsd"', { + 'defines': [ + # doesn't support pthread_condattr_setclock + 'WEBRTC_CLOCK_TYPE_REALTIME', + ], + }], ['OS=="ios"', { 'defines': [ 'WEBRTC_MAC', diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_utility.cc b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_utility.cc index 203f09a0de0c..0b0b70e2faa1 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_utility.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_utility.cc @@ -46,7 +46,7 @@ bool AudioDeviceUtility::StringCompare( } // namespace webrtc -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) // ============================================================================ // Linux & Mac @@ -109,6 +109,6 @@ bool AudioDeviceUtility::StringCompare( } // namespace webrtc -#endif // defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#endif // defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.cc b/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.cc index 8f3c7c8d4d57..7c934214ab21 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.cc @@ -27,7 +27,7 @@ #include "latebindingsymboltable_linux.h" -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) #include #endif @@ -37,7 +37,7 @@ using namespace webrtc; namespace webrtc_adm_linux { inline static const char *GetDllError() { -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) char *err = dlerror(); if (err) { return err; @@ -50,7 +50,7 @@ inline static const char *GetDllError() { } DllHandle InternalLoadDll(const char dll_name[]) { -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) DllHandle handle = dlopen(dll_name, RTLD_NOW); #else #error Not implemented @@ -63,7 +63,7 @@ DllHandle InternalLoadDll(const char dll_name[]) { } void InternalUnloadDll(DllHandle handle) { -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) if (dlclose(handle) != 0) { WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1, "%d", GetDllError()); @@ -76,7 +76,7 @@ void InternalUnloadDll(DllHandle handle) { static bool LoadSymbol(DllHandle handle, const char *symbol_name, void **symbol) { -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) *symbol = dlsym(handle, symbol_name); char *err = dlerror(); if (err) { @@ -101,7 +101,7 @@ bool InternalLoadSymbols(DllHandle handle, int num_symbols, const char *const symbol_names[], void *symbols[]) { -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) // Clear any old errors. dlerror(); #endif diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.h b/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.h index 91d25aa2dc8d..c32e21187e18 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.h @@ -42,7 +42,7 @@ namespace webrtc_adm_linux { -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) typedef void *DllHandle; const DllHandle kInvalidDllHandle = NULL; diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc b/media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc index ae663f700d34..7d41a9a712bd 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc @@ -29,7 +29,11 @@ namespace webrtc_adm_linux_pulse { +#ifdef __OpenBSD__ +LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so") +#else LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so.0") +#endif #define X(sym) \ LATE_BINDING_SYMBOL_TABLE_DEFINE_ENTRY(PulseAudioSymbolTable, sym) PULSE_AUDIO_SYMBOLS_LIST diff --git a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc index bdad224ee5f6..39e113281c97 100644 --- a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc +++ b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc @@ -12,6 +12,7 @@ #include #include +#include // for abs() #include #include diff --git a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_utility.cc b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_utility.cc index efc985cd1601..d1d81a76ec4e 100644 --- a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_utility.cc +++ b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/rtp_utility.cc @@ -18,7 +18,7 @@ #include // FILETIME #include // timeval #include // timeGetTime -#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_MAC)) +#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC)) #include // gettimeofday #include #endif @@ -156,7 +156,7 @@ void get_time(WindowsHelpTimer* help_timer, FILETIME& current_time) { WindowsHelpTimer* _helpTimer; }; -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) // A clock reading times from the POSIX API. class UnixSystemClock : public RtpRtcpClock { @@ -214,7 +214,7 @@ void WindowsSystemClock::CurrentNTP(WebRtc_UWord32& secs, frac = (WebRtc_UWord32)dtemp; } -#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_MAC)) +#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC)) WebRtc_Word64 UnixSystemClock::GetTimeInMS() { return TickTime::MillisecondTimestamp(); @@ -253,7 +253,7 @@ static WindowsHelpTimer global_help_timer = {0, 0, {{ 0, 0}, 0}, 0}; RtpRtcpClock* GetSystemClock() { #if defined(_WIN32) return new WindowsSystemClock(&global_help_timer); -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) return new UnixSystemClock(); #else return NULL; @@ -330,7 +330,7 @@ bool StringCompare(const char* str1, const char* str2, const WebRtc_UWord32 length) { return (_strnicmp(str1, str2, length) == 0) ? true : false; } -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) bool StringCompare(const char* str1, const char* str2, const WebRtc_UWord32 length) { return (strncasecmp(str1, str2, length) == 0) ? true : false; diff --git a/media/webrtc/trunk/webrtc/modules/udp_transport/source/udp_transport_impl.cc b/media/webrtc/trunk/webrtc/modules/udp_transport/source/udp_transport_impl.cc index b4c927947f97..183e9646b9fa 100644 --- a/media/webrtc/trunk/webrtc/modules/udp_transport/source/udp_transport_impl.cc +++ b/media/webrtc/trunk/webrtc/modules/udp_transport/source/udp_transport_impl.cc @@ -18,16 +18,16 @@ #if defined(_WIN32) #include #include -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) #include #include #include #include +#include #include #include #include #include -#include #include #include #ifndef WEBRTC_IOS @@ -36,9 +36,11 @@ #endif // defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) #if defined(WEBRTC_MAC) -#include #include #endif +#if defined(WEBRTC_BSD) || defined(WEBRTC_MAC) +#include +#endif #if defined(WEBRTC_LINUX) #include #include @@ -51,7 +53,7 @@ #include "typedefs.h" #include "udp_socket_manager_wrapper.h" -#if defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) #define GetLastError() errno #define IFRSIZE ((int)(size * sizeof (struct ifreq))) @@ -61,7 +63,7 @@ (int)(nlh)->nlmsg_len >= (int)sizeof(struct nlmsghdr) && \ (int)(nlh)->nlmsg_len <= (len)) -#endif // defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#endif // defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) namespace webrtc { @@ -2371,7 +2373,7 @@ WebRtc_Word32 UdpTransport::InetPresentationToNumeric(WebRtc_Word32 af, const char* src, void* dst) { -#if defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) const WebRtc_Word32 result = inet_pton(af, src, dst); return result > 0 ? 0 : -1; @@ -2493,7 +2495,7 @@ WebRtc_Word32 UdpTransport::LocalHostAddressIPV6(char n_localIP[16]) "getaddrinfo failed to find address"); return -1; -#elif defined(WEBRTC_MAC) +#elif defined(WEBRTC_BSD) || defined(WEBRTC_MAC) struct ifaddrs* ptrIfAddrs = NULL; struct ifaddrs* ptrIfAddrsStart = NULL; @@ -2685,7 +2687,7 @@ WebRtc_Word32 UdpTransport::LocalHostAddress(WebRtc_UWord32& localIP) "gethostbyname failed, error:%d", error); return -1; } -#elif (defined(WEBRTC_MAC)) +#elif (defined(WEBRTC_BSD) || defined(WEBRTC_MAC)) char localname[255]; if (gethostname(localname, 255) != -1) { @@ -2824,7 +2826,7 @@ WebRtc_Word32 UdpTransport::IPAddress(const SocketAddress& address, sourcePort = htons(source_port); return 0; - #elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) + #elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) WebRtc_Word32 ipFamily = address._sockaddr_storage.sin_family; const void* ptrNumericIP = NULL; diff --git a/media/webrtc/trunk/webrtc/modules/utility/source/rtp_dump_impl.cc b/media/webrtc/trunk/webrtc/modules/utility/source/rtp_dump_impl.cc index 69a52ecc5789..7ac226c7035e 100644 --- a/media/webrtc/trunk/webrtc/modules/utility/source/rtp_dump_impl.cc +++ b/media/webrtc/trunk/webrtc/modules/utility/source/rtp_dump_impl.cc @@ -19,7 +19,7 @@ #if defined(_WIN32) #include #include -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) #include #include #include @@ -238,7 +238,7 @@ inline WebRtc_UWord32 RtpDumpImpl::GetTimeInMS() const { #if defined(_WIN32) return timeGetTime(); -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) struct timeval tv; struct timezone tz; unsigned long val; diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/device_info_impl.cc b/media/webrtc/trunk/webrtc/modules/video_capture/device_info_impl.cc index e0d5e7ea34a1..b26a7e05a425 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/device_info_impl.cc +++ b/media/webrtc/trunk/webrtc/modules/video_capture/device_info_impl.cc @@ -54,7 +54,7 @@ WebRtc_Word32 DeviceInfoImpl::NumberOfCapabilities( if (_lastUsedDeviceNameLength == strlen((char*) deviceUniqueIdUTF8)) { // Is it the same device that is asked for again. -#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) +#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) if(strncasecmp((char*)_lastUsedDeviceName, (char*) deviceUniqueIdUTF8, _lastUsedDeviceNameLength)==0) @@ -91,7 +91,7 @@ WebRtc_Word32 DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8, ReadLockScoped cs(_apiLock); if ((_lastUsedDeviceNameLength != strlen((char*) deviceUniqueIdUTF8)) -#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) +#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || (strncasecmp((char*)_lastUsedDeviceName, (char*) deviceUniqueIdUTF8, _lastUsedDeviceNameLength)!=0)) @@ -155,7 +155,7 @@ WebRtc_Word32 DeviceInfoImpl::GetBestMatchedCapability( ReadLockScoped cs(_apiLock); if ((_lastUsedDeviceNameLength != strlen((char*) deviceUniqueIdUTF8)) -#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) +#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || (strncasecmp((char*)_lastUsedDeviceName, (char*) deviceUniqueIdUTF8, _lastUsedDeviceNameLength)!=0)) diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc b/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc index 9300dc2859c8..6ecbd5932a99 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc +++ b/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc @@ -19,7 +19,13 @@ #include //v4l includes +#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#elif defined(__sun) +#include +#else #include +#endif #include "ref_count.h" #include "trace.h" diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc b/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc index 61837003cea8..8eca2884f6b3 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc +++ b/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc @@ -12,12 +12,20 @@ #include #include #include -#include #include #include #include #include +//v4l includes +#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#elif defined(__sun) +#include +#else +#include +#endif + #include #include "ref_count.h" diff --git a/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi b/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi index d46b5aa4869b..b3d7e2aa5d94 100644 --- a/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi +++ b/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi @@ -48,7 +48,7 @@ ], }, { # include_internal_video_capture == 1 'conditions': [ - ['OS=="linux"', { + ['include_v4l2_video_capture==1', { 'include_dirs': [ 'linux', ], @@ -157,7 +157,7 @@ 'test/video_capture_main_mac.mm', ], 'conditions': [ - ['OS=="mac" or OS=="linux"', { + ['OS!="win" and OS!="android"', { 'cflags': [ '-Wno-write-strings', ], @@ -165,11 +165,15 @@ '-lpthread -lm', ], }], + ['include_v4l2_video_capture==1', { + 'libraries': [ + '-lXext', + '-lX11', + ], + }], ['OS=="linux"', { 'libraries': [ '-lrt', - '-lXext', - '-lX11', ], }], ['OS=="mac"', { diff --git a/media/webrtc/trunk/webrtc/system_wrappers/interface/asm_defines.h b/media/webrtc/trunk/webrtc/system_wrappers/interface/asm_defines.h index c9f99b74f4cf..55afc4ff58bd 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/interface/asm_defines.h +++ b/media/webrtc/trunk/webrtc/system_wrappers/interface/asm_defines.h @@ -11,7 +11,7 @@ #ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_ #define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_ -#if defined(__linux__) && defined(__ELF__) +#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__) .section .note.GNU-stack,"",%progbits #endif diff --git a/media/webrtc/trunk/webrtc/system_wrappers/interface/tick_util.h b/media/webrtc/trunk/webrtc/system_wrappers/interface/tick_util.h index acd16a523b75..a8102a0f947f 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/interface/tick_util.h +++ b/media/webrtc/trunk/webrtc/system_wrappers/interface/tick_util.h @@ -194,7 +194,7 @@ inline WebRtc_Word64 TickTime::QueryOsForTicks() { } result.ticks_ = now + (num_wrap_time_get_time << 32); #endif -#elif defined(WEBRTC_LINUX) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) struct timespec ts; // TODO(wu): Remove CLOCK_REALTIME implementation. #ifdef WEBRTC_CLOCK_TYPE_REALTIME @@ -241,7 +241,7 @@ inline WebRtc_Word64 TickTime::MillisecondTimestamp() { #else return ticks; #endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) return ticks / 1000000LL; #else return ticks / 1000LL; @@ -258,7 +258,7 @@ inline WebRtc_Word64 TickTime::MicrosecondTimestamp() { #else return ticks * 1000LL; #endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) return ticks / 1000LL; #else return ticks; @@ -278,7 +278,7 @@ inline WebRtc_Word64 TickTime::MillisecondsToTicks(const WebRtc_Word64 ms) { #else return ms; #endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) return ms * 1000000LL; #else return ms * 1000LL; @@ -294,7 +294,7 @@ inline WebRtc_Word64 TickTime::TicksToMilliseconds(const WebRtc_Word64 ticks) { #else return ticks; #endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) return ticks / 1000000LL; #else return ticks / 1000LL; @@ -323,7 +323,7 @@ inline WebRtc_Word64 TickInterval::Milliseconds() const { // interval_ is in ms return interval_; #endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) // interval_ is in ns return interval_ / 1000000; #else @@ -342,7 +342,7 @@ inline WebRtc_Word64 TickInterval::Microseconds() const { // interval_ is in ms return interval_ * 1000LL; #endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) // interval_ is in ns return interval_ / 1000; #else diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/atomic32_posix.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/atomic32_posix.cc index 8a52617efeae..d0e542e3b5a8 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/atomic32_posix.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/atomic32_posix.cc @@ -12,7 +12,6 @@ #include #include -#include #include "common_types.h" diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc index d97f1d7c7f6b..54b40149eb65 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc @@ -8,14 +8,14 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "condition_variable_wrapper.h" + #if defined(_WIN32) #include #include "condition_variable_win.h" -#include "condition_variable_wrapper.h" -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) #include #include "condition_variable_posix.h" -#include "condition_variable_wrapper.h" #endif namespace webrtc { @@ -23,7 +23,7 @@ namespace webrtc { ConditionVariableWrapper* ConditionVariableWrapper::CreateConditionVariable() { #if defined(_WIN32) return new ConditionVariableWindows; -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) return ConditionVariablePosix::Create(); #else return NULL; diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_posix.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_posix.cc index a5df728ba618..c62206c01ccf 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_posix.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_posix.cc @@ -79,7 +79,7 @@ bool ConditionVariablePosix::SleepCS(CriticalSectionWrapper& crit_sect, unsigned long max_time_inMS) { const unsigned long INFINITE = 0xFFFFFFFF; const int MILLISECONDS_PER_SECOND = 1000; -#ifndef WEBRTC_LINUX +#if !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD) const int MICROSECONDS_PER_MILLISECOND = 1000; #endif const int NANOSECONDS_PER_SECOND = 1000000000; diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/cpu.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/cpu.cc index d81f0153175a..3a3c74f825fe 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/cpu.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/cpu.cc @@ -14,7 +14,7 @@ #include "cpu_win.h" #elif defined(WEBRTC_MAC) #include "cpu_mac.h" -#elif defined(WEBRTC_ANDROID) +#elif defined(WEBRTC_ANDROID) || defined(WEBRTC_BSD) // Not implemented yet, might be possible to use Linux implementation #else // defined(WEBRTC_LINUX) #include "cpu_linux.h" @@ -26,7 +26,7 @@ CpuWrapper* CpuWrapper::CreateCpu() { return new CpuWindows(); #elif defined(WEBRTC_MAC) return new CpuWrapperMac(); -#elif defined(WEBRTC_ANDROID) +#elif defined(WEBRTC_ANDROID) || defined(WEBRTC_BSD) return 0; #else return new CpuLinux(); diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc index a4fd1b1b24d9..cede9d0f2b2f 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_info.cc @@ -12,13 +12,15 @@ #if defined(_WIN32) #include -#elif defined(WEBRTC_MAC) -#include +#elif defined(WEBRTC_BSD) || defined(WEBRTC_MAC) #include +#include #elif defined(WEBRTC_ANDROID) // Not implemented yet, might be possible to use Linux implementation -#else // defined(WEBRTC_LINUX) +#elif defined(WEBRTC_LINUX) #include +#else // defined(_SC_NPROCESSORS_ONLN) +#include #endif #include "trace.h" @@ -41,8 +43,15 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCores() { WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Available number of cores:%d", number_of_cores_); -#elif defined(WEBRTC_MAC) - int name[] = {CTL_HW, HW_AVAILCPU}; +#elif defined(WEBRTC_BSD) || defined(WEBRTC_MAC) + int name[] = { + CTL_HW, +#ifdef HW_AVAILCPU + HW_AVAILCPU, +#else + HW_NCPU, +#endif + }; int ncpu; size_t size = sizeof(ncpu); if (0 == sysctl(name, 2, &ncpu, &size, NULL, 0)) { @@ -54,6 +63,8 @@ WebRtc_UWord32 CpuInfo::DetectNumberOfCores() { "Failed to get number of cores"); number_of_cores_ = 1; } +#elif defined(_SC_NPROCESSORS_ONLN) + _numberOfCores = sysconf(_SC_NPROCESSORS_ONLN); #else WEBRTC_TRACE(kTraceWarning, kTraceUtility, -1, "No function to get number of cores"); diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc index fc6ef99478d5..12b4af5a7aab 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc @@ -59,6 +59,17 @@ #include #endif +#if defined(__NetBSD__) +#include +#elif defined(__FreeBSD__) +#include +#include +#endif + +#if defined(WEBRTC_BSD) && !defined(__NetBSD__) +#include +#endif + #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/trace.h" @@ -141,6 +152,20 @@ uint32_t ThreadWrapper::GetThreadId() { return static_cast(syscall(__NR_gettid)); #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS) return pthread_mach_thread_np(pthread_self()); +#elif defined(__NetBSD__) + return _lwp_self(); +#elif defined(__DragonFly__) + return lwp_gettid(); +#elif defined(__OpenBSD__) + return reinterpret_cast (pthread_self()); +#elif defined(__FreeBSD__) +# if __FreeBSD_version > 900030 + return pthread_getthreadid_np(); +# else + long lwpid; + thr_self(&lwpid); + return lwpid; +# endif #else return reinterpret_cast(pthread_self()); #endif @@ -172,7 +197,7 @@ ThreadPosix::~ThreadPosix() { delete crit_state_; } -#define HAS_THREAD_ID !defined(WEBRTC_IOS) && !defined(WEBRTC_MAC) +#define HAS_THREAD_ID !defined(WEBRTC_IOS) && !defined(WEBRTC_MAC) && !defined(WEBRTC_BSD) bool ThreadPosix::Start(unsigned int& thread_id) { @@ -237,13 +262,17 @@ bool ThreadPosix::Start(unsigned int& thread_id) // CPU_ZERO and CPU_SET are not available in NDK r7, so disable // SetAffinity on Android for now. -#if (defined(WEBRTC_LINUX) && (!defined(WEBRTC_ANDROID)) && (!defined(WEBRTC_GONK))) +#if defined(__FreeBSD__) || (defined(WEBRTC_LINUX) && (!defined(WEBRTC_ANDROID)) && (!defined(WEBRTC_GONK))) bool ThreadPosix::SetAffinity(const int* processor_numbers, const unsigned int amount_of_processors) { if (!processor_numbers || (amount_of_processors == 0)) { return false; } +#if defined(__FreeBSD__) + cpuset_t mask; +#else cpu_set_t mask; +#endif CPU_ZERO(&mask); for (unsigned int processor = 0; @@ -251,7 +280,11 @@ bool ThreadPosix::SetAffinity(const int* processor_numbers, ++processor) { CPU_SET(processor_numbers[processor], &mask); } -#if defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK) +#if defined(__FreeBSD__) + const int result = pthread_setaffinity_np(thread_, + sizeof(mask), + &mask); +#elif defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK) // Android. const int result = syscall(__NR_sched_setaffinity, pid_, @@ -325,6 +358,10 @@ void ThreadPosix::Run() { if (set_thread_name_) { #ifdef WEBRTC_LINUX prctl(PR_SET_NAME, (unsigned long)name_, 0, 0, 0); +#elif defined(__NetBSD__) + pthread_setname_np(pthread_self(), "%s", (void *)name_); +#elif defined(WEBRTC_BSD) + pthread_set_name_np(pthread_self(), name_); #endif WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Thread with name:%s started ", name_); diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/trace_posix.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/trace_posix.cc index 2c7e59a891df..6f23fcb37246 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/trace_posix.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/trace_posix.cc @@ -54,7 +54,7 @@ WebRtc_Word32 TracePosix::AddTime(char* trace_message, } struct tm buffer; const struct tm* system_time = - localtime_r(&system_time_high_res.tv_sec, &buffer); + localtime_r((const time_t *)(&system_time_high_res.tv_sec), &buffer); const WebRtc_UWord32 ms_time = system_time_high_res.tv_usec / 1000; WebRtc_UWord32 prev_tickCount = 0; diff --git a/media/webrtc/trunk/webrtc/typedefs.h b/media/webrtc/trunk/webrtc/typedefs.h index e82bbefe9cc1..fec664dc1203 100644 --- a/media/webrtc/trunk/webrtc/typedefs.h +++ b/media/webrtc/trunk/webrtc/typedefs.h @@ -21,7 +21,7 @@ // For access to standard POSIXish features, use WEBRTC_POSIX instead of a // more specific macro. #if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX) || \ - defined(WEBRTC_ANDROID) + defined(WEBRTC_ANDROID) || defined(WEBRTC_BSD) #define WEBRTC_POSIX #endif diff --git a/media/webrtc/trunk/webrtc/video_engine/vie_defines.h b/media/webrtc/trunk/webrtc/video_engine/vie_defines.h index 42c91b56163f..bed9a06ce92c 100644 --- a/media/webrtc/trunk/webrtc/video_engine/vie_defines.h +++ b/media/webrtc/trunk/webrtc/video_engine/vie_defines.h @@ -173,7 +173,7 @@ inline int ChannelId(const int moduleId) { // Linux specific. #ifndef WEBRTC_ANDROID -#ifdef WEBRTC_LINUX +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) // Build information macros. #if defined(_DEBUG) #define BUILDMODE "d" diff --git a/media/webrtc/trunk/webrtc/voice_engine/voe_network_impl.cc b/media/webrtc/trunk/webrtc/voice_engine/voe_network_impl.cc index d0b9895c701b..f6a7f94de10f 100644 --- a/media/webrtc/trunk/webrtc/voice_engine/voe_network_impl.cc +++ b/media/webrtc/trunk/webrtc/voice_engine/voe_network_impl.cc @@ -472,7 +472,7 @@ int VoENetworkImpl::SetSendTOS(int channel, "SetSendTOS(channel=%d, DSCP=%d, useSetSockopt=%d)", channel, DSCP, useSetSockopt); -#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_MAC) +#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD) && !defined(WEBRTC_MAC) _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceWarning, "SetSendTOS() is not supported on this platform"); return -1; @@ -528,7 +528,7 @@ int VoENetworkImpl::SetSendTOS(int channel, "SetSendTOS() external transport is enabled"); return -1; } -#if defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) +#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC) useSetSockopt = true; WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1), " force useSetSockopt=true since there is no alternative" @@ -551,7 +551,7 @@ int VoENetworkImpl::GetSendTOS(int channel, WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), "GetSendTOS(channel=%d)", channel); -#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_MAC) +#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD) && !defined(WEBRTC_MAC) _shared->SetLastError(VE_FUNC_NOT_SUPPORTED, kTraceWarning, "GetSendTOS() is not supported on this platform"); return -1; diff --git a/media/webrtc/trunk/webrtc/voice_engine/voice_engine_defines.h b/media/webrtc/trunk/webrtc/voice_engine/voice_engine_defines.h index 88fdc7e50bc2..3b63a3bca88a 100644 --- a/media/webrtc/trunk/webrtc/voice_engine/voice_engine_defines.h +++ b/media/webrtc/trunk/webrtc/voice_engine/voice_engine_defines.h @@ -414,7 +414,7 @@ namespace webrtc // *** WEBRTC_MAC *** // including iPhone -#ifdef WEBRTC_MAC +#if defined(WEBRTC_BSD) || defined(WEBRTC_MAC) #include #include @@ -431,6 +431,7 @@ namespace webrtc #include #include #include +#if !defined(WEBRTC_BSD) #include #if !defined(WEBRTC_IOS) #include @@ -439,6 +440,7 @@ namespace webrtc #include #include #endif +#endif #define DWORD unsigned long int #define WINAPI @@ -531,7 +533,7 @@ namespace webrtc #else #define IPHONE_NOT_SUPPORTED(stat) -#endif // #ifdef WEBRTC_MAC +#endif // #if defined(WEBRTC_BSD) || defined(WEBRTC_MAC) diff --git a/mobile/android/base/TabCounter.java b/mobile/android/base/TabCounter.java index d6b984f8cbf1..6b670d8a21e3 100644 --- a/mobile/android/base/TabCounter.java +++ b/mobile/android/base/TabCounter.java @@ -66,21 +66,32 @@ public class TabCounter extends GeckoTextSwitcher } public void setCountWithAnimation(int count) { - if (mCount == count) - return; - // Don't animate from initial state - if (mCount != 0) { - if (count < mCount) { - setInAnimation(mFlipInBackward); - setOutAnimation(mFlipOutForward); - } else if (count > mCount) { - setInAnimation(mFlipInForward); - setOutAnimation(mFlipOutBackward); - } + if (mCount == 0) { + setCount(count); + return; } + if (mCount == count) { + return; + } + + if (count < mCount) { + setInAnimation(mFlipInBackward); + setOutAnimation(mFlipOutForward); + } else { + setInAnimation(mFlipInForward); + setOutAnimation(mFlipOutBackward); + } + + // Eliminate screen artifact. Set explicit In/Out animation pair order. This will always + // animate pair in In->Out child order, prevent alternating use of the Out->In case. + setDisplayedChild(0); + + // Set In value, trigger animation to Out value + setCurrentText(String.valueOf(mCount)); setText(String.valueOf(count)); + mCount = count; }