mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
19a820a48c
- Bug 1138356 - Correct the alignment of button contents in vertical-rl writing mode. r=smontagu (386d8e4ef) - Bug 1138356 - Reftests for button contents alignment in vertical writing modes. r=smontagu (9829a8374) - Bug 1151905; remove unnecessary gfxVR.h includes; r=ehsan (29092c930) - Bug 1152171 part 1 - Remove AnimationTimeline IDL tests from dom/animation/tests; r=Ms2ger (47983c273) - Bug 1145327 Part 1: Skip refresh driver ticks if the timestamp is in the past. r=birtles,vlad (e6dd3e843) - Bug 1145327 Part 2: Add test to ensure requestAnimationFrame callback timestamps always go forward in time. r=birtles,dholbert (72e835de9) - Bug 1091307 - Add a configure flag to prevent shipping Mozilla's RIL and Geolocation provider r=hsinyi,mshal (69b8a4baf) - Bug 1101331: Modify directory structure of B2G.app to conform with Apple's v2 signature requirements. r=rstrong (68d83c82e) - Bug1062387- Part 1. Fix clearing of camera preferences. r=mikeh (24244bd98) - Bug1062387- Part 2. Implement DOM and JavaScript facing components of JS camera driver. r=mikeh r=bz (3eaa8513d) - Bug1062387- Part 3. Implement Gonk wrappers for JS camera driver. r=mikeh (8fd1d8326) - Bug1062387- Part 4. Update test cases to use JS camera driver. r=mikeh (73e2e0f44) - Bug 1109479 - move tethering related code out of NetworkManager. r=echen (16997c1c8) - Bug 1043403 - Support clear-key in Mochitest on B2G. r=ted. (99077635c) - update of Bug 674779 - Per-component CPU monitoring, high-level. (9af8a64d1) - Bug 1114935 - Part 1: Define new nsIIccService/nsIGonkIccService to replace nsIIccProvider. r=echen (763256430) - Bug 1114935 - Part 2: Add Gonk Implementation of nsIIccService. r=echen (1621c9f6a) - Bug 1147793 - Remove unnecessary intr semantic in ipdl file. r=bent (ebb316f08)
90 lines
2.9 KiB
C++
90 lines
2.9 KiB
C++
/* 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/. */
|
|
|
|
#include "DOMCameraDetectedFace.h"
|
|
#include "Navigator.h"
|
|
|
|
using namespace mozilla;
|
|
using namespace mozilla::dom;
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMCameraDetectedFace, mParent,
|
|
mBounds, mLeftEye, mRightEye, mMouth)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMCameraDetectedFace)
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMCameraDetectedFace)
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMCameraDetectedFace)
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
|
NS_INTERFACE_MAP_END
|
|
|
|
/* static */
|
|
bool
|
|
DOMCameraDetectedFace::HasSupport(JSContext* aCx, JSObject* aGlobal)
|
|
{
|
|
return Navigator::HasCameraSupport(aCx, aGlobal);
|
|
}
|
|
|
|
JSObject*
|
|
DOMCameraDetectedFace::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|
{
|
|
return CameraDetectedFaceBinding::Wrap(aCx, this, aGivenProto);
|
|
}
|
|
|
|
/* static */
|
|
already_AddRefed<DOMCameraDetectedFace>
|
|
DOMCameraDetectedFace::Constructor(const GlobalObject& aGlobal,
|
|
const dom::CameraDetectedFaceInit& aFace,
|
|
ErrorResult& aRv)
|
|
{
|
|
nsRefPtr<DOMCameraDetectedFace> face =
|
|
new DOMCameraDetectedFace(aGlobal.GetAsSupports(), aFace);
|
|
return face.forget();
|
|
}
|
|
|
|
DOMCameraDetectedFace::DOMCameraDetectedFace(nsISupports* aParent,
|
|
const dom::CameraDetectedFaceInit& aFace)
|
|
: mParent(aParent)
|
|
, mId(aFace.mId)
|
|
, mScore(aFace.mScore)
|
|
, mBounds(new DOMRect(this))
|
|
{
|
|
mBounds->SetRect(aFace.mBounds.mLeft,
|
|
aFace.mBounds.mTop,
|
|
aFace.mBounds.mRight - aFace.mBounds.mLeft,
|
|
aFace.mBounds.mBottom - aFace.mBounds.mTop);
|
|
|
|
if (aFace.mHasLeftEye) {
|
|
mLeftEye = new DOMPoint(this, aFace.mLeftEye.mX, aFace.mLeftEye.mY);
|
|
}
|
|
if (aFace.mHasRightEye) {
|
|
mRightEye = new DOMPoint(this, aFace.mRightEye.mX, aFace.mRightEye.mY);
|
|
}
|
|
if (aFace.mHasMouth) {
|
|
mMouth = new DOMPoint(this, aFace.mMouth.mX, aFace.mMouth.mY);
|
|
}
|
|
}
|
|
|
|
DOMCameraDetectedFace::DOMCameraDetectedFace(nsISupports* aParent,
|
|
const ICameraControl::Face& aFace)
|
|
: mParent(aParent)
|
|
, mId(aFace.id)
|
|
, mScore(aFace.score)
|
|
, mBounds(new DOMRect(this))
|
|
{
|
|
mBounds->SetRect(aFace.bound.left,
|
|
aFace.bound.top,
|
|
aFace.bound.right - aFace.bound.left,
|
|
aFace.bound.bottom - aFace.bound.top);
|
|
|
|
if (aFace.hasLeftEye) {
|
|
mLeftEye = new DOMPoint(this, aFace.leftEye.x, aFace.leftEye.y);
|
|
}
|
|
if (aFace.hasRightEye) {
|
|
mRightEye = new DOMPoint(this, aFace.rightEye.x, aFace.rightEye.y);
|
|
}
|
|
if (aFace.hasMouth) {
|
|
mMouth = new DOMPoint(this, aFace.mouth.x, aFace.mouth.y);
|
|
}
|
|
}
|