From 56d5ccbfa78f0b751675a10c94062969d3aa2376 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 10:25:46 -0700 Subject: [PATCH 01/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/9a50d134fe46 Author: Kevin Grandon Desc: Merge pull request #24501 from KevinGrandon/bug_1005921_callscreen_fixes Bug 1005921 - Callscreen jshint fixes ======== https://hg.mozilla.org/integration/gaia-central/rev/c64478b51d45 Author: Kevin Grandon Desc: Bug 1005921 - Callscreen jshint fixes r=rik --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index ce68b7283c8f..ac03683b8759 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "fb5a4aa15e266e9aa0e44281241ad081b528c75b", + "revision": "9a50d134fe468fa859114e3396b4edae7e88052c", "repo_path": "/integration/gaia-central" } From 05682026d921d8af8bfd30be9ab779f986a16199 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 10:31:56 -0700 Subject: [PATCH 02/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 4 ++-- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 982a293834c2..b87b7f521894 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + @@ -133,7 +133,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index df417532182f..c6f926b426f6 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 3791cb4f1ffa..68947011ca7e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 7f85d2b3bdb8..45d96b85dbda 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index df417532182f..c6f926b426f6 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index d3262a24a22e..34ab98d5b4c6 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 71cd40adece6..5cc39aa02473 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 7caa810deaa5..4129777ec2ab 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 0b4a30864d17..210802645722 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index fa5ee9dca136..bc4ab031a98d 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 945335f3aa8a..44f7b6d32428 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 9a0197a4015ead4c1211d6861ffd865f4c37b8a6 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Mon, 29 Sep 2014 13:33:15 -0400 Subject: [PATCH 03/93] Bug 1070993 - Allow for sub-app-unit rounding error when deciding if an APZ is checkerboarding or not. r=botond --- gfx/layers/apz/src/AsyncPanZoomController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 239841641972..adc23a45aa28 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -2649,6 +2649,7 @@ bool AsyncPanZoomController::IsCurrentlyCheckerboarding() const { CSSPoint currentScrollOffset = mFrameMetrics.GetScrollOffset() + mTestAsyncScrollOffset; CSSRect painted = mLastContentPaintMetrics.mDisplayPort + mLastContentPaintMetrics.GetScrollOffset(); + painted.Inflate(CSSMargin::FromAppUnits(nsMargin(1, 1, 1, 1))); // fuzz for rounding error CSSRect visible = CSSRect(currentScrollOffset, mFrameMetrics.CalculateCompositedSizeInCssPixels()); return !painted.Contains(visible); } From 3efc9ae2a8049f9e8623e72fc0fe9d37189f9815 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Mon, 29 Sep 2014 13:45:41 -0400 Subject: [PATCH 04/93] Bug 1073704 - Clear move queue at the end of a gesture, r=kats --- widget/gonk/GeckoTouchDispatcher.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/widget/gonk/GeckoTouchDispatcher.cpp b/widget/gonk/GeckoTouchDispatcher.cpp index 96d8136dd523..941e97cb4fbf 100644 --- a/widget/gonk/GeckoTouchDispatcher.cpp +++ b/widget/gonk/GeckoTouchDispatcher.cpp @@ -349,8 +349,13 @@ IsExpired(const MultiTouchInput& aTouch) void GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch) { - if (aMultiTouch.mType == MultiTouchInput::MULTITOUCH_START && + if ((aMultiTouch.mType == MultiTouchInput::MULTITOUCH_END || + aMultiTouch.mType == MultiTouchInput::MULTITOUCH_CANCEL) && aMultiTouch.mTouches.Length() == 1) { + MutexAutoLock lock(mTouchQueueLock); + mTouchMoveEvents.clear(); + } else if (aMultiTouch.mType == MultiTouchInput::MULTITOUCH_START && + aMultiTouch.mTouches.Length() == 1) { mTouchEventsFiltered = IsExpired(aMultiTouch); } From ab4d737e972531056cfa4d8bfd39ebc57be9e2eb Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 13:06:02 -0700 Subject: [PATCH 05/93] Bumping gaia.json for 8 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/bb21b0d18717 Author: Marcus Cavanaugh Desc: Merge pull request #24521 from mcav/clock-thing Bug 1061083 - [Clock] Edit Alarm screen does not responding after adding... r=mcav ======== https://hg.mozilla.org/integration/gaia-central/rev/4c673ba3a9ec Author: Marcus Cavanaugh Desc: Bug 1061083 - [Clock] Edit Alarm screen does not responding after adding Alarm continues. ======== https://hg.mozilla.org/integration/gaia-central/rev/6744f5e5e247 Author: Malini Das Desc: Merge pull request #24357 from malini/kickoff Bug 1056194 - Modify gaia Makefile to kick off runner-service and gaia-marionette, r=rickychien ======== https://hg.mozilla.org/integration/gaia-central/rev/e336b49072f1 Author: Malini Das Desc: Bug 1056194 - Modify gaia Makefile to kick off runner-service and gaia-marionette, r=rickychien ======== https://hg.mozilla.org/integration/gaia-central/rev/db1d6b1bf19a Author: Ben Francis Desc: Merge pull request #24107 from benfrancis/1043959 Bug 1043959 - Remove the browser app r=kgrandon ======== https://hg.mozilla.org/integration/gaia-central/rev/9598b11319dc Author: Ben Francis Desc: Bug 1043959 - Remove the browser app ======== https://hg.mozilla.org/integration/gaia-central/rev/191def00c76d Author: Gareth Aye Desc: Merge pull request #24519 from gaye/test-test-agent-upgrade Bug 1068236 - Bump test agent to 0.25.0 ======== https://hg.mozilla.org/integration/gaia-central/rev/e3e539d6b106 Author: gaye Desc: Bug 1068236 - Bump test agent to 0.25.0 --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index ac03683b8759..4a851635b246 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "9a50d134fe468fa859114e3396b4edae7e88052c", + "revision": "bb21b0d18717f247657c768652995c5daab83e17", "repo_path": "/integration/gaia-central" } From b7f80eaa93c624e184874e748d186a4769afc66b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 13:07:40 -0700 Subject: [PATCH 06/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index b87b7f521894..da2b13dceb33 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index c6f926b426f6..2f9e7e491762 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 68947011ca7e..cd5daf5073fc 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 45d96b85dbda..6d45eb6a0951 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index c6f926b426f6..2f9e7e491762 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 34ab98d5b4c6..7e1160df8a91 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5cc39aa02473..3c85b8a34257 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 4129777ec2ab..88c5598c8e1c 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 210802645722..e81d3eb70ebd 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index bc4ab031a98d..726d5a38da7c 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 44f7b6d32428..096837856bdb 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 128611769a931bea54d85d930fa4fcf14bc67974 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 13:17:43 -0700 Subject: [PATCH 07/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index da2b13dceb33..b70ab7c65ea2 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 2f9e7e491762..e23945f8ab97 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -25,7 +25,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index cd5daf5073fc..dbf4ba6ec326 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 6d45eb6a0951..a81fb3c5d038 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 2f9e7e491762..e23945f8ab97 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -25,7 +25,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 7e1160df8a91..88e15f0d79e0 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -23,7 +23,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 3c85b8a34257..d5fc5310cc77 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 88c5598c8e1c..74cd346ad624 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -22,7 +22,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 726d5a38da7c..8a4c70292e34 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -20,7 +20,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 096837856bdb..422d0d1be4d4 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -22,7 +22,7 @@ - + From d95ec36531eaeaec684cf4c78a5910f835270839 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 13:30:46 -0700 Subject: [PATCH 08/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/645620572c79 Author: James Burke Desc: Merge pull request #24455 from jrburke/bug1069992-email-wobbly-refresh Bug 1069992 - [E-Mail] Wobbly Refresh Icon Animation r=asuth ======== https://hg.mozilla.org/integration/gaia-central/rev/1107b3ae6cf4 Author: jrburke Desc: Bug 1069992 - [E-Mail] Wobbly Refresh Icon Animation --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4a851635b246..71f5af44a8a3 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "bb21b0d18717f247657c768652995c5daab83e17", + "revision": "645620572c79d717745671b0d21ef425147addf9", "repo_path": "/integration/gaia-central" } From 3cad34ad32e38eaa06eedede05d0725174df7f41 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 13:36:58 -0700 Subject: [PATCH 09/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index b70ab7c65ea2..ce9684cf399e 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index e23945f8ab97..ad1c39c220d2 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index dbf4ba6ec326..9c40a4bed4c6 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index a81fb3c5d038..599f3b5f1516 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index e23945f8ab97..ad1c39c220d2 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 88e15f0d79e0..555d802aa451 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index d5fc5310cc77..7c93e43b4bec 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 74cd346ad624..1f708897cbe8 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e81d3eb70ebd..322d9f39c288 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 8a4c70292e34..123c588d12c9 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 422d0d1be4d4..5edf6189cfb5 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 08372cd684be99781ca49b330b0556bed98f3691 Mon Sep 17 00:00:00 2001 From: Ben Tian Date: Mon, 29 Sep 2014 18:56:48 +0800 Subject: [PATCH 10/93] Bug 1074132 - [bluetooth2] Fix build break resulting from bug 1053966, r=shuang --- dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp | 1 + dom/bluetooth2/bluez/BluetoothHfpManager.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp b/dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp index 8fbb953cffd9..1803844ca545 100644 --- a/dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp +++ b/dom/bluetooth2/bluedroid/hfp/BluetoothHfpManager.cpp @@ -27,6 +27,7 @@ #include "nsRadioInterfaceLayer.h" #include "nsServiceManagerUtils.h" #include "nsThreadUtils.h" +#include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/SettingChangeNotificationBinding.h" #define MOZSETTINGS_CHANGED_ID "mozsettings-changed" diff --git a/dom/bluetooth2/bluez/BluetoothHfpManager.cpp b/dom/bluetooth2/bluez/BluetoothHfpManager.cpp index 64cf7b1c8978..b6ebb13a964b 100644 --- a/dom/bluetooth2/bluez/BluetoothHfpManager.cpp +++ b/dom/bluetooth2/bluez/BluetoothHfpManager.cpp @@ -23,6 +23,7 @@ #include "nsIObserverService.h" #include "nsISettingsService.h" #include "nsServiceManagerUtils.h" +#include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/SettingChangeNotificationBinding.h" #ifdef MOZ_B2G_RIL From bd712567c629e80c49cad5f45845d37d7b1ea47e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 19:55:49 -0700 Subject: [PATCH 11/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/dd9804a19173 Author: RickyChien Desc: Merge pull request #24421 from RickyChien/bug-1041463 Bug 1041463 - Include a shared CSS file with @import rule r=@cctuan ======== https://hg.mozilla.org/integration/gaia-central/rev/e51d4ddcfd35 Author: Ricky Chien Desc: Bug 1041463 - Include a shared CSS file with @import rule --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 71f5af44a8a3..0b796daf16cd 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "645620572c79d717745671b0d21ef425147addf9", + "revision": "dd9804a191734f2f81b94ec57b7cbfeec01e870d", "repo_path": "/integration/gaia-central" } From c1b6278e1a52dde2a846f070272df5f40bbfc377 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 20:02:00 -0700 Subject: [PATCH 12/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ce9684cf399e..14f79d9fd021 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index ad1c39c220d2..24b4300ffc8b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 9c40a4bed4c6..0744a7bdc33a 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 599f3b5f1516..967f10504801 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index ad1c39c220d2..24b4300ffc8b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 555d802aa451..e5ced82b1531 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 7c93e43b4bec..c3c67746ec2e 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1f708897cbe8..53b0ff795cb4 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 322d9f39c288..cce44a9c8314 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 123c588d12c9..edc3694be50e 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 5edf6189cfb5..5bd37d0ec231 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 5bbbbfcab10ee5272d9695a77814bee8c286133b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kan-Ru=20Chen=20=28=E9=99=B3=E4=BE=83=E5=A6=82=29?= Date: Tue, 30 Sep 2014 11:03:53 +0800 Subject: [PATCH 13/93] Bug 1062794 - TaskTracer: Allow UNKNOWN source event id. r=khuey --HG-- extra : rebase_source : 2a1238b9b49703c1c2aecbbe8616ac8c199fe874 --- tools/profiler/GeckoTaskTracer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/profiler/GeckoTaskTracer.cpp b/tools/profiler/GeckoTaskTracer.cpp index f145ea247164..0c3a1c5565f1 100644 --- a/tools/profiler/GeckoTaskTracer.cpp +++ b/tools/profiler/GeckoTaskTracer.cpp @@ -200,7 +200,7 @@ void LogDispatch(uint64_t aTaskId, uint64_t aParentTaskId, uint64_t aSourceEventId, SourceEventType aSourceEventType) { - NS_ENSURE_TRUE_VOID(IsInitialized() && aSourceEventId); + NS_ENSURE_TRUE_VOID(IsInitialized()); // Log format: // [0 taskId dispatchTime sourceEventId sourceEventType parentTaskId] @@ -209,7 +209,7 @@ LogDispatch(uint64_t aTaskId, uint64_t aParentTaskId, uint64_t aSourceEventId, void LogBegin(uint64_t aTaskId, uint64_t aSourceEventId) { - NS_ENSURE_TRUE_VOID(IsInitialized() && aSourceEventId); + NS_ENSURE_TRUE_VOID(IsInitialized()); // Log format: // [1 taskId beginTime processId threadId] @@ -218,7 +218,7 @@ LogBegin(uint64_t aTaskId, uint64_t aSourceEventId) void LogEnd(uint64_t aTaskId, uint64_t aSourceEventId) { - NS_ENSURE_TRUE_VOID(IsInitialized() && aSourceEventId); + NS_ENSURE_TRUE_VOID(IsInitialized()); // Log format: // [2 taskId endTime] @@ -227,7 +227,7 @@ LogEnd(uint64_t aTaskId, uint64_t aSourceEventId) void LogVirtualTablePtr(uint64_t aTaskId, uint64_t aSourceEventId, int* aVptr) { - NS_ENSURE_TRUE_VOID(IsInitialized() && aSourceEventId); + NS_ENSURE_TRUE_VOID(IsInitialized()); // Log format: // [4 taskId address] From 1cd56d34666eaddbddffe9971c1b46bcdad4ea5e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 20:10:51 -0700 Subject: [PATCH 14/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c13f2800a41d Author: gasolin Desc: Merge pull request #24325 from gasolin/issue-1071445 Bug 1071445 - [Settings]Cap letter for titles on panels based on new building blocks, r=jenny ======== https://hg.mozilla.org/integration/gaia-central/rev/e632cd405923 Author: gasolin Desc: Bug 1071445 - [Settings]Cap letter for titles on panels based on new Building Blocks --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0b796daf16cd..57b7a068f724 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "dd9804a191734f2f81b94ec57b7cbfeec01e870d", + "revision": "c13f2800a41d2695fabd6c9a5c6efbf4a766bcef", "repo_path": "/integration/gaia-central" } From 0d6b83522117293d0921c5b0bb14261f5807a0fd Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 20:17:08 -0700 Subject: [PATCH 15/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 14f79d9fd021..d27595c234fb 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 24b4300ffc8b..bb9adb5cb04f 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 0744a7bdc33a..1963fd4e4a8e 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 967f10504801..3806fbe96aef 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 24b4300ffc8b..bb9adb5cb04f 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e5ced82b1531..d046002cdf91 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index c3c67746ec2e..171e0f7db99a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 53b0ff795cb4..d8ed772212dc 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index cce44a9c8314..f596d25b427e 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index edc3694be50e..f41fbfc49dea 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 5bd37d0ec231..6387d77cbf79 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From e7d3651ab39cc08c180c1cde427add4dda07dd81 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 20:55:48 -0700 Subject: [PATCH 16/93] Bumping gaia.json for 6 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/0602502c66fa Author: GaryChen, PYChen, Gary Desc: Merge pull request #24254 from msliu/bug-1070791-fix Bug 1070791 - [camera] Face Detection box is not disappear without face ... r=justindarc. ======== https://hg.mozilla.org/integration/gaia-central/rev/fbe0079e3837 Author: vincentliu Desc: Bug 1070791 - [camera] Face Detection box is not disappear without face after taking a picture. r=justindarc ======== https://hg.mozilla.org/integration/gaia-central/rev/be14cd7510cf Author: James Burke Desc: Merge pull request #24534 from jrburke/bug1074432-email-nomail-loadmore Bug 1074432 - [email] display of unsynced folder has overlapping messages r=asuth ======== https://hg.mozilla.org/integration/gaia-central/rev/63e3cbde89dc Author: jrburke Desc: Bug 1074432 - [email] display of unsynced folder has overlapping messages ======== https://hg.mozilla.org/integration/gaia-central/rev/a5d2ad3a9cf1 Author: Arthur Chen Desc: Merge pull request #24417 from crh0716/1064463 Bug 1064463 - Do not set caller id explicitly when users preference is not available r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/3ba8922ca843 Author: Arthur Chen Desc: Bug 1064463 - Do not set caller id explicitly when users preference is not available --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 57b7a068f724..67c47f164415 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "c13f2800a41d2695fabd6c9a5c6efbf4a766bcef", + "revision": "0602502c66fadbd0cc359acae0cdc00fac02eb77", "repo_path": "/integration/gaia-central" } From 006e337aca7910e782840a3e1efc4c33ef6cae01 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 21:01:59 -0700 Subject: [PATCH 17/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index d27595c234fb..7a12e114cfb7 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index bb9adb5cb04f..ed675686139b 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 1963fd4e4a8e..71f3eab34696 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 3806fbe96aef..722028d16ccc 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index bb9adb5cb04f..ed675686139b 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index d046002cdf91..5a4f21d46c7d 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 171e0f7db99a..77578945528f 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index d8ed772212dc..6c679fa4a77f 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index f596d25b427e..5ea63cfe445b 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index f41fbfc49dea..7f6574a18cf8 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 6387d77cbf79..a1f319a677d8 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 41cf9be3e485dc1f0d8debdc38838990e17ab0f1 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 23:10:48 -0700 Subject: [PATCH 18/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/f080dc22664f Author: Min-Zhong "John" Lu Desc: Merge pull request #24537 from mnjul/bug_1074095_highlite_last_alt_key_at_container_area Bug 1074095 - Return the last alt key object when the UserPress is on some empty area of alt char menu container. r=rudyl ======== https://hg.mozilla.org/integration/gaia-central/rev/b72411407bb5 Author: John Lu [:mnjul] Desc: Bug 1074095 - Return the last alt key object when the UserPress is on some empty area of alt char menu container. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 67c47f164415..b0a94fb70c2c 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "0602502c66fadbd0cc359acae0cdc00fac02eb77", + "revision": "f080dc22664f0acf83b5cf182e8c27a5096321e0", "repo_path": "/integration/gaia-central" } From b3b374095d542d0ebf60f979b6bffb2a535a15ea Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 23:17:03 -0700 Subject: [PATCH 19/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 7a12e114cfb7..ab3c0548d81e 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index ed675686139b..d7bef94c95e5 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 71f3eab34696..40416fe71725 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 722028d16ccc..a753d4c6da35 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index ed675686139b..d7bef94c95e5 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 5a4f21d46c7d..061362181f0b 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 77578945528f..96fb92e3c649 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 6c679fa4a77f..b6fa21a9014d 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 5ea63cfe445b..8c0df0577468 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 7f6574a18cf8..ad72866d0bec 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index a1f319a677d8..19a68d29c72b 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 2a6f9f67676391f3022b01e26808cc47b35ff889 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 23:25:48 -0700 Subject: [PATCH 20/93] Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/67f8d9010727 Author: Kevin Grandon Desc: Bug 1068236 - Follow-up, bump package.json r=kgrandon --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index b0a94fb70c2c..fd86332065e1 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "f080dc22664f0acf83b5cf182e8c27a5096321e0", + "revision": "67f8d9010727be75d91984adf445558b0b9ca6f5", "repo_path": "/integration/gaia-central" } From 9e93a5354fd22ff8cf69da4a1a2918f2239e23d1 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Mon, 29 Sep 2014 23:31:59 -0700 Subject: [PATCH 21/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index ab3c0548d81e..47ebcedaa3d7 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index d7bef94c95e5..dc2021b39ce7 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 40416fe71725..dac51d36cfd6 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index a753d4c6da35..6cf6d746f87f 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index d7bef94c95e5..dc2021b39ce7 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 061362181f0b..86d9565da24e 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 96fb92e3c649..ecbf100c8aed 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b6fa21a9014d..457951a1e31b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 8c0df0577468..e5a269941c97 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index ad72866d0bec..1ea220cea732 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 19a68d29c72b..12a84f38983d 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From faee76bec47137e65c82b0b9f6cbb5ada83c5f42 Mon Sep 17 00:00:00 2001 From: Yoshi Huang Date: Fri, 26 Sep 2014 17:59:36 +0800 Subject: [PATCH 22/93] Bug 1073416 - B2G NFC: remove getDetailsNDEF impl. r=dimi From 59914a177ef8efdf569829fd46cbdd5659517bc6 Mon Sep 17 00:00:00 2001 --- dom/nfc/NfcContentHelper.js | 41 -------------------------------------- dom/nfc/gonk/Nfc.js | 5 ----- dom/nfc/gonk/NfcGonkMessage.h | 4 +--- dom/nfc/gonk/NfcMessageHandler.cpp | 36 --------------------------------- dom/nfc/gonk/NfcMessageHandler.h | 2 -- dom/nfc/nsINfcContentHelper.idl | 3 +-- 6 files changed, 2 insertions(+), 89 deletions(-) --- dom/nfc/NfcContentHelper.js | 41 ------------------------------ dom/nfc/gonk/Nfc.js | 5 ---- dom/nfc/gonk/NfcGonkMessage.h | 4 +-- dom/nfc/gonk/NfcMessageHandler.cpp | 36 -------------------------- dom/nfc/gonk/NfcMessageHandler.h | 2 -- dom/nfc/nsINfcContentHelper.idl | 3 +-- 6 files changed, 2 insertions(+), 89 deletions(-) diff --git a/dom/nfc/NfcContentHelper.js b/dom/nfc/NfcContentHelper.js index be2207b060fb..45411f116b01 100644 --- a/dom/nfc/NfcContentHelper.js +++ b/dom/nfc/NfcContentHelper.js @@ -50,7 +50,6 @@ const NFCCONTENTHELPER_CID = const NFC_IPC_MSG_NAMES = [ "NFC:ReadNDEFResponse", "NFC:WriteNDEFResponse", - "NFC:GetDetailsNDEFResponse", "NFC:MakeReadOnlyNDEFResponse", "NFC:ConnectResponse", "NFC:CloseResponse", @@ -64,17 +63,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "cpmm", "@mozilla.org/childprocessmessagemanager;1", "nsISyncMessageSender"); -function GetDetailsNDEFResponse(details) { - this.canBeMadeReadOnly = details.canBeMadeReadOnly; - this.isReadOnly = details.isReadOnly; - this.maxSupportedLength = details.maxSupportedLength; -} -GetDetailsNDEFResponse.prototype = { - __exposedProps__ : {canBeMadeReadOnly: 'r', - isReadOnly: 'r', - maxSupportedLength: 'r'} -}; - function NfcContentHelper() { this.initDOMRequestHelper(/* aWindow */ null, NFC_IPC_MSG_NAMES); Services.obs.addObserver(this, "xpcom-shutdown", false); @@ -127,22 +115,6 @@ NfcContentHelper.prototype = { }, // NFCTag interface - getDetailsNDEF: function getDetailsNDEF(window, sessionToken) { - if (window == null) { - throw Components.Exception("Can't get window object", - Cr.NS_ERROR_UNEXPECTED); - } - let request = Services.DOMRequest.createRequest(window); - let requestId = btoa(this.getRequestId(request)); - this._requestMap[requestId] = window; - - cpmm.sendAsyncMessage("NFC:GetDetailsNDEF", { - requestId: requestId, - sessionToken: sessionToken - }); - return request; - }, - readNDEF: function readNDEF(window, sessionToken) { if (window == null) { throw Components.Exception("Can't get window object", @@ -395,9 +367,6 @@ NfcContentHelper.prototype = { case "NFC:ReadNDEFResponse": this.handleReadNDEFResponse(result); break; - case "NFC:GetDetailsNDEFResponse": - this.handleGetDetailsNDEFResponse(result); - break; case "NFC:CheckP2PRegistrationResponse": this.handleCheckP2PRegistrationResponse(result); break; @@ -452,16 +421,6 @@ NfcContentHelper.prototype = { this.fireRequestSuccess(requestId, ndefMsg); }, - handleGetDetailsNDEFResponse: function handleGetDetailsNDEFResponse(result) { - if (result.errorMsg) { - this.fireRequestError(atob(result.requestId), result.errorMsg); - return; - } - - let requestId = atob(result.requestId); - this.fireRequestSuccess(requestId, new GetDetailsNDEFResponse(result)); - }, - handleCheckP2PRegistrationResponse: function handleCheckP2PRegistrationResponse(result) { // Privilaged status API. Always fire success to avoid using exposed props. // The receiver must check the boolean mapped status code to handle. diff --git a/dom/nfc/gonk/Nfc.js b/dom/nfc/gonk/Nfc.js index 01f286c2f0e7..33e3f0594d62 100644 --- a/dom/nfc/gonk/Nfc.js +++ b/dom/nfc/gonk/Nfc.js @@ -57,7 +57,6 @@ const NFC_IPC_MSG_NAMES = [ const NFC_IPC_READ_PERM_MSG_NAMES = [ "NFC:ReadNDEF", - "NFC:GetDetailsNDEF", "NFC:Connect", "NFC:Close", ]; @@ -538,7 +537,6 @@ Nfc.prototype = { break; case "ConnectResponse": // Fall through. case "CloseResponse": - case "GetDetailsNDEFResponse": case "ReadNDEFResponse": case "MakeReadOnlyNDEFResponse": case "WriteNDEFResponse": @@ -608,9 +606,6 @@ Nfc.prototype = { this.setConfig({powerLevel: NFC.NFC_POWER_LEVEL_DISABLED, requestId: message.data.requestId}); break; - case "NFC:GetDetailsNDEF": - this.sendToNfcService("getDetailsNDEF", message.data); - break; case "NFC:ReadNDEF": this.sendToNfcService("readNDEF", message.data); break; diff --git a/dom/nfc/gonk/NfcGonkMessage.h b/dom/nfc/gonk/NfcGonkMessage.h index c581b4182153..4baeead30858 100644 --- a/dom/nfc/gonk/NfcGonkMessage.h +++ b/dom/nfc/gonk/NfcGonkMessage.h @@ -8,13 +8,12 @@ namespace mozilla { #define NFCD_MAJOR_VERSION 1 -#define NFCD_MINOR_VERSION 9 +#define NFCD_MINOR_VERSION 10 enum NfcRequest { ConfigReq = 0, ConnectReq, CloseReq, - GetDetailsNDEFReq, ReadNDEFReq, WriteNDEFReq, MakeReadOnlyNDEFReq, @@ -23,7 +22,6 @@ enum NfcRequest { enum NfcResponse { GeneralRsp = 1000, ConfigRsp, - GetDetailsNDEFRsp, ReadNDEFRsp, }; diff --git a/dom/nfc/gonk/NfcMessageHandler.cpp b/dom/nfc/gonk/NfcMessageHandler.cpp index 4785241304de..c1e349d7886d 100644 --- a/dom/nfc/gonk/NfcMessageHandler.cpp +++ b/dom/nfc/gonk/NfcMessageHandler.cpp @@ -17,7 +17,6 @@ using namespace mozilla; using namespace mozilla::dom; static const char* kConfigRequest = "config"; -static const char* kGetDetailsNDEF = "getDetailsNDEF"; static const char* kReadNDEFRequest = "readNDEF"; static const char* kWriteNDEFRequest = "writeNDEF"; static const char* kMakeReadOnlyNDEFRequest = "makeReadOnlyNDEF"; @@ -25,7 +24,6 @@ static const char* kConnectRequest = "connect"; static const char* kCloseRequest = "close"; static const char* kConfigResponse = "ConfigResponse"; -static const char* kGetDetailsNDEFResponse = "GetDetailsNDEFResponse"; static const char* kReadNDEFResponse = "ReadNDEFResponse"; static const char* kWriteNDEFResponse = "WriteNDEFResponse"; static const char* kMakeReadOnlyNDEFResponse = "MakeReadOnlyNDEFResponse"; @@ -46,8 +44,6 @@ NfcMessageHandler::Marshall(Parcel& aParcel, const CommandOptions& aOptions) if (!strcmp(type, kConfigRequest)) { result = ConfigRequest(aParcel, aOptions); - } else if (!strcmp(type, kGetDetailsNDEF)) { - result = GetDetailsNDEFRequest(aParcel, aOptions); } else if (!strcmp(type, kReadNDEFRequest)) { result = ReadNDEFRequest(aParcel, aOptions); } else if (!strcmp(type, kWriteNDEFRequest)) { @@ -83,9 +79,6 @@ NfcMessageHandler::Unmarshall(const Parcel& aParcel, EventOptions& aOptions) case NfcResponse::ConfigRsp: result = ConfigResponse(aParcel, aOptions); break; - case NfcResponse::GetDetailsNDEFRsp: - result = GetDetailsNDEFResponse(aParcel, aOptions); - break; case NfcResponse::ReadNDEFRsp: result = ReadNDEFResponse(aParcel, aOptions); break; @@ -171,35 +164,6 @@ NfcMessageHandler::ConfigResponse(const Parcel& aParcel, EventOptions& aOptions) return true; } -bool -NfcMessageHandler::GetDetailsNDEFRequest(Parcel& aParcel, const CommandOptions& aOptions) -{ - aParcel.writeInt32(NfcRequest::GetDetailsNDEFReq); - aParcel.writeInt32(aOptions.mSessionId); - mRequestIdQueue.AppendElement(aOptions.mRequestId); - return true; -} - -bool -NfcMessageHandler::GetDetailsNDEFResponse(const Parcel& aParcel, EventOptions& aOptions) -{ - aOptions.mType = NS_ConvertUTF8toUTF16(kGetDetailsNDEFResponse); - aOptions.mStatus = aParcel.readInt32(); - aOptions.mSessionId = aParcel.readInt32(); - - if (aOptions.mStatus == NfcErrorCode::Success) { - int readOnly = aParcel.readInt32(); - aOptions.mIsReadOnly = readOnly & 0xff; - aOptions.mCanBeMadeReadOnly = (readOnly >> 8) & 0xff; - aOptions.mMaxSupportedLength = aParcel.readInt32(); - } - - NS_ENSURE_TRUE(!mRequestIdQueue.IsEmpty(), false); - aOptions.mRequestId = mRequestIdQueue[0]; - mRequestIdQueue.RemoveElementAt(0); - return true; -} - bool NfcMessageHandler::ReadNDEFRequest(Parcel& aParcel, const CommandOptions& aOptions) { diff --git a/dom/nfc/gonk/NfcMessageHandler.h b/dom/nfc/gonk/NfcMessageHandler.h index 818552cb1847..03fa2f113007 100644 --- a/dom/nfc/gonk/NfcMessageHandler.h +++ b/dom/nfc/gonk/NfcMessageHandler.h @@ -27,8 +27,6 @@ private: bool GeneralResponse(const android::Parcel& aParcel, EventOptions& aOptions); bool ConfigRequest(android::Parcel& aParcel, const CommandOptions& options); bool ConfigResponse(const android::Parcel& aParcel, EventOptions& aOptions); - bool GetDetailsNDEFRequest(android::Parcel& aParcel, const CommandOptions& options); - bool GetDetailsNDEFResponse(const android::Parcel& aParcel, EventOptions& aOptions); bool ReadNDEFRequest(android::Parcel& aParcel, const CommandOptions& options); bool ReadNDEFResponse(const android::Parcel& aParcel, EventOptions& aOptions); bool WriteNDEFRequest(android::Parcel& aParcel, const CommandOptions& options); diff --git a/dom/nfc/nsINfcContentHelper.idl b/dom/nfc/nsINfcContentHelper.idl index 34d8d0776aa4..148f5c4b6aee 100644 --- a/dom/nfc/nsINfcContentHelper.idl +++ b/dom/nfc/nsINfcContentHelper.idl @@ -27,7 +27,7 @@ interface nsINfcDOMEventTarget : nsISupports void notifyPeerLost(in DOMString sessionToken); }; -[scriptable, uuid(7eaf4c31-e1d1-422e-aa55-181f4eb156b0)] +[scriptable, uuid(d3f1bdc1-048f-44a8-abe2-bc386edce40b)] interface nsINfcContentHelper : nsISupports { const long NFC_EVENT_PEER_READY = 0x01; @@ -35,7 +35,6 @@ interface nsINfcContentHelper : nsISupports boolean checkSessionToken(in DOMString sessionToken); - nsIDOMDOMRequest getDetailsNDEF(in nsIDOMWindow window, in DOMString sessionToken); nsIDOMDOMRequest readNDEF(in nsIDOMWindow window, in DOMString sessionToken); nsIDOMDOMRequest writeNDEF(in nsIDOMWindow window, in nsIVariant records, in DOMString sessionToken); nsIDOMDOMRequest makeReadOnlyNDEF(in nsIDOMWindow window, in DOMString sessionToken); From 4ab587c58a11ba3164fa3a0f794ddcd6ea664a68 Mon Sep 17 00:00:00 2001 From: Alexandre Lissy Date: Mon, 29 Sep 2014 05:27:00 +0200 Subject: [PATCH 23/93] Bug 1059546 - Add settings/pref mapping for signed apps origins. r=fabrice For testing purpose, we need to add the stage marketplace instance as a valid source for signed apps. We do this by setting the pref value when building the Gaia engineering profile. --- b2g/chrome/content/settings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js index a762748a5104..dea9a5a0a3dd 100644 --- a/b2g/chrome/content/settings.js +++ b/b2g/chrome/content/settings.js @@ -486,6 +486,7 @@ let settingsToObserve = { resetToPref: true }, 'dom.mozApps.use_reviewer_certs': false, + 'dom.mozApps.signed_apps_installable_from': 'https://marketplace.firefox.com', 'layers.draw-borders': false, 'layers.draw-tile-borders': false, 'layers.dump': false, From 127cbafcecd6a5b081ef86b5d12cd8ebffa6d533 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 02:25:48 -0700 Subject: [PATCH 24/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c7c5a55825a6 Author: Carsten Book Desc: Merge pull request #24510 from lissyx/bug1059546 Bug 1059546 - Set proper mozApps signed origins for eng builds. r=rchien ======== https://hg.mozilla.org/integration/gaia-central/rev/b27ceea86da2 Author: Alexandre Lissy Desc: Bug 1059546 - Set proper mozApps signed origins for eng builds r=rchien Engineering builds needs to accept signed apps from stage Marketplace for testing purpose. This depends on Gecko having a proper setting-to-pref mapping for dom.mozApps.signed_apps_installable_from. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index fd86332065e1..00cdb123e834 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "67f8d9010727be75d91984adf445558b0b9ca6f5", + "revision": "c7c5a55825a67f1eea0c7f9e8b454a62ff479f21", "repo_path": "/integration/gaia-central" } From 25d8540403afd0b53a32e82a6f9be4b513775c7b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 02:31:59 -0700 Subject: [PATCH 25/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 47ebcedaa3d7..2f643598ccc0 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index dc2021b39ce7..354847e34d6a 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index dac51d36cfd6..cb07452a7980 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 6cf6d746f87f..86d4de21bddf 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index dc2021b39ce7..354847e34d6a 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 86d9565da24e..e4933201a52c 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index ecbf100c8aed..fb8037e3f0bb 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 457951a1e31b..5592d8d855ec 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index e5a269941c97..87bf067d6cc9 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 1ea220cea732..6b8eacf59ed6 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 12a84f38983d..d5a4dc5e43e3 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 30126173d91304aad9c034104ab4054438b55da7 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 02:40:47 -0700 Subject: [PATCH 26/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/212476302b9f Author: viorelaioia Desc: Merge pull request #24545 from chirarobert/disable_on_tbpl Bug 1074654 - [v2.2] Disable test_ftu_with_tour.py on desktop ======== https://hg.mozilla.org/integration/gaia-central/rev/52c288a59710 Author: Robert Chira Desc: Bug 1074654 - [v2.2] Disable test_ftu_with_tour.py on desktop --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 00cdb123e834..2f66af589fa4 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "c7c5a55825a67f1eea0c7f9e8b454a62ff479f21", + "revision": "212476302b9f03ef9ddba21bcc3595bf2953ffca", "repo_path": "/integration/gaia-central" } From 004286722e5c8645ae12e4a8b2d32211211ac01e Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 02:42:39 -0700 Subject: [PATCH 27/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 2f643598ccc0..46db3a3f3e40 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 354847e34d6a..2456d63349af 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index cb07452a7980..bb007da7184b 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 86d4de21bddf..b9716d4d0c42 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 354847e34d6a..2456d63349af 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index e4933201a52c..ab3c76be3d1c 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index fb8037e3f0bb..d5cebda29c7b 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 5592d8d855ec..7181f4f71c92 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 87bf067d6cc9..5d553e8cf022 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 6b8eacf59ed6..942cf7b4f70e 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index d5a4dc5e43e3..0795e28a3f02 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 1526dfbffe400a9c70fe6c41af69dc2a7c8f618a Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 03:10:48 -0700 Subject: [PATCH 28/93] Bumping gaia.json for 3 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/ac150c74648f Author: albertopq Desc: Merge pull request #24393 from albertopq/1007948-sim-error-msg Bug 1007948 - SIM Error message disappears on iccinfochange r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/c07c68153a04 Author: albertopq Desc: Bug 1007948 - SIM Error message disappears on iccinfochange ======== https://hg.mozilla.org/integration/gaia-central/rev/12d9ae8bdc32 Author: BavarianTomcat Desc: Revert "Bug 1068236 - Follow-up, bump package.json r=kgrandon" for unit test failures This reverts commit 8f452cbfb9049ffab7adc5c9283d373fbbbedafd. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 2f66af589fa4..4566f2eeefcc 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "212476302b9f03ef9ddba21bcc3595bf2953ffca", + "revision": "ac150c74648fd73fa4f7c85cad794306db0c3ed1", "repo_path": "/integration/gaia-central" } From 7d53a1a8b928f0aeb0ed0be8e504e092973ae127 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 03:17:06 -0700 Subject: [PATCH 29/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 46db3a3f3e40..4fe489bcadd2 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 2456d63349af..a95bad518f8f 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index bb007da7184b..7d938199ce5f 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index b9716d4d0c42..25e9cdc73a2c 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 2456d63349af..a95bad518f8f 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index ab3c76be3d1c..995f0abb5581 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index d5cebda29c7b..6e750ae6cfc5 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 7181f4f71c92..999e88c26f47 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 5d553e8cf022..c6d780ecd0f5 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 942cf7b4f70e..de28c88c61ce 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 0795e28a3f02..5327754cddb5 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 41742602a264d1eb337ab4f299a4418b6108c252 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 04:10:47 -0700 Subject: [PATCH 30/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/3b3fad17a78c Author: Guillaume C. Marty Desc: Merge pull request #24512 from gmarty/Bug-1073566-Utility-Tray-Alignment-header-text Bug 1073566 - [Utility Tray] Alignment of header text ======== https://hg.mozilla.org/integration/gaia-central/rev/e1753292059a Author: Guillaume Marty Desc: Bug 1073566 - [Utility Tray] Alignment of header text --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 4566f2eeefcc..1642bccefbab 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "ac150c74648fd73fa4f7c85cad794306db0c3ed1", + "revision": "3b3fad17a78c6dac6e07455ebade21975ee6eaa9", "repo_path": "/integration/gaia-central" } From 298437faf13a828f0599f60a01f873fbe9e9bd4d Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 04:21:58 -0700 Subject: [PATCH 31/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 4fe489bcadd2..f26bdb421133 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index a95bad518f8f..8cc24f2ba794 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 7d938199ce5f..ef2f6650474a 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 25e9cdc73a2c..8bb4becb12ae 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index a95bad518f8f..8cc24f2ba794 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 995f0abb5581..f2760fe31f87 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 6e750ae6cfc5..bd0b9c8b6284 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 999e88c26f47..e3cf9729df9b 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index c6d780ecd0f5..bdf0e13f2c5c 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index de28c88c61ce..fcec0ca39412 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 5327754cddb5..eb088262f6f2 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 556b82355386aab7b0b5bbde2b414984882cd465 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 04:32:32 -0700 Subject: [PATCH 32/93] Bumping manifests a=b2g-bump --- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index ef2f6650474a..382d2aabe04d 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -134,7 +134,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index f2760fe31f87..0ebb8a1dddc3 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -151,7 +151,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index bd0b9c8b6284..784ff40b6470 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -145,7 +145,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index fcec0ca39412..c70082dc11e1 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -129,7 +129,7 @@ - + From 8f3b622d52e7c9ab567b2f520cda78acb2e434b7 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 07:55:37 -0700 Subject: [PATCH 33/93] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/7ec4d2496a17 Author: Ryan VanderMeulen Desc: Merge pull request #24413 from makotokato/text-selection-value-selector Bug 1072759 - [Text Selection] text_selection should handle value-select... ======== https://hg.mozilla.org/integration/gaia-central/rev/650d1844fb70 Author: Makoto Kato Desc: Bug 1072759 - [Text Selection] text_selection should handle value-selector-shown event. r=alive ======== https://hg.mozilla.org/integration/gaia-central/rev/f313e9447b5e Author: Ryan VanderMeulen Desc: Merge pull request #24523 from punamdahiya/Bug1072013 Bug1072013-[Video]-Opening the video app or tapping the camera icon will cause a white screen transition r=hub ======== https://hg.mozilla.org/integration/gaia-central/rev/651ca13fbf78 Author: Punam Dahiya Desc: Bug1072013-[Video]-Opening the video app or tapping the camera icon will cause a white screen transition r=hub --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 1642bccefbab..36b7ab5da8f6 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "3b3fad17a78c6dac6e07455ebade21975ee6eaa9", + "revision": "7ec4d2496a178f0117d4fc11f3888a5dad30ae35", "repo_path": "/integration/gaia-central" } From 5da1658d9bd620ef28c1d571b3a2d1a1f103583b Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 08:06:58 -0700 Subject: [PATCH 34/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index f26bdb421133..a3eec28de4ca 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 8cc24f2ba794..55971b3a7a9f 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 382d2aabe04d..b7e631108ac2 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 8bb4becb12ae..f9f02814a160 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 8cc24f2ba794..55971b3a7a9f 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 0ebb8a1dddc3..4db4c48d3792 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 784ff40b6470..e1676453c9d3 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index e3cf9729df9b..2cf354022e55 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index bdf0e13f2c5c..4d0979793e19 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index c70082dc11e1..29527790a13c 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index eb088262f6f2..3353485cd120 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From b2c0d28a18b69076398692206488945fdd9924bd Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 08:10:51 -0700 Subject: [PATCH 35/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/6cac64d632fe Author: Florin Strugariu Desc: Merge pull request #24565 from viorelaioia/bug_1074815 Bug 1074815 - Update tests as browser app was removed ======== https://hg.mozilla.org/integration/gaia-central/rev/e20a577ccbfe Author: Viorela Ioia Desc: Bug 1074815 - Update tests as browser app was removed --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 36b7ab5da8f6..02ed255ce4e7 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "7ec4d2496a178f0117d4fc11f3888a5dad30ae35", + "revision": "6cac64d632feb58d85948de9cffab1e2a7438653", "repo_path": "/integration/gaia-central" } From 9d11f776fed627577262413788b12a47dd3c1df4 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 08:17:07 -0700 Subject: [PATCH 36/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index a3eec28de4ca..0378402e560c 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 55971b3a7a9f..df64315e10d7 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index b7e631108ac2..985c9ec18c8d 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index f9f02814a160..cfd14d66aadd 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 55971b3a7a9f..df64315e10d7 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 4db4c48d3792..4adeed2f5abb 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index e1676453c9d3..5d5cd18c9372 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 2cf354022e55..b541c368fabe 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 4d0979793e19..cb657d35664a 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 29527790a13c..0bd2647903c6 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 3353485cd120..2e8adc5fce35 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 2979809005378d3d9825c268feaef63263047111 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 08:25:48 -0700 Subject: [PATCH 37/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/c7792529a7fa Author: Gabriele Svelto Desc: Merge pull request #24548 from gabrielesvelto/bug-1072884-remove-keyboard-ftu-enabled-setting Bug 1072884 - Remove all uses of the obsolete 'keyboard.ftu.enabled' setting r=timdream ======== https://hg.mozilla.org/integration/gaia-central/rev/a604d359eb60 Author: Gabriele Svelto Desc: Bug 1072884 - Remove all uses of the obsolete 'keyboard.ftu.enabled' setting r=timdream --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 02ed255ce4e7..1c6085d8b0fb 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "6cac64d632feb58d85948de9cffab1e2a7438653", + "revision": "c7792529a7faf82df772b98620057ede76a61825", "repo_path": "/integration/gaia-central" } From d242c0d782f75597b0aca26bd79a9896fcfad16c Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 08:37:07 -0700 Subject: [PATCH 38/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 0378402e560c..84d08ad2b002 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index df64315e10d7..d95ea15d60b7 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 985c9ec18c8d..97c765bd3fe6 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index cfd14d66aadd..cadaf759ad02 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index df64315e10d7..d95ea15d60b7 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 4adeed2f5abb..2563b562ce9e 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 5d5cd18c9372..9f157f8ee6cd 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index b541c368fabe..001f7a240738 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index cb657d35664a..d402b3139476 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 0bd2647903c6..0a80606a950a 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 2e8adc5fce35..223e249c2366 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From b898992b705a750031c2c203b165202c9eced828 Mon Sep 17 00:00:00 2001 From: Yoshi Huang Date: Tue, 30 Sep 2014 19:23:08 +0800 Subject: [PATCH 39/93] Bug 1074778 - B2G NFC: typo for msg in removeEventTarget. r=vchang --- dom/nfc/gonk/Nfc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/nfc/gonk/Nfc.js b/dom/nfc/gonk/Nfc.js index 33e3f0594d62..e52c264666a9 100644 --- a/dom/nfc/gonk/Nfc.js +++ b/dom/nfc/gonk/Nfc.js @@ -262,7 +262,7 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () { if (message.name == "child-process-shutdown") { this.removePeerTarget(message.target); this.nfc.removeTarget(message.target); - this.removeEventTarget(msg.target); + this.removeEventTarget(message.target); return null; } From af589fca758ec2680ca09a96deaf225150066b20 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 09:03:45 -0700 Subject: [PATCH 40/93] Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/5e44ca068953 Author: Aleh Zasypkin Desc: Merge pull request #24563 from azasypkin/bug-1074790-revoke-blob-url Bug 1074790 - [Messages] We should revoke contact image blob URL when contact or its image is removed. r=julien ======== https://hg.mozilla.org/integration/gaia-central/rev/b46116f2080c Author: Aleh Zasypkin Desc: Bug 1074790 - [Messages] We should revoke contact image blob URL when contact or its image is removed. r=julien ======== https://hg.mozilla.org/integration/gaia-central/rev/735d5446ac6d Author: Kevin Grandon Desc: Merge pull request #24532 from KevinGrandon/bug_1074512_handle_search_app_filter Bug 1074512 - [TaskManager] Allow search app role in filter ======== https://hg.mozilla.org/integration/gaia-central/rev/f54976d12763 Author: Kevin Grandon Desc: Bug 1074512 - [TaskManager] Allow search app role in filter r=aus --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 1c6085d8b0fb..16d96f581424 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "c7792529a7faf82df772b98620057ede76a61825", + "revision": "5e44ca06895398245327073a42f80cd3fb77d101", "repo_path": "/integration/gaia-central" } From c84c62e407042e7d159ce8b027569e6106383085 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 09:04:00 -0700 Subject: [PATCH 41/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 84d08ad2b002..31b5b87d2e79 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index d95ea15d60b7..5e750d6a9ea8 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 97c765bd3fe6..bca374eb1551 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index cadaf759ad02..e7c5ebac7b1c 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index d95ea15d60b7..5e750d6a9ea8 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 2563b562ce9e..dc8578fa87c9 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 9f157f8ee6cd..21ddcb495c73 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 001f7a240738..1ea776a9b707 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index d402b3139476..62896753c864 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 0a80606a950a..a51a90ad967e 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 223e249c2366..403a77363f6a 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 38ff59f01df92c2037a0f5dc7e7b786cfa42dfe8 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 30 Sep 2014 12:25:41 -0400 Subject: [PATCH 42/93] Bug 1073094 - Disable jsloader.reuseGlobal on debug builds, r=khuey --- b2g/app/b2g.js | 3 +++ dom/resourcestats/ResourceStatsDB.jsm | 1 + js/xpconnect/loader/mozJSComponentLoader.cpp | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 998054a207e3..6416a3af429f 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -827,8 +827,11 @@ pref("network.gonk.manage-offline-status", true); // On Firefox Mulet, we can't enable shared JSM scope // as it breaks most Firefox JSMs (see bug 961777) #ifndef MOZ_MULET +// Break any JSMs or JS components that rely on shared scope +#ifndef DEBUG pref("jsloader.reuseGlobal", true); #endif +#endif // Enable font inflation for browser tab content. pref("font.size.inflation.minTwips", 120); diff --git a/dom/resourcestats/ResourceStatsDB.jsm b/dom/resourcestats/ResourceStatsDB.jsm index 8b576ef9a9d2..a4ee943ca6f0 100644 --- a/dom/resourcestats/ResourceStatsDB.jsm +++ b/dom/resourcestats/ResourceStatsDB.jsm @@ -14,6 +14,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Cu.import("resource://gre/modules/IndexedDBHelper.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.importGlobalProperties(["indexedDB"]); XPCOMUtils.defineLazyServiceGetter(this, "appsService", "@mozilla.org/AppsService;1", diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 36735703dd91..9f032a22e6a3 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -389,7 +389,8 @@ mozJSComponentLoader::ReallyInit() // XXXkhuey B2G child processes have some sort of preferences race that // results in getting the wrong value. // But we don't want that on Firefox Mulet as it break most Firefox JSMs... -#if defined(MOZ_B2G) && !defined(MOZ_MULET) + // Also disable on debug builds to break js components that rely on this. +#if defined(MOZ_B2G) && !defined(MOZ_MULET) && !defined(DEBUG) mReuseLoaderGlobal = true; #endif From 86e3b61ea23ef8e642358fddb84057e83742e265 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Thu, 26 Jun 2014 05:07:23 -0400 Subject: [PATCH 43/93] Bug 1041085 - FM RDS support in HAL, r=dhylands --- hal/Hal.cpp | 36 ++++++ hal/Hal.h | 26 +++++ hal/HalTypes.h | 2 + hal/fallback/FallbackFMRadio.cpp | 8 ++ hal/gonk/GonkFMRadio.cpp | 190 +++++++++++++++++++++++++++++++ hal/sandbox/PHal.ipdl | 7 ++ hal/sandbox/SandboxHal.cpp | 12 ++ 7 files changed, 281 insertions(+) diff --git a/hal/Hal.cpp b/hal/Hal.cpp index f09d5f622de7..790af80847d9 100644 --- a/hal/Hal.cpp +++ b/hal/Hal.cpp @@ -1004,12 +1004,15 @@ ProcessPriorityToString(ProcessPriority aPriority, } static StaticAutoPtr > sFMRadioObservers; +static StaticAutoPtr > sFMRadioRDSObservers; static void InitializeFMRadioObserver() { if (!sFMRadioObservers) { sFMRadioObservers = new ObserverList; + sFMRadioRDSObservers = new ObserverList; + ClearOnShutdown(&sFMRadioRDSObservers); ClearOnShutdown(&sFMRadioObservers); } } @@ -1034,6 +1037,27 @@ NotifyFMRadioStatus(const FMRadioOperationInformation& aFMRadioState) { sFMRadioObservers->Broadcast(aFMRadioState); } +void +RegisterFMRadioRDSObserver(FMRadioRDSObserver* aFMRadioRDSObserver) { + AssertMainThread(); + InitializeFMRadioObserver(); + sFMRadioRDSObservers->AddObserver(aFMRadioRDSObserver); +} + +void +UnregisterFMRadioRDSObserver(FMRadioRDSObserver* aFMRadioRDSObserver) { + AssertMainThread(); + InitializeFMRadioObserver(); + sFMRadioRDSObservers->RemoveObserver(aFMRadioRDSObserver); +} + + +void +NotifyFMRadioRDSGroup(const FMRadioRDSGroup& aRDSGroup) { + InitializeFMRadioObserver(); + sFMRadioRDSObservers->Broadcast(aRDSGroup); +} + void EnableFMRadio(const FMRadioSettings& aInfo) { AssertMainThread(); @@ -1088,6 +1112,18 @@ CancelFMRadioSeek() { PROXY_IF_SANDBOXED(CancelFMRadioSeek()); } +void +EnableRDS(uint32_t aMask) { + AssertMainThread(); + PROXY_IF_SANDBOXED(EnableRDS(aMask)); +} + +void +DisableRDS() { + AssertMainThread(); + PROXY_IF_SANDBOXED(DisableRDS()); +} + FMRadioSettings GetFMBandSettings(FMRadioCountry aCountry) { FMRadioSettings settings; diff --git a/hal/Hal.h b/hal/Hal.h index b2aeec320198..523bd32ee01f 100644 --- a/hal/Hal.h +++ b/hal/Hal.h @@ -503,12 +503,28 @@ void RegisterFMRadioObserver(hal::FMRadioObserver* aRadioObserver); */ void UnregisterFMRadioObserver(hal::FMRadioObserver* aRadioObserver); +/** + * Register an observer for the FM radio. + */ +void RegisterFMRadioRDSObserver(hal::FMRadioRDSObserver* aRDSObserver); + +/** + * Unregister the observer for the FM radio. + */ +void UnregisterFMRadioRDSObserver(hal::FMRadioRDSObserver* aRDSObserver); + /** * Notify observers that a call to EnableFMRadio, DisableFMRadio, or FMRadioSeek * has completed, and indicate what the call returned. */ void NotifyFMRadioStatus(const hal::FMRadioOperationInformation& aRadioState); +/** + * Notify observers of new RDS data + * This can be called on any thread. + */ +void NotifyFMRadioRDSGroup(const hal::FMRadioRDSGroup& aRDSGroup); + /** * Enable the FM radio and configure it according to the settings in aInfo. */ @@ -565,6 +581,16 @@ void CancelFMRadioSeek(); */ hal::FMRadioSettings GetFMBandSettings(hal::FMRadioCountry aCountry); +/** + * Enable RDS data reception + */ +void EnableRDS(uint32_t aMask); + +/** + * Disable RDS data reception + */ +void DisableRDS(); + /** * Start a watchdog to compulsively shutdown the system if it hangs. * @param aMode Specify how to shutdown the system. diff --git a/hal/HalTypes.h b/hal/HalTypes.h index 12cfcad516c4..a33d1a2cbac1 100644 --- a/hal/HalTypes.h +++ b/hal/HalTypes.h @@ -225,7 +225,9 @@ enum FMRadioCountry { NUM_FM_RADIO_COUNTRY }; +class FMRadioRDSGroup; typedef Observer FMRadioObserver; +typedef Observer FMRadioRDSObserver; } // namespace hal } // namespace mozilla diff --git a/hal/fallback/FallbackFMRadio.cpp b/hal/fallback/FallbackFMRadio.cpp index 664928b9a777..ac9de9684b42 100644 --- a/hal/fallback/FallbackFMRadio.cpp +++ b/hal/fallback/FallbackFMRadio.cpp @@ -57,5 +57,13 @@ void CancelFMRadioSeek() {} +void +EnableRDS(uint32_t aMask) +{} + +void +DisableRDS() +{} + } // hal_impl } // namespace mozilla diff --git a/hal/gonk/GonkFMRadio.cpp b/hal/gonk/GonkFMRadio.cpp index 5f0406836769..7fd663ff2313 100644 --- a/hal/gonk/GonkFMRadio.cpp +++ b/hal/gonk/GonkFMRadio.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -49,10 +50,13 @@ uint32_t GetFMRadioFrequency(); static int sRadioFD; static bool sRadioEnabled; +static bool sRDSEnabled; static pthread_t sRadioThread; +static pthread_t sRDSThread; static hal::FMRadioSettings sRadioSettings; static int sMsmFMVersion; static bool sMsmFMMode; +static bool sRDSSupported; static int setControl(uint32_t id, int32_t value) @@ -311,6 +315,8 @@ EnableFMRadio(const hal::FMRadioSettings& aInfo) hal::NotifyFMRadioStatus(info); return; } + + sRDSSupported = cap.capabilities & V4L2_CAP_RDS_CAPTURE; sRadioSettings = aInfo; if (sMsmFMMode) { @@ -366,6 +372,9 @@ DisableFMRadio() if (!sRadioEnabled) return; + if (sRDSEnabled) + DisableRDS(); + sRadioEnabled = false; if (sMsmFMMode) { @@ -494,5 +503,186 @@ void CancelFMRadioSeek() {} +/* Runs on the rds thread */ +static void* +readRDSDataThread(void* data) +{ + v4l2_rds_data rdsblocks[16]; + uint16_t blocks[4]; + + ScopedClose pipefd((int)data); + + ScopedClose epollfd(epoll_create(2)); + if (epollfd < 0) { + HAL_LOG(("Could not create epoll FD for RDS thread (%d)", errno)); + return nullptr; + } + + epoll_event event = { + EPOLLIN, + { 0 } + }; + + event.data.fd = pipefd; + if (epoll_ctl(epollfd, EPOLL_CTL_ADD, pipefd, &event) < 0) { + HAL_LOG(("Could not set up epoll FD for RDS thread (%d)", errno)); + return nullptr; + } + + event.data.fd = sRadioFD; + if (epoll_ctl(epollfd, EPOLL_CTL_ADD, sRadioFD, &event) < 0) { + HAL_LOG(("Could not set up epoll FD for RDS thread (%d)", errno)); + return nullptr; + } + + epoll_event events[2] = {{ 0 }}; + int event_count; + uint32_t block_bitmap = 0; + while ((event_count = epoll_wait(epollfd, events, 2, -1)) > 0 || + errno == EINTR) { + bool RDSDataAvailable = false; + for (int i = 0; i < event_count; i++) { + if (events[i].data.fd == pipefd) { + if (!sRDSEnabled) + return nullptr; + char tmp[32]; + TEMP_FAILURE_RETRY(read(pipefd, tmp, sizeof(tmp))); + } else if (events[i].data.fd == sRadioFD) { + RDSDataAvailable = true; + } + } + + if (!RDSDataAvailable) + continue; + + ssize_t len = + TEMP_FAILURE_RETRY(read(sRadioFD, rdsblocks, sizeof(rdsblocks))); + if (len < 0) { + HAL_LOG(("Unexpected error while reading RDS data %d", errno)); + return nullptr; + } + + int blockcount = len / sizeof(rdsblocks[0]); + int lastblock = -1; + for (int i = 0; i < blockcount; i++) { + if ((rdsblocks[i].block & V4L2_RDS_BLOCK_MSK) == V4L2_RDS_BLOCK_INVALID || + rdsblocks[i].block & V4L2_RDS_BLOCK_ERROR) { + block_bitmap |= 1 << V4L2_RDS_BLOCK_INVALID; + continue; + } + + int blocknum = rdsblocks[i].block & V4L2_RDS_BLOCK_MSK; + // In some cases, the full set of bits in an RDS group isn't + // needed, in which case version B RDS groups can be sent. + // Version B groups replace block C with block C' (V4L2_RDS_BLOCK_C_ALT). + // Block C' always stores the PI code, so receivers can find the PI + // code more quickly/reliably. + // However, we only process whole RDS groups, so it doesn't matter here. + if (blocknum == V4L2_RDS_BLOCK_C_ALT) + blocknum = V4L2_RDS_BLOCK_C; + if (blocknum > V4L2_RDS_BLOCK_D) { + HAL_LOG(("Unexpected RDS block number %d. This is a driver bug.", + blocknum)); + continue; + } + + if (blocknum == V4L2_RDS_BLOCK_A) + block_bitmap = 0; + + // Skip the group if we skipped a block. + // This stops us from processing blocks sent out of order. + if (block_bitmap != ((1 << blocknum) - 1)) { + block_bitmap |= 1 << V4L2_RDS_BLOCK_INVALID; + continue; + } + + block_bitmap |= 1 << blocknum; + + lastblock = blocknum; + blocks[blocknum] = (rdsblocks[i].msb << 8) | rdsblocks[i].lsb; + + // Make sure we have all 4 blocks and that they're valid + if (block_bitmap != 0x0F) + continue; + + FMRadioRDSGroup group; + group.blockA() = blocks[V4L2_RDS_BLOCK_A]; + group.blockB() = blocks[V4L2_RDS_BLOCK_B]; + group.blockC() = blocks[V4L2_RDS_BLOCK_C]; + group.blockD() = blocks[V4L2_RDS_BLOCK_D]; + NotifyFMRadioRDSGroup(group); + } + } + + return nullptr; +} + +static int sRDSPipeFD; + +void +EnableRDS(uint32_t aMask) +{ + if (!sRadioEnabled || !sRDSSupported) + return; + + if (sMsmFMMode) + setControl(V4L2_CID_PRIVATE_TAVARUA_RDSGROUP_MASK, aMask); + + if (sRDSEnabled) + return; + + int pipefd[2]; + int rc = pipe2(pipefd, O_NONBLOCK); + if (rc < 0) { + HAL_LOG(("Could not create RDS thread signaling pipes (%d)", rc)); + return; + } + + ScopedClose writefd(pipefd[1]); + ScopedClose readfd(pipefd[0]); + + rc = setControl(V4L2_CID_RDS_RECEPTION, true); + if (rc < 0) { + HAL_LOG(("Could not enable RDS reception (%d)", rc)); + return; + } + + sRDSPipeFD = writefd; + + sRDSEnabled = true; + + rc = pthread_create(&sRDSThread, nullptr, + readRDSDataThread, (void*)pipefd[0]); + if (rc) { + HAL_LOG(("Could not start RDS reception thread (%d)", rc)); + setControl(V4L2_CID_RDS_RECEPTION, false); + sRDSEnabled = false; + return; + } + + readfd.forget(); + writefd.forget(); +} + +void +DisableRDS() +{ + if (!sRadioEnabled || !sRDSEnabled) + return; + + int rc = setControl(V4L2_CID_RDS_RECEPTION, false); + if (rc < 0) { + HAL_LOG(("Could not disable RDS reception (%d)", rc)); + } + + sRDSEnabled = false; + + write(sRDSPipeFD, "x", 1); + + pthread_join(sRDSThread, nullptr); + + close(sRDSPipeFD); +} + } // hal_impl } // namespace mozilla diff --git a/hal/sandbox/PHal.ipdl b/hal/sandbox/PHal.ipdl index a52d7e6ef779..f45d232ed249 100644 --- a/hal/sandbox/PHal.ipdl +++ b/hal/sandbox/PHal.ipdl @@ -69,6 +69,13 @@ struct FMRadioOperationInformation { uint32_t frequency; }; +struct FMRadioRDSGroup { + uint16_t blockA; + uint16_t blockB; + uint16_t blockC; + uint16_t blockD; +}; + struct FMRadioSettings { FMRadioCountry country; uint32_t upperLimit; diff --git a/hal/sandbox/SandboxHal.cpp b/hal/sandbox/SandboxHal.cpp index f2faba6e4e36..1f662dacfb20 100644 --- a/hal/sandbox/SandboxHal.cpp +++ b/hal/sandbox/SandboxHal.cpp @@ -426,6 +426,18 @@ CancelFMRadioSeek() NS_RUNTIMEABORT("FM radio cannot be called from sandboxed contexts."); } +void +EnableRDS(uint32_t aMask) +{ + NS_RUNTIMEABORT("FM radio cannot be called from sandboxed contexts."); +} + +void +DisableRDS() +{ + NS_RUNTIMEABORT("FM radio cannot be called from sandboxed contexts."); +} + void FactoryReset(FactoryResetReason& aReason) { From 0a5f96352b6afa98a5c93732a18428e7a11228e6 Mon Sep 17 00:00:00 2001 From: Lars T Hansen Date: Tue, 30 Sep 2014 10:23:28 +0200 Subject: [PATCH 44/93] Bug 1072176 - Clean up misplaced assertions in public functions. r=waldo --HG-- rename : js/src/jit-test/tests/sharedbuf/bug1068458-toolong.js => js/src/jit-test/tests/sharedbuf/toolong.js --- .../tests/sharedbuf/bug1068458-toolong.js | 14 ------ js/src/jit-test/tests/sharedbuf/toolong.js | 22 ++++++++++ js/src/vm/SharedTypedArrayObject.cpp | 44 +++++++------------ 3 files changed, 38 insertions(+), 42 deletions(-) delete mode 100644 js/src/jit-test/tests/sharedbuf/bug1068458-toolong.js create mode 100644 js/src/jit-test/tests/sharedbuf/toolong.js diff --git a/js/src/jit-test/tests/sharedbuf/bug1068458-toolong.js b/js/src/jit-test/tests/sharedbuf/bug1068458-toolong.js deleted file mode 100644 index f1113d4d7e71..000000000000 --- a/js/src/jit-test/tests/sharedbuf/bug1068458-toolong.js +++ /dev/null @@ -1,14 +0,0 @@ -// This used to assert, now it will throw because the limit -// (in bytes) on a SharedArrayBuffer is INT32_MAX. - -if (!this.SharedUint16Array) - quit(); - -var thrown = false; -try { - new SharedUint16Array(2147483647); -} -catch (e) { - thrown = true; -} -assertEq(thrown, true); diff --git a/js/src/jit-test/tests/sharedbuf/toolong.js b/js/src/jit-test/tests/sharedbuf/toolong.js new file mode 100644 index 000000000000..50653be6c770 --- /dev/null +++ b/js/src/jit-test/tests/sharedbuf/toolong.js @@ -0,0 +1,22 @@ +// Various cases that used to assert, but will now throw (as they should). + +if (!this.SharedUint16Array) + quit(); + +var thrown = false; +try { + new SharedUint16Array(2147483647); // Bug 1068458 +} +catch (e) { + thrown = true; +} +assertEq(thrown, true); + +var thrown = false; +try { + new SharedUint16Array(0xdeadbeef); // Bug 1072176 +} +catch (e) { + thrown = true; +} +assertEq(thrown, true); diff --git a/js/src/vm/SharedTypedArrayObject.cpp b/js/src/vm/SharedTypedArrayObject.cpp index e2974e69c704..8099b3f7c383 100644 --- a/js/src/vm/SharedTypedArrayObject.cpp +++ b/js/src/vm/SharedTypedArrayObject.cpp @@ -145,6 +145,8 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject static SharedTypedArrayObject * makeTypedInstance(JSContext *cx, uint32_t len, AllocKind allocKind) { + JS_ASSERT(len <= MAX_LENGTH / sizeof(NativeType)); + // Multiplication is safe due to preconditions for makeInstance(). if (len * sizeof(NativeType) >= SharedTypedArrayObject::SINGLETON_TYPE_BYTE_LENGTH) { return &NewBuiltinClassInstance(cx, instanceClass(), allocKind, @@ -173,8 +175,8 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject HandleObject proto) { JS_ASSERT(buffer); - JS_ASSERT(len <= MAX_LENGTH / sizeof(NativeType)); JS_ASSERT(byteOffset <= MAX_BYTEOFFSET); + JS_ASSERT(len <= MAX_LENGTH / sizeof(NativeType)); gc::AllocKind allocKind = GetGCObjectKind(instanceClass()); @@ -304,18 +306,6 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject return fromBuffer(cx, dataObj, byteOffset, length); } - static bool - createArrayBuffer(JSContext *cx, uint32_t nelements, MutableHandle buffer) - { - if (nelements > MAX_LENGTH / sizeof(NativeType)) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, - JSMSG_NEED_DIET, "shared typed array"); - return false; - } - buffer.set(SharedArrayBufferObject::New(cx, nelements * sizeof(NativeType))); - return !!buffer; - } - template static bool GetterImpl(JSContext *cx, CallArgs args) @@ -412,6 +402,11 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject static Value getIndexValue(JSObject *tarray, uint32_t index); + static bool fun_subarray(JSContext *cx, unsigned argc, Value *vp); + static bool fun_copyWithin(JSContext *cx, unsigned argc, Value *vp); + static bool fun_set(JSContext *cx, unsigned argc, Value *vp); + + public: static JSObject * fromBufferWithProto(JSContext *cx, HandleObject bufobj, uint32_t byteOffset, uint32_t length, HandleObject proto) @@ -421,8 +416,6 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject return nullptr; // must be SharedArrayBuffer } - JS_ASSERT(IsSharedArrayBuffer(bufobj) || bufobj->is()); - if (bufobj->is()) { // Complicated, see TypedArrayObject.cpp for code. For now, punt. JS_ReportError(cx, "Permission denied to access object"); @@ -437,7 +430,6 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject return nullptr; } - JS_ASSERT(byteOffset <= buffer->byteLength()); uint32_t bytesAvailable = buffer->byteLength() - byteOffset; if (length == LENGTH_NOT_PROVIDED) { @@ -449,23 +441,16 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject } if (length > MAX_LENGTH / sizeof(NativeType) || length * sizeof(NativeType) > bytesAvailable) { - JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SHARED_TYPED_ARRAY_BAD_ARGS); + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BAD_ARRAY_LENGTH); return nullptr; } return makeInstance(cx, buffer, byteOffset, length, proto); } - static bool fun_subarray(JSContext *cx, unsigned argc, Value *vp); - static bool fun_copyWithin(JSContext *cx, unsigned argc, Value *vp); - static bool fun_set(JSContext *cx, unsigned argc, Value *vp); - - public: static JSObject * fromBuffer(JSContext *cx, HandleObject bufobj, uint32_t byteOffset, uint32_t length) { - JS_ASSERT(byteOffset <= MAX_BYTEOFFSET); - JS_ASSERT(length <= MAX_LENGTH || length == LENGTH_NOT_PROVIDED); RootedObject proto(cx, nullptr); return fromBufferWithProto(cx, bufobj, byteOffset, length, proto); } @@ -473,10 +458,13 @@ class SharedTypedArrayObjectTemplate : public SharedTypedArrayObject static JSObject * fromLength(JSContext *cx, uint32_t nelements) { - JS_ASSERT(nelements <= MAX_LENGTH); - Rooted buffer(cx); - // Invariant established by createArrayBuffer(): nelements * sizeof(NativeType) <= MAX_LENGTH. - if (!createArrayBuffer(cx, nelements, &buffer)) + if (nelements > MAX_LENGTH / sizeof(NativeType)) { + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BAD_ARRAY_LENGTH); + return nullptr; + } + Rooted buffer( + cx, SharedArrayBufferObject::New(cx, nelements * sizeof(NativeType))); + if (!buffer) return nullptr; return makeInstance(cx, buffer, 0, nelements); } From 3db6a4453bacc5b5f29f94b9e3b2bd16a7917f2f Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 23 Sep 2014 09:00:00 +0200 Subject: [PATCH 45/93] Bug 1056373 - Remove debug logging that accidentally got left over. r=jimb --- js/src/jsmath.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 626ac0ff014d..42163d1dfbea 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -742,9 +742,6 @@ random_generateSeed() * do, so just mix in the fd error code and the current time. */ int fd = open("/dev/urandom", O_RDONLY); - if (fd < 0) { - perror("FITZGEN: error opening /dev/urandom: "); - } MOZ_ASSERT(fd >= 0, "Can't open /dev/urandom"); if (fd >= 0) { (void)read(fd, seed.u8, mozilla::ArrayLength(seed.u8)); From 3140b4a353edbb61571db9b83b0eee98d4ba539b Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Tue, 30 Sep 2014 09:09:36 +0100 Subject: [PATCH 46/93] Bug 1054646 - Part 1: Change nsNullPrincipal::CheckMayLoad to always allow loads when the principal of the URI in the principal doing the load. r=bz --- caps/nsIPrincipal.idl | 10 +++------- caps/nsNullPrincipal.cpp | 17 ++++++++--------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/caps/nsIPrincipal.idl b/caps/nsIPrincipal.idl index 225f73f03939..4f1476e85af5 100644 --- a/caps/nsIPrincipal.idl +++ b/caps/nsIPrincipal.idl @@ -113,13 +113,9 @@ interface nsIPrincipal : nsISerializable * located at the given URI under the same-origin policy. This means that * codebase principals are only allowed to load resources from the same * domain, the system principal is allowed to load anything, and null - * principals are not allowed to load anything. This is changed slightly - * by the optional flag allowIfInheritsPrincipal (which defaults to false) - * which allows the load of a data: URI (which inherits the principal of - * its loader) or a URI with the same principal as its loader (eg. a - * Blob URI). - * In these cases, with allowIfInheritsPrincipal set to true, the URI can - * be loaded by a null principal. + * principals can only load URIs where they are the principal. This is + * changed by the optional flag allowIfInheritsPrincipal (which defaults to + * false) which allows URIs that inherit their loader's principal. * * If the load is allowed this function does nothing. If the load is not * allowed the function throws NS_ERROR_DOM_BAD_URI. diff --git a/caps/nsNullPrincipal.cpp b/caps/nsNullPrincipal.cpp index 8fd37f13389f..b84a5ff49704 100644 --- a/caps/nsNullPrincipal.cpp +++ b/caps/nsNullPrincipal.cpp @@ -239,17 +239,16 @@ nsNullPrincipal::CheckMayLoad(nsIURI* aURI, bool aReport, bool aAllowIfInheritsP if (nsPrincipal::IsPrincipalInherited(aURI)) { return NS_OK; } + } - // Also allow the load if the principal of the URI being checked is exactly - // us ie this. - nsCOMPtr uriPrinc = do_QueryInterface(aURI); - if (uriPrinc) { - nsCOMPtr principal; - uriPrinc->GetPrincipal(getter_AddRefs(principal)); + // Also allow the load if we are the principal of the URI being checked. + nsCOMPtr uriPrinc = do_QueryInterface(aURI); + if (uriPrinc) { + nsCOMPtr principal; + uriPrinc->GetPrincipal(getter_AddRefs(principal)); - if (principal && principal == this) { - return NS_OK; - } + if (principal == this) { + return NS_OK; } } From 5f0d929d02b5fa42d1dda4721c945df59cc8ac32 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Tue, 30 Sep 2014 08:51:47 +0100 Subject: [PATCH 47/93] Bug 1054646 - Part 2: test loading of blob and data URLs in unique origin iframe sandbox. r=bz --- .../test/file_iframe_sandbox_b_if3.html | 55 ++++++++++++++----- .../test/test_iframe_sandbox_same_origin.html | 4 +- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/content/html/content/test/file_iframe_sandbox_b_if3.html b/content/html/content/test/file_iframe_sandbox_b_if3.html index a1e7a95217ca..350e2ac4726d 100644 --- a/content/html/content/test/file_iframe_sandbox_b_if3.html +++ b/content/html/content/test/file_iframe_sandbox_b_if3.html @@ -11,23 +11,50 @@ } function testXHR() { - var xhr = new XMLHttpRequest(); - - xhr.open("GET", "file_iframe_sandbox_b_if1.html"); - - xhr.onreadystatechange = function (oEvent) { - var result = false; - if (xhr.readyState == 4) { - if (xhr.status == 0) { - result = true; + // Standard URL should be blocked as we have a unique origin. + var xhr = new XMLHttpRequest(); + xhr.open("GET", "file_iframe_sandbox_b_if1.html"); + xhr.onreadystatechange = function (oEvent) { + var result = false; + if (xhr.readyState == 4) { + if (xhr.status == 0) { + result = true; + } + ok(result, "XHR should be blocked in an iframe sandboxed WITHOUT 'allow-same-origin'"); } - ok(result, "XHR should be blocked in an iframe sandboxed WITHOUT 'allow-same-origin'"); + } + xhr.send(null); + + // Blob URL should work as it will have our unique origin. + var blobXhr = new XMLHttpRequest(); + var blobUrl = URL.createObjectURL(new Blob(["wibble"], {type: "text/plain"})); + blobXhr.open("GET", blobUrl); + blobXhr.onreadystatechange = function () { + if (this.readyState == 4) { + ok(this.status == 200 && this.response == "wibble", "XHR for a blob URL created in this document should NOT be blocked in an iframe sandboxed WITHOUT 'allow-same-origin'"); + } + } + try { + blobXhr.send(); + } catch(e) { + ok(false, "failed to send XHR for blob URL: error: " + e); + } + + // Data URL should work as it inherits the loader's origin. + var dataXhr = new XMLHttpRequest(); + dataXhr.open("GET", "data:text/html,wibble"); + dataXhr.onreadystatechange = function () { + if (this.readyState == 4) { + ok(this.status == 200 && this.response == "wibble", "XHR for a data URL should NOT be blocked in an iframe sandboxed WITHOUT 'allow-same-origin'"); + } + } + try { + dataXhr.send(); + } catch(e) { + ok(false, "failed to send XHR for data URL: error: " + e); } } - xhr.send(null); -} - function doStuff() { try { window.parent.ok(false, "documents sandboxed without 'allow-same-origin' should NOT be able to access their parent"); @@ -56,7 +83,7 @@ ok(true, "a document sandboxed without allow-same-origin should NOT be able to access sessionStorage"); } - testXHR(); + testXHR(); } diff --git a/content/html/content/test/test_iframe_sandbox_same_origin.html b/content/html/content/test/test_iframe_sandbox_same_origin.html index d752601f6c66..b924b9f20853 100644 --- a/content/html/content/test/test_iframe_sandbox_same_origin.html +++ b/content/html/content/test/test_iframe_sandbox_same_origin.html @@ -28,8 +28,8 @@ function ok_wrapper(result, desc) { passedTests++; } - if (completedTests == 12) { - is(passedTests, 12, "There are 12 same-origin tests that should pass"); + if (completedTests == 14) { + is(passedTests, completedTests, "There are " + completedTests + " same-origin tests that should pass"); SimpleTest.finish(); } From 4a83ef11274ff7d81af15279b50314cac6c051e8 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Sep 2014 11:33:11 +0200 Subject: [PATCH 48/93] Bug 1068725: More debugging and assertions for MoveGroups; r=sunfish --- js/src/jit/LIR.cpp | 24 +++++++++++++++++++++--- js/src/jit/LIR.h | 1 + js/src/jit/RegisterAllocator.cpp | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/js/src/jit/LIR.cpp b/js/src/jit/LIR.cpp index 35a297093271..526da37a74fa 100644 --- a/js/src/jit/LIR.cpp +++ b/js/src/jit/LIR.cpp @@ -348,6 +348,8 @@ static const char * const TypeChars[] = "s", // SLOTS "f", // FLOAT32 "d", // DOUBLE + "i32x4", // INT32X4 + "f32x4", // FLOAT32X4 #ifdef JS_NUNBOX32 "t", // TYPE "p" // PAYLOAD @@ -541,9 +543,25 @@ bool LMoveGroup::add(LAllocation *from, LAllocation *to, LDefinition::Type type) { #ifdef DEBUG - JS_ASSERT(*from != *to); + MOZ_ASSERT(*from != *to); for (size_t i = 0; i < moves_.length(); i++) - JS_ASSERT(*to != *moves_[i].to()); + MOZ_ASSERT(*to != *moves_[i].to()); + + // Check that SIMD moves are aligned according to ABI requirements. + if (LDefinition(type).isSimdType()) { + if (from->isMemory()) { + if (from->isArgument()) + MOZ_ASSERT(from->toArgument()->index() % SimdStackAlignment == 0); + else + MOZ_ASSERT(from->toStackSlot()->slot() % SimdStackAlignment == 0); + } + if (to->isMemory()) { + if (to->isArgument()) + MOZ_ASSERT(to->toArgument()->index() % SimdStackAlignment == 0); + else + MOZ_ASSERT(to->toStackSlot()->slot() % SimdStackAlignment == 0); + } + } #endif return moves_.append(LMove(from, to, type)); } @@ -582,7 +600,7 @@ LMoveGroup::printOperands(FILE *fp) const LMove &move = getMove(i); // Use two printfs, as LAllocation::toString is not reentrant. fprintf(fp, " [%s", move.from()->toString()); - fprintf(fp, " -> %s]", move.to()->toString()); + fprintf(fp, " -> %s, %s]", move.to()->toString(), TypeChars[move.type()]); if (i != numMoves() - 1) fprintf(fp, ","); } diff --git a/js/src/jit/LIR.h b/js/src/jit/LIR.h index cda84bec76c5..d80ddc0018d3 100644 --- a/js/src/jit/LIR.h +++ b/js/src/jit/LIR.h @@ -416,6 +416,7 @@ class LDefinition MUST_REUSE_INPUT }; + // This should be kept in sync with LIR.cpp's TypeChars. enum Type { GENERAL, // Generic, integer or pointer-width data (GPR). INT32, // int32 data (GPR). diff --git a/js/src/jit/RegisterAllocator.cpp b/js/src/jit/RegisterAllocator.cpp index 67621b27c46a..27892b0c0a53 100644 --- a/js/src/jit/RegisterAllocator.cpp +++ b/js/src/jit/RegisterAllocator.cpp @@ -407,7 +407,7 @@ AllocationIntegrityState::dump() if (ins->isMoveGroup()) { LMoveGroup *group = ins->toMoveGroup(); for (int i = group->numMoves() - 1; i >= 0; i--) { - // Use two printfs, as LAllocation::toString is not reentant. + // Use two printfs, as LAllocation::toString is not reentrant. fprintf(stderr, " [%s", group->getMove(i).from()->toString()); fprintf(stderr, " -> %s]", group->getMove(i).to()->toString()); } From a1bb30a61fd7e357cdb996f7d978c793023c2bd5 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Sep 2014 11:33:17 +0200 Subject: [PATCH 49/93] Bug 1068725: Use actual input's type for a move when reifying allocations with backtracking regalloc; r=sunfish --- js/src/jit/BacktrackingAllocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index 3498c0083a6a..5f1f004f5ffc 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -1128,7 +1128,7 @@ BacktrackingAllocator::reifyAllocations() if (*res != *alloc) { LMoveGroup *group = getInputMoveGroup(inputOf(ins)); - if (!group->addAfter(sourceAlloc, res, def->type())) + if (!group->addAfter(sourceAlloc, res, reg->type())) return false; *alloc = *res; } From cd9f398bb20fe648e0215f69b26b802e579c89bf Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Sep 2014 11:33:27 +0200 Subject: [PATCH 50/93] Bug 1068725: Add Mandelbrot SIMD demo to the test suite; r=luke --- .../jit-test/tests/asm.js/simd-mandelbrot.js | 1814 +++++++++++++++++ 1 file changed, 1814 insertions(+) create mode 100644 js/src/jit-test/tests/asm.js/simd-mandelbrot.js diff --git a/js/src/jit-test/tests/asm.js/simd-mandelbrot.js b/js/src/jit-test/tests/asm.js/simd-mandelbrot.js new file mode 100644 index 000000000000..b6b364a5edfd --- /dev/null +++ b/js/src/jit-test/tests/asm.js/simd-mandelbrot.js @@ -0,0 +1,1814 @@ +/* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level : 2 ; js-curly-indent-offset: 0 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ + +// Mandelbrot using SIMD +// Author: Peter Jensen, Intel Corporation + +load(libdir + "asm.js"); +if (!isSimdAvailable() || typeof SIMD === 'undefined') { + print("won't run tests as simd extensions aren't activated yet"); + quit(0); +} + +// global variables +const MAX_ITERATIONS = 10; +const DRAW_ITERATIONS = 10; + +const CANVAS_WIDTH = 20; +const CANVAS_HEIGHT = 20; + +const LIMIT_SHOW = 20 * 20 * 4; + +// Asm.js module buffer. +var buffer = new ArrayBuffer(16 * 1024 * 1024); +var view = new Uint8Array(buffer); + +var moduleCode = ` + "use asm" + var b8 = new global.Uint8Array(buffer); + var toF = global.Math.fround; + var i4 = global.SIMD.int32x4; + var f4 = global.SIMD.float32x4; + var i4add = i4.add; + var i4and = i4.and; + var f4add = f4.add; + var f4sub = f4.sub; + var f4mul = f4.mul; + var f4lessThanOrEqual = f4.lessThanOrEqual; + var f4splat = f4.splat; + var imul = global.Math.imul; + const one4 = i4(1,1,1,1), two4 = f4(2,2,2,2), four4 = f4(4,4,4,4); + + const mk0 = 0x007fffff; + + function declareHeapLength() { + b8[0x00ffffff] = 0; + } + + function mapColorAndSetPixel (x, y, width, value, max_iterations) { + x = x | 0; + y = y | 0; + width = width | 0; + value = value | 0; + max_iterations = max_iterations | 0; + + var rgb = 0, r = 0, g = 0, b = 0, index = 0; + + index = (((imul((width >>> 0), (y >>> 0)) + x) | 0) * 4) | 0; + if ((value | 0) == (max_iterations | 0)) { + r = 0; + g = 0; + b = 0; + } else { + rgb = ~~toF(toF(toF(toF(value >>> 0) * toF(0xffff)) / toF(max_iterations >>> 0)) * toF(0xff)); + r = rgb & 0xff; + g = (rgb >>> 8) & 0xff; + b = (rgb >>> 16) & 0xff; + } + b8[(index & mk0) >> 0] = r; + b8[(index & mk0) + 1 >> 0] = g; + b8[(index & mk0) + 2 >> 0] = b; + b8[(index & mk0) + 3 >> 0] = 255; + } + + function mandelPixelX4 (xf, yf, yd, max_iterations) { + xf = toF(xf); + yf = toF(yf); + yd = toF(yd); + max_iterations = max_iterations | 0; + var c_re4 = f4(0,0,0,0), c_im4 = f4(0,0,0,0); + var z_re4 = f4(0,0,0,0), z_im4 = f4(0,0,0,0); + var count4 = i4(0,0,0,0); + var z_re24 = f4(0,0,0,0), z_im24 = f4(0,0,0,0); + var new_re4 = f4(0,0,0,0), new_im4 = f4(0,0,0,0); + var i = 0; + var mi4 = i4(0,0,0,0); + + c_re4 = f4splat(xf); + c_im4 = f4(yf, toF(yd + yf), toF(yd + toF(yd + yf)), toF(yd + toF(yd + toF(yd + yf)))); + + z_re4 = c_re4; + z_im4 = c_im4; + + for (i = 0; (i | 0) < (max_iterations | 0); i = (i + 1) | 0) { + z_re24 = f4mul(z_re4, z_re4); + z_im24 = f4mul(z_im4, z_im4); + mi4 = f4lessThanOrEqual(f4add(z_re24, z_im24), four4); + // If all 4 values are greater than 4.0, there's no reason to continue. + if ((mi4.signMask | 0) == 0x00) + break; + + new_re4 = f4sub(z_re24, z_im24); + new_im4 = f4mul(f4mul(two4, z_re4), z_im4); + z_re4 = f4add(c_re4, new_re4); + z_im4 = f4add(c_im4, new_im4); + count4 = i4add(count4, i4and(mi4, one4)); + } + return i4(count4); + } + + function mandelColumnX4 (x, width, height, xf, yf, yd, max_iterations) { + x = x | 0; + width = width | 0; + height = height | 0; + xf = toF(xf); + yf = toF(yf); + yd = toF(yd); + max_iterations = max_iterations | 0; + + var y = 0; + var ydx4 = toF(0); + var m4 = i4(0,0,0,0); + + ydx4 = toF(yd * toF(4)); + for (y = 0; (y | 0) < (height | 0); y = (y + 4) | 0) { + m4 = i4(mandelPixelX4(toF(xf), toF(yf), toF(yd), max_iterations)); + mapColorAndSetPixel(x | 0, y | 0, width, m4.x, max_iterations); + mapColorAndSetPixel(x | 0, (y + 1) | 0, width, m4.y, max_iterations); + mapColorAndSetPixel(x | 0, (y + 2) | 0, width, m4.z, max_iterations); + mapColorAndSetPixel(x | 0, (y + 3) | 0, width, m4.w, max_iterations); + yf = toF(yf + ydx4); + } + } + + function mandel (width, height, xc, yc, scale, max_iterations) { + width = width | 0; + height = height | 0; + xc = toF(xc); + yc = toF(yc); + scale = toF(scale); + max_iterations = max_iterations | 0; + + var x0 = toF(0), y0 = toF(0); + var xd = toF(0), yd = toF(0); + var xf = toF(0); + var x = 0; + + x0 = toF(xc - toF(scale * toF(1.5))); + y0 = toF(yc - scale); + xd = toF(toF(scale * toF(3)) / toF(width >>> 0)); + yd = toF(toF(scale * toF(2)) / toF(height >>> 0)); + xf = x0; + + for (x = 0; (x | 0) < (width | 0); x = (x + 1) | 0) { + mandelColumnX4(x, width, height, xf, y0, yd, max_iterations); + xf = toF(xf + xd); + } + } + + return mandel; +`; + +var FFI = {}; +var mandelbro = asmLink(asmCompile('global', 'ffi', 'buffer', moduleCode), this, FFI, buffer); + +function animateMandelbrot () { + var scale_start = 1.0; + var scale_end = 0.0005; + var xc_start = -0.5; + var yc_start = 0.0; + var xc_end = 0.0; + var yc_end = 0.75; + var steps = 200.0; + var scale_step = (scale_end - scale_start)/steps; + var xc_step = (xc_end - xc_start)/steps; + var yc_step = (yc_end - yc_start)/steps; + var scale = scale_start; + var xc = xc_start; + var yc = yc_start; + var i = 0; + var now = dateNow(); + + function draw1 () { + mandelbro(CANVAS_WIDTH, CANVAS_HEIGHT, xc, yc, scale, MAX_ITERATIONS); + if (scale < scale_end || scale > scale_start) { + scale_step = -scale_step; + xc_step = -xc_step; + yc_step = -yc_step; + } + scale += scale_step; + xc += xc_step; + yc += yc_step; + i++; + } + + var b = dateNow(); + for (var j = DRAW_ITERATIONS; j --> 0;) + draw1(); + print(dateNow() - b); +} + +animateMandelbrot(); + +assertEq(view[0], 0, "0th value should be 0"); +assertEq(view[1], 0, "1th value should be 0"); +assertEq(view[2], 0, "2th value should be 0"); +assertEq(view[3], 255, "3th value should be 255"); +assertEq(view[4], 230, "4th value should be 230"); +assertEq(view[5], 127, "5th value should be 127"); +assertEq(view[6], 25, "6th value should be 25"); +assertEq(view[7], 255, "7th value should be 255"); +assertEq(view[8], 230, "8th value should be 230"); +assertEq(view[9], 127, "9th value should be 127"); +assertEq(view[10], 25, "10th value should be 25"); +assertEq(view[11], 255, "11th value should be 255"); +assertEq(view[12], 205, "12th value should be 205"); +assertEq(view[13], 255, "13th value should be 255"); +assertEq(view[14], 50, "14th value should be 50"); +assertEq(view[15], 255, "15th value should be 255"); +assertEq(view[16], 205, "16th value should be 205"); +assertEq(view[17], 255, "17th value should be 255"); +assertEq(view[18], 50, "18th value should be 50"); +assertEq(view[19], 255, "19th value should be 255"); +assertEq(view[20], 205, "20th value should be 205"); +assertEq(view[21], 255, "21th value should be 255"); +assertEq(view[22], 50, "22th value should be 50"); +assertEq(view[23], 255, "23th value should be 255"); +assertEq(view[24], 205, "24th value should be 205"); +assertEq(view[25], 255, "25th value should be 255"); +assertEq(view[26], 50, "26th value should be 50"); +assertEq(view[27], 255, "27th value should be 255"); +assertEq(view[28], 205, "28th value should be 205"); +assertEq(view[29], 255, "29th value should be 255"); +assertEq(view[30], 50, "30th value should be 50"); +assertEq(view[31], 255, "31th value should be 255"); +assertEq(view[32], 179, "32th value should be 179"); +assertEq(view[33], 127, "33th value should be 127"); +assertEq(view[34], 76, "34th value should be 76"); +assertEq(view[35], 255, "35th value should be 255"); +assertEq(view[36], 179, "36th value should be 179"); +assertEq(view[37], 127, "37th value should be 127"); +assertEq(view[38], 76, "38th value should be 76"); +assertEq(view[39], 255, "39th value should be 255"); +assertEq(view[40], 179, "40th value should be 179"); +assertEq(view[41], 127, "41th value should be 127"); +assertEq(view[42], 76, "42th value should be 76"); +assertEq(view[43], 255, "43th value should be 255"); +assertEq(view[44], 154, "44th value should be 154"); +assertEq(view[45], 255, "45th value should be 255"); +assertEq(view[46], 101, "46th value should be 101"); +assertEq(view[47], 255, "47th value should be 255"); +assertEq(view[48], 78, "48th value should be 78"); +assertEq(view[49], 127, "49th value should be 127"); +assertEq(view[50], 178, "50th value should be 178"); +assertEq(view[51], 255, "51th value should be 255"); +assertEq(view[52], 52, "52th value should be 52"); +assertEq(view[53], 255, "53th value should be 255"); +assertEq(view[54], 203, "54th value should be 203"); +assertEq(view[55], 255, "55th value should be 255"); +assertEq(view[56], 154, "56th value should be 154"); +assertEq(view[57], 255, "57th value should be 255"); +assertEq(view[58], 101, "58th value should be 101"); +assertEq(view[59], 255, "59th value should be 255"); +assertEq(view[60], 179, "60th value should be 179"); +assertEq(view[61], 127, "61th value should be 127"); +assertEq(view[62], 76, "62th value should be 76"); +assertEq(view[63], 255, "63th value should be 255"); +assertEq(view[64], 205, "64th value should be 205"); +assertEq(view[65], 255, "65th value should be 255"); +assertEq(view[66], 50, "66th value should be 50"); +assertEq(view[67], 255, "67th value should be 255"); +assertEq(view[68], 205, "68th value should be 205"); +assertEq(view[69], 255, "69th value should be 255"); +assertEq(view[70], 50, "70th value should be 50"); +assertEq(view[71], 255, "71th value should be 255"); +assertEq(view[72], 230, "72th value should be 230"); +assertEq(view[73], 127, "73th value should be 127"); +assertEq(view[74], 25, "74th value should be 25"); +assertEq(view[75], 255, "75th value should be 255"); +assertEq(view[76], 230, "76th value should be 230"); +assertEq(view[77], 127, "77th value should be 127"); +assertEq(view[78], 25, "78th value should be 25"); +assertEq(view[79], 255, "79th value should be 255"); +assertEq(view[80], 0, "80th value should be 0"); +assertEq(view[81], 0, "81th value should be 0"); +assertEq(view[82], 0, "82th value should be 0"); +assertEq(view[83], 255, "83th value should be 255"); +assertEq(view[84], 230, "84th value should be 230"); +assertEq(view[85], 127, "85th value should be 127"); +assertEq(view[86], 25, "86th value should be 25"); +assertEq(view[87], 255, "87th value should be 255"); +assertEq(view[88], 205, "88th value should be 205"); +assertEq(view[89], 255, "89th value should be 255"); +assertEq(view[90], 50, "90th value should be 50"); +assertEq(view[91], 255, "91th value should be 255"); +assertEq(view[92], 205, "92th value should be 205"); +assertEq(view[93], 255, "93th value should be 255"); +assertEq(view[94], 50, "94th value should be 50"); +assertEq(view[95], 255, "95th value should be 255"); +assertEq(view[96], 205, "96th value should be 205"); +assertEq(view[97], 255, "97th value should be 255"); +assertEq(view[98], 50, "98th value should be 50"); +assertEq(view[99], 255, "99th value should be 255"); +assertEq(view[100], 205, "100th value should be 205"); +assertEq(view[101], 255, "101th value should be 255"); +assertEq(view[102], 50, "102th value should be 50"); +assertEq(view[103], 255, "103th value should be 255"); +assertEq(view[104], 205, "104th value should be 205"); +assertEq(view[105], 255, "105th value should be 255"); +assertEq(view[106], 50, "106th value should be 50"); +assertEq(view[107], 255, "107th value should be 255"); +assertEq(view[108], 205, "108th value should be 205"); +assertEq(view[109], 255, "109th value should be 255"); +assertEq(view[110], 50, "110th value should be 50"); +assertEq(view[111], 255, "111th value should be 255"); +assertEq(view[112], 179, "112th value should be 179"); +assertEq(view[113], 127, "113th value should be 127"); +assertEq(view[114], 76, "114th value should be 76"); +assertEq(view[115], 255, "115th value should be 255"); +assertEq(view[116], 179, "116th value should be 179"); +assertEq(view[117], 127, "117th value should be 127"); +assertEq(view[118], 76, "118th value should be 76"); +assertEq(view[119], 255, "119th value should be 255"); +assertEq(view[120], 154, "120th value should be 154"); +assertEq(view[121], 255, "121th value should be 255"); +assertEq(view[122], 101, "122th value should be 101"); +assertEq(view[123], 255, "123th value should be 255"); +assertEq(view[124], 103, "124th value should be 103"); +assertEq(view[125], 255, "125th value should be 255"); +assertEq(view[126], 152, "126th value should be 152"); +assertEq(view[127], 255, "127th value should be 255"); +assertEq(view[128], 0, "128th value should be 0"); +assertEq(view[129], 0, "129th value should be 0"); +assertEq(view[130], 0, "130th value should be 0"); +assertEq(view[131], 255, "131th value should be 255"); +assertEq(view[132], 0, "132th value should be 0"); +assertEq(view[133], 0, "133th value should be 0"); +assertEq(view[134], 0, "134th value should be 0"); +assertEq(view[135], 255, "135th value should be 255"); +assertEq(view[136], 128, "136th value should be 128"); +assertEq(view[137], 127, "137th value should be 127"); +assertEq(view[138], 127, "138th value should be 127"); +assertEq(view[139], 255, "139th value should be 255"); +assertEq(view[140], 154, "140th value should be 154"); +assertEq(view[141], 255, "141th value should be 255"); +assertEq(view[142], 101, "142th value should be 101"); +assertEq(view[143], 255, "143th value should be 255"); +assertEq(view[144], 179, "144th value should be 179"); +assertEq(view[145], 127, "145th value should be 127"); +assertEq(view[146], 76, "146th value should be 76"); +assertEq(view[147], 255, "147th value should be 255"); +assertEq(view[148], 205, "148th value should be 205"); +assertEq(view[149], 255, "149th value should be 255"); +assertEq(view[150], 50, "150th value should be 50"); +assertEq(view[151], 255, "151th value should be 255"); +assertEq(view[152], 205, "152th value should be 205"); +assertEq(view[153], 255, "153th value should be 255"); +assertEq(view[154], 50, "154th value should be 50"); +assertEq(view[155], 255, "155th value should be 255"); +assertEq(view[156], 230, "156th value should be 230"); +assertEq(view[157], 127, "157th value should be 127"); +assertEq(view[158], 25, "158th value should be 25"); +assertEq(view[159], 255, "159th value should be 255"); +assertEq(view[160], 0, "160th value should be 0"); +assertEq(view[161], 0, "161th value should be 0"); +assertEq(view[162], 0, "162th value should be 0"); +assertEq(view[163], 255, "163th value should be 255"); +assertEq(view[164], 230, "164th value should be 230"); +assertEq(view[165], 127, "165th value should be 127"); +assertEq(view[166], 25, "166th value should be 25"); +assertEq(view[167], 255, "167th value should be 255"); +assertEq(view[168], 205, "168th value should be 205"); +assertEq(view[169], 255, "169th value should be 255"); +assertEq(view[170], 50, "170th value should be 50"); +assertEq(view[171], 255, "171th value should be 255"); +assertEq(view[172], 205, "172th value should be 205"); +assertEq(view[173], 255, "173th value should be 255"); +assertEq(view[174], 50, "174th value should be 50"); +assertEq(view[175], 255, "175th value should be 255"); +assertEq(view[176], 205, "176th value should be 205"); +assertEq(view[177], 255, "177th value should be 255"); +assertEq(view[178], 50, "178th value should be 50"); +assertEq(view[179], 255, "179th value should be 255"); +assertEq(view[180], 205, "180th value should be 205"); +assertEq(view[181], 255, "181th value should be 255"); +assertEq(view[182], 50, "182th value should be 50"); +assertEq(view[183], 255, "183th value should be 255"); +assertEq(view[184], 205, "184th value should be 205"); +assertEq(view[185], 255, "185th value should be 255"); +assertEq(view[186], 50, "186th value should be 50"); +assertEq(view[187], 255, "187th value should be 255"); +assertEq(view[188], 179, "188th value should be 179"); +assertEq(view[189], 127, "189th value should be 127"); +assertEq(view[190], 76, "190th value should be 76"); +assertEq(view[191], 255, "191th value should be 255"); +assertEq(view[192], 179, "192th value should be 179"); +assertEq(view[193], 127, "193th value should be 127"); +assertEq(view[194], 76, "194th value should be 76"); +assertEq(view[195], 255, "195th value should be 255"); +assertEq(view[196], 154, "196th value should be 154"); +assertEq(view[197], 255, "197th value should be 255"); +assertEq(view[198], 101, "198th value should be 101"); +assertEq(view[199], 255, "199th value should be 255"); +assertEq(view[200], 103, "200th value should be 103"); +assertEq(view[201], 255, "201th value should be 255"); +assertEq(view[202], 152, "202th value should be 152"); +assertEq(view[203], 255, "203th value should be 255"); +assertEq(view[204], 78, "204th value should be 78"); +assertEq(view[205], 127, "205th value should be 127"); +assertEq(view[206], 178, "206th value should be 178"); +assertEq(view[207], 255, "207th value should be 255"); +assertEq(view[208], 0, "208th value should be 0"); +assertEq(view[209], 0, "209th value should be 0"); +assertEq(view[210], 0, "210th value should be 0"); +assertEq(view[211], 255, "211th value should be 255"); +assertEq(view[212], 0, "212th value should be 0"); +assertEq(view[213], 0, "213th value should be 0"); +assertEq(view[214], 0, "214th value should be 0"); +assertEq(view[215], 255, "215th value should be 255"); +assertEq(view[216], 78, "216th value should be 78"); +assertEq(view[217], 127, "217th value should be 127"); +assertEq(view[218], 178, "218th value should be 178"); +assertEq(view[219], 255, "219th value should be 255"); +assertEq(view[220], 128, "220th value should be 128"); +assertEq(view[221], 127, "221th value should be 127"); +assertEq(view[222], 127, "222th value should be 127"); +assertEq(view[223], 255, "223th value should be 255"); +assertEq(view[224], 154, "224th value should be 154"); +assertEq(view[225], 255, "225th value should be 255"); +assertEq(view[226], 101, "226th value should be 101"); +assertEq(view[227], 255, "227th value should be 255"); +assertEq(view[228], 205, "228th value should be 205"); +assertEq(view[229], 255, "229th value should be 255"); +assertEq(view[230], 50, "230th value should be 50"); +assertEq(view[231], 255, "231th value should be 255"); +assertEq(view[232], 205, "232th value should be 205"); +assertEq(view[233], 255, "233th value should be 255"); +assertEq(view[234], 50, "234th value should be 50"); +assertEq(view[235], 255, "235th value should be 255"); +assertEq(view[236], 230, "236th value should be 230"); +assertEq(view[237], 127, "237th value should be 127"); +assertEq(view[238], 25, "238th value should be 25"); +assertEq(view[239], 255, "239th value should be 255"); +assertEq(view[240], 0, "240th value should be 0"); +assertEq(view[241], 0, "241th value should be 0"); +assertEq(view[242], 0, "242th value should be 0"); +assertEq(view[243], 255, "243th value should be 255"); +assertEq(view[244], 205, "244th value should be 205"); +assertEq(view[245], 255, "245th value should be 255"); +assertEq(view[246], 50, "246th value should be 50"); +assertEq(view[247], 255, "247th value should be 255"); +assertEq(view[248], 205, "248th value should be 205"); +assertEq(view[249], 255, "249th value should be 255"); +assertEq(view[250], 50, "250th value should be 50"); +assertEq(view[251], 255, "251th value should be 255"); +assertEq(view[252], 205, "252th value should be 205"); +assertEq(view[253], 255, "253th value should be 255"); +assertEq(view[254], 50, "254th value should be 50"); +assertEq(view[255], 255, "255th value should be 255"); +assertEq(view[256], 205, "256th value should be 205"); +assertEq(view[257], 255, "257th value should be 255"); +assertEq(view[258], 50, "258th value should be 50"); +assertEq(view[259], 255, "259th value should be 255"); +assertEq(view[260], 205, "260th value should be 205"); +assertEq(view[261], 255, "261th value should be 255"); +assertEq(view[262], 50, "262th value should be 50"); +assertEq(view[263], 255, "263th value should be 255"); +assertEq(view[264], 179, "264th value should be 179"); +assertEq(view[265], 127, "265th value should be 127"); +assertEq(view[266], 76, "266th value should be 76"); +assertEq(view[267], 255, "267th value should be 255"); +assertEq(view[268], 179, "268th value should be 179"); +assertEq(view[269], 127, "269th value should be 127"); +assertEq(view[270], 76, "270th value should be 76"); +assertEq(view[271], 255, "271th value should be 255"); +assertEq(view[272], 154, "272th value should be 154"); +assertEq(view[273], 255, "273th value should be 255"); +assertEq(view[274], 101, "274th value should be 101"); +assertEq(view[275], 255, "275th value should be 255"); +assertEq(view[276], 52, "276th value should be 52"); +assertEq(view[277], 255, "277th value should be 255"); +assertEq(view[278], 203, "278th value should be 203"); +assertEq(view[279], 255, "279th value should be 255"); +assertEq(view[280], 0, "280th value should be 0"); +assertEq(view[281], 0, "281th value should be 0"); +assertEq(view[282], 0, "282th value should be 0"); +assertEq(view[283], 255, "283th value should be 255"); +assertEq(view[284], 0, "284th value should be 0"); +assertEq(view[285], 0, "285th value should be 0"); +assertEq(view[286], 0, "286th value should be 0"); +assertEq(view[287], 255, "287th value should be 255"); +assertEq(view[288], 0, "288th value should be 0"); +assertEq(view[289], 0, "289th value should be 0"); +assertEq(view[290], 0, "290th value should be 0"); +assertEq(view[291], 255, "291th value should be 255"); +assertEq(view[292], 0, "292th value should be 0"); +assertEq(view[293], 0, "293th value should be 0"); +assertEq(view[294], 0, "294th value should be 0"); +assertEq(view[295], 255, "295th value should be 255"); +assertEq(view[296], 0, "296th value should be 0"); +assertEq(view[297], 0, "297th value should be 0"); +assertEq(view[298], 0, "298th value should be 0"); +assertEq(view[299], 255, "299th value should be 255"); +assertEq(view[300], 52, "300th value should be 52"); +assertEq(view[301], 255, "301th value should be 255"); +assertEq(view[302], 203, "302th value should be 203"); +assertEq(view[303], 255, "303th value should be 255"); +assertEq(view[304], 52, "304th value should be 52"); +assertEq(view[305], 255, "305th value should be 255"); +assertEq(view[306], 203, "306th value should be 203"); +assertEq(view[307], 255, "307th value should be 255"); +assertEq(view[308], 179, "308th value should be 179"); +assertEq(view[309], 127, "309th value should be 127"); +assertEq(view[310], 76, "310th value should be 76"); +assertEq(view[311], 255, "311th value should be 255"); +assertEq(view[312], 205, "312th value should be 205"); +assertEq(view[313], 255, "313th value should be 255"); +assertEq(view[314], 50, "314th value should be 50"); +assertEq(view[315], 255, "315th value should be 255"); +assertEq(view[316], 205, "316th value should be 205"); +assertEq(view[317], 255, "317th value should be 255"); +assertEq(view[318], 50, "318th value should be 50"); +assertEq(view[319], 255, "319th value should be 255"); +assertEq(view[320], 230, "320th value should be 230"); +assertEq(view[321], 127, "321th value should be 127"); +assertEq(view[322], 25, "322th value should be 25"); +assertEq(view[323], 255, "323th value should be 255"); +assertEq(view[324], 205, "324th value should be 205"); +assertEq(view[325], 255, "325th value should be 255"); +assertEq(view[326], 50, "326th value should be 50"); +assertEq(view[327], 255, "327th value should be 255"); +assertEq(view[328], 205, "328th value should be 205"); +assertEq(view[329], 255, "329th value should be 255"); +assertEq(view[330], 50, "330th value should be 50"); +assertEq(view[331], 255, "331th value should be 255"); +assertEq(view[332], 205, "332th value should be 205"); +assertEq(view[333], 255, "333th value should be 255"); +assertEq(view[334], 50, "334th value should be 50"); +assertEq(view[335], 255, "335th value should be 255"); +assertEq(view[336], 205, "336th value should be 205"); +assertEq(view[337], 255, "337th value should be 255"); +assertEq(view[338], 50, "338th value should be 50"); +assertEq(view[339], 255, "339th value should be 255"); +assertEq(view[340], 179, "340th value should be 179"); +assertEq(view[341], 127, "341th value should be 127"); +assertEq(view[342], 76, "342th value should be 76"); +assertEq(view[343], 255, "343th value should be 255"); +assertEq(view[344], 154, "344th value should be 154"); +assertEq(view[345], 255, "345th value should be 255"); +assertEq(view[346], 101, "346th value should be 101"); +assertEq(view[347], 255, "347th value should be 255"); +assertEq(view[348], 154, "348th value should be 154"); +assertEq(view[349], 255, "349th value should be 255"); +assertEq(view[350], 101, "350th value should be 101"); +assertEq(view[351], 255, "351th value should be 255"); +assertEq(view[352], 128, "352th value should be 128"); +assertEq(view[353], 127, "353th value should be 127"); +assertEq(view[354], 127, "354th value should be 127"); +assertEq(view[355], 255, "355th value should be 255"); +assertEq(view[356], 52, "356th value should be 52"); +assertEq(view[357], 255, "357th value should be 255"); +assertEq(view[358], 203, "358th value should be 203"); +assertEq(view[359], 255, "359th value should be 255"); +assertEq(view[360], 0, "360th value should be 0"); +assertEq(view[361], 0, "361th value should be 0"); +assertEq(view[362], 0, "362th value should be 0"); +assertEq(view[363], 255, "363th value should be 255"); +assertEq(view[364], 0, "364th value should be 0"); +assertEq(view[365], 0, "365th value should be 0"); +assertEq(view[366], 0, "366th value should be 0"); +assertEq(view[367], 255, "367th value should be 255"); +assertEq(view[368], 0, "368th value should be 0"); +assertEq(view[369], 0, "369th value should be 0"); +assertEq(view[370], 0, "370th value should be 0"); +assertEq(view[371], 255, "371th value should be 255"); +assertEq(view[372], 0, "372th value should be 0"); +assertEq(view[373], 0, "373th value should be 0"); +assertEq(view[374], 0, "374th value should be 0"); +assertEq(view[375], 255, "375th value should be 255"); +assertEq(view[376], 0, "376th value should be 0"); +assertEq(view[377], 0, "377th value should be 0"); +assertEq(view[378], 0, "378th value should be 0"); +assertEq(view[379], 255, "379th value should be 255"); +assertEq(view[380], 0, "380th value should be 0"); +assertEq(view[381], 0, "381th value should be 0"); +assertEq(view[382], 0, "382th value should be 0"); +assertEq(view[383], 255, "383th value should be 255"); +assertEq(view[384], 52, "384th value should be 52"); +assertEq(view[385], 255, "385th value should be 255"); +assertEq(view[386], 203, "386th value should be 203"); +assertEq(view[387], 255, "387th value should be 255"); +assertEq(view[388], 179, "388th value should be 179"); +assertEq(view[389], 127, "389th value should be 127"); +assertEq(view[390], 76, "390th value should be 76"); +assertEq(view[391], 255, "391th value should be 255"); +assertEq(view[392], 205, "392th value should be 205"); +assertEq(view[393], 255, "393th value should be 255"); +assertEq(view[394], 50, "394th value should be 50"); +assertEq(view[395], 255, "395th value should be 255"); +assertEq(view[396], 205, "396th value should be 205"); +assertEq(view[397], 255, "397th value should be 255"); +assertEq(view[398], 50, "398th value should be 50"); +assertEq(view[399], 255, "399th value should be 255"); +assertEq(view[400], 205, "400th value should be 205"); +assertEq(view[401], 255, "401th value should be 255"); +assertEq(view[402], 50, "402th value should be 50"); +assertEq(view[403], 255, "403th value should be 255"); +assertEq(view[404], 205, "404th value should be 205"); +assertEq(view[405], 255, "405th value should be 255"); +assertEq(view[406], 50, "406th value should be 50"); +assertEq(view[407], 255, "407th value should be 255"); +assertEq(view[408], 205, "408th value should be 205"); +assertEq(view[409], 255, "409th value should be 255"); +assertEq(view[410], 50, "410th value should be 50"); +assertEq(view[411], 255, "411th value should be 255"); +assertEq(view[412], 205, "412th value should be 205"); +assertEq(view[413], 255, "413th value should be 255"); +assertEq(view[414], 50, "414th value should be 50"); +assertEq(view[415], 255, "415th value should be 255"); +assertEq(view[416], 154, "416th value should be 154"); +assertEq(view[417], 255, "417th value should be 255"); +assertEq(view[418], 101, "418th value should be 101"); +assertEq(view[419], 255, "419th value should be 255"); +assertEq(view[420], 128, "420th value should be 128"); +assertEq(view[421], 127, "421th value should be 127"); +assertEq(view[422], 127, "422th value should be 127"); +assertEq(view[423], 255, "423th value should be 255"); +assertEq(view[424], 154, "424th value should be 154"); +assertEq(view[425], 255, "425th value should be 255"); +assertEq(view[426], 101, "426th value should be 101"); +assertEq(view[427], 255, "427th value should be 255"); +assertEq(view[428], 128, "428th value should be 128"); +assertEq(view[429], 127, "429th value should be 127"); +assertEq(view[430], 127, "430th value should be 127"); +assertEq(view[431], 255, "431th value should be 255"); +assertEq(view[432], 103, "432th value should be 103"); +assertEq(view[433], 255, "433th value should be 255"); +assertEq(view[434], 152, "434th value should be 152"); +assertEq(view[435], 255, "435th value should be 255"); +assertEq(view[436], 0, "436th value should be 0"); +assertEq(view[437], 0, "437th value should be 0"); +assertEq(view[438], 0, "438th value should be 0"); +assertEq(view[439], 255, "439th value should be 255"); +assertEq(view[440], 0, "440th value should be 0"); +assertEq(view[441], 0, "441th value should be 0"); +assertEq(view[442], 0, "442th value should be 0"); +assertEq(view[443], 255, "443th value should be 255"); +assertEq(view[444], 0, "444th value should be 0"); +assertEq(view[445], 0, "445th value should be 0"); +assertEq(view[446], 0, "446th value should be 0"); +assertEq(view[447], 255, "447th value should be 255"); +assertEq(view[448], 0, "448th value should be 0"); +assertEq(view[449], 0, "449th value should be 0"); +assertEq(view[450], 0, "450th value should be 0"); +assertEq(view[451], 255, "451th value should be 255"); +assertEq(view[452], 0, "452th value should be 0"); +assertEq(view[453], 0, "453th value should be 0"); +assertEq(view[454], 0, "454th value should be 0"); +assertEq(view[455], 255, "455th value should be 255"); +assertEq(view[456], 0, "456th value should be 0"); +assertEq(view[457], 0, "457th value should be 0"); +assertEq(view[458], 0, "458th value should be 0"); +assertEq(view[459], 255, "459th value should be 255"); +assertEq(view[460], 0, "460th value should be 0"); +assertEq(view[461], 0, "461th value should be 0"); +assertEq(view[462], 0, "462th value should be 0"); +assertEq(view[463], 255, "463th value should be 255"); +assertEq(view[464], 78, "464th value should be 78"); +assertEq(view[465], 127, "465th value should be 127"); +assertEq(view[466], 178, "466th value should be 178"); +assertEq(view[467], 255, "467th value should be 255"); +assertEq(view[468], 154, "468th value should be 154"); +assertEq(view[469], 255, "469th value should be 255"); +assertEq(view[470], 101, "470th value should be 101"); +assertEq(view[471], 255, "471th value should be 255"); +assertEq(view[472], 205, "472th value should be 205"); +assertEq(view[473], 255, "473th value should be 255"); +assertEq(view[474], 50, "474th value should be 50"); +assertEq(view[475], 255, "475th value should be 255"); +assertEq(view[476], 205, "476th value should be 205"); +assertEq(view[477], 255, "477th value should be 255"); +assertEq(view[478], 50, "478th value should be 50"); +assertEq(view[479], 255, "479th value should be 255"); +assertEq(view[480], 205, "480th value should be 205"); +assertEq(view[481], 255, "481th value should be 255"); +assertEq(view[482], 50, "482th value should be 50"); +assertEq(view[483], 255, "483th value should be 255"); +assertEq(view[484], 205, "484th value should be 205"); +assertEq(view[485], 255, "485th value should be 255"); +assertEq(view[486], 50, "486th value should be 50"); +assertEq(view[487], 255, "487th value should be 255"); +assertEq(view[488], 179, "488th value should be 179"); +assertEq(view[489], 127, "489th value should be 127"); +assertEq(view[490], 76, "490th value should be 76"); +assertEq(view[491], 255, "491th value should be 255"); +assertEq(view[492], 179, "492th value should be 179"); +assertEq(view[493], 127, "493th value should be 127"); +assertEq(view[494], 76, "494th value should be 76"); +assertEq(view[495], 255, "495th value should be 255"); +assertEq(view[496], 128, "496th value should be 128"); +assertEq(view[497], 127, "497th value should be 127"); +assertEq(view[498], 127, "498th value should be 127"); +assertEq(view[499], 255, "499th value should be 255"); +assertEq(view[500], 52, "500th value should be 52"); +assertEq(view[501], 255, "501th value should be 255"); +assertEq(view[502], 203, "502th value should be 203"); +assertEq(view[503], 255, "503th value should be 255"); +assertEq(view[504], 0, "504th value should be 0"); +assertEq(view[505], 0, "505th value should be 0"); +assertEq(view[506], 0, "506th value should be 0"); +assertEq(view[507], 255, "507th value should be 255"); +assertEq(view[508], 78, "508th value should be 78"); +assertEq(view[509], 127, "509th value should be 127"); +assertEq(view[510], 178, "510th value should be 178"); +assertEq(view[511], 255, "511th value should be 255"); +assertEq(view[512], 52, "512th value should be 52"); +assertEq(view[513], 255, "513th value should be 255"); +assertEq(view[514], 203, "514th value should be 203"); +assertEq(view[515], 255, "515th value should be 255"); +assertEq(view[516], 0, "516th value should be 0"); +assertEq(view[517], 0, "517th value should be 0"); +assertEq(view[518], 0, "518th value should be 0"); +assertEq(view[519], 255, "519th value should be 255"); +assertEq(view[520], 0, "520th value should be 0"); +assertEq(view[521], 0, "521th value should be 0"); +assertEq(view[522], 0, "522th value should be 0"); +assertEq(view[523], 255, "523th value should be 255"); +assertEq(view[524], 0, "524th value should be 0"); +assertEq(view[525], 0, "525th value should be 0"); +assertEq(view[526], 0, "526th value should be 0"); +assertEq(view[527], 255, "527th value should be 255"); +assertEq(view[528], 0, "528th value should be 0"); +assertEq(view[529], 0, "529th value should be 0"); +assertEq(view[530], 0, "530th value should be 0"); +assertEq(view[531], 255, "531th value should be 255"); +assertEq(view[532], 0, "532th value should be 0"); +assertEq(view[533], 0, "533th value should be 0"); +assertEq(view[534], 0, "534th value should be 0"); +assertEq(view[535], 255, "535th value should be 255"); +assertEq(view[536], 0, "536th value should be 0"); +assertEq(view[537], 0, "537th value should be 0"); +assertEq(view[538], 0, "538th value should be 0"); +assertEq(view[539], 255, "539th value should be 255"); +assertEq(view[540], 0, "540th value should be 0"); +assertEq(view[541], 0, "541th value should be 0"); +assertEq(view[542], 0, "542th value should be 0"); +assertEq(view[543], 255, "543th value should be 255"); +assertEq(view[544], 0, "544th value should be 0"); +assertEq(view[545], 0, "545th value should be 0"); +assertEq(view[546], 0, "546th value should be 0"); +assertEq(view[547], 255, "547th value should be 255"); +assertEq(view[548], 154, "548th value should be 154"); +assertEq(view[549], 255, "549th value should be 255"); +assertEq(view[550], 101, "550th value should be 101"); +assertEq(view[551], 255, "551th value should be 255"); +assertEq(view[552], 205, "552th value should be 205"); +assertEq(view[553], 255, "553th value should be 255"); +assertEq(view[554], 50, "554th value should be 50"); +assertEq(view[555], 255, "555th value should be 255"); +assertEq(view[556], 205, "556th value should be 205"); +assertEq(view[557], 255, "557th value should be 255"); +assertEq(view[558], 50, "558th value should be 50"); +assertEq(view[559], 255, "559th value should be 255"); +assertEq(view[560], 205, "560th value should be 205"); +assertEq(view[561], 255, "561th value should be 255"); +assertEq(view[562], 50, "562th value should be 50"); +assertEq(view[563], 255, "563th value should be 255"); +assertEq(view[564], 179, "564th value should be 179"); +assertEq(view[565], 127, "565th value should be 127"); +assertEq(view[566], 76, "566th value should be 76"); +assertEq(view[567], 255, "567th value should be 255"); +assertEq(view[568], 179, "568th value should be 179"); +assertEq(view[569], 127, "569th value should be 127"); +assertEq(view[570], 76, "570th value should be 76"); +assertEq(view[571], 255, "571th value should be 255"); +assertEq(view[572], 154, "572th value should be 154"); +assertEq(view[573], 255, "573th value should be 255"); +assertEq(view[574], 101, "574th value should be 101"); +assertEq(view[575], 255, "575th value should be 255"); +assertEq(view[576], 103, "576th value should be 103"); +assertEq(view[577], 255, "577th value should be 255"); +assertEq(view[578], 152, "578th value should be 152"); +assertEq(view[579], 255, "579th value should be 255"); +assertEq(view[580], 0, "580th value should be 0"); +assertEq(view[581], 0, "581th value should be 0"); +assertEq(view[582], 0, "582th value should be 0"); +assertEq(view[583], 255, "583th value should be 255"); +assertEq(view[584], 0, "584th value should be 0"); +assertEq(view[585], 0, "585th value should be 0"); +assertEq(view[586], 0, "586th value should be 0"); +assertEq(view[587], 255, "587th value should be 255"); +assertEq(view[588], 0, "588th value should be 0"); +assertEq(view[589], 0, "589th value should be 0"); +assertEq(view[590], 0, "590th value should be 0"); +assertEq(view[591], 255, "591th value should be 255"); +assertEq(view[592], 0, "592th value should be 0"); +assertEq(view[593], 0, "593th value should be 0"); +assertEq(view[594], 0, "594th value should be 0"); +assertEq(view[595], 255, "595th value should be 255"); +assertEq(view[596], 0, "596th value should be 0"); +assertEq(view[597], 0, "597th value should be 0"); +assertEq(view[598], 0, "598th value should be 0"); +assertEq(view[599], 255, "599th value should be 255"); +assertEq(view[600], 0, "600th value should be 0"); +assertEq(view[601], 0, "601th value should be 0"); +assertEq(view[602], 0, "602th value should be 0"); +assertEq(view[603], 255, "603th value should be 255"); +assertEq(view[604], 0, "604th value should be 0"); +assertEq(view[605], 0, "605th value should be 0"); +assertEq(view[606], 0, "606th value should be 0"); +assertEq(view[607], 255, "607th value should be 255"); +assertEq(view[608], 0, "608th value should be 0"); +assertEq(view[609], 0, "609th value should be 0"); +assertEq(view[610], 0, "610th value should be 0"); +assertEq(view[611], 255, "611th value should be 255"); +assertEq(view[612], 0, "612th value should be 0"); +assertEq(view[613], 0, "613th value should be 0"); +assertEq(view[614], 0, "614th value should be 0"); +assertEq(view[615], 255, "615th value should be 255"); +assertEq(view[616], 0, "616th value should be 0"); +assertEq(view[617], 0, "617th value should be 0"); +assertEq(view[618], 0, "618th value should be 0"); +assertEq(view[619], 255, "619th value should be 255"); +assertEq(view[620], 0, "620th value should be 0"); +assertEq(view[621], 0, "621th value should be 0"); +assertEq(view[622], 0, "622th value should be 0"); +assertEq(view[623], 255, "623th value should be 255"); +assertEq(view[624], 0, "624th value should be 0"); +assertEq(view[625], 0, "625th value should be 0"); +assertEq(view[626], 0, "626th value should be 0"); +assertEq(view[627], 255, "627th value should be 255"); +assertEq(view[628], 154, "628th value should be 154"); +assertEq(view[629], 255, "629th value should be 255"); +assertEq(view[630], 101, "630th value should be 101"); +assertEq(view[631], 255, "631th value should be 255"); +assertEq(view[632], 205, "632th value should be 205"); +assertEq(view[633], 255, "633th value should be 255"); +assertEq(view[634], 50, "634th value should be 50"); +assertEq(view[635], 255, "635th value should be 255"); +assertEq(view[636], 205, "636th value should be 205"); +assertEq(view[637], 255, "637th value should be 255"); +assertEq(view[638], 50, "638th value should be 50"); +assertEq(view[639], 255, "639th value should be 255"); +assertEq(view[640], 179, "640th value should be 179"); +assertEq(view[641], 127, "641th value should be 127"); +assertEq(view[642], 76, "642th value should be 76"); +assertEq(view[643], 255, "643th value should be 255"); +assertEq(view[644], 179, "644th value should be 179"); +assertEq(view[645], 127, "645th value should be 127"); +assertEq(view[646], 76, "646th value should be 76"); +assertEq(view[647], 255, "647th value should be 255"); +assertEq(view[648], 154, "648th value should be 154"); +assertEq(view[649], 255, "649th value should be 255"); +assertEq(view[650], 101, "650th value should be 101"); +assertEq(view[651], 255, "651th value should be 255"); +assertEq(view[652], 128, "652th value should be 128"); +assertEq(view[653], 127, "653th value should be 127"); +assertEq(view[654], 127, "654th value should be 127"); +assertEq(view[655], 255, "655th value should be 255"); +assertEq(view[656], 52, "656th value should be 52"); +assertEq(view[657], 255, "657th value should be 255"); +assertEq(view[658], 203, "658th value should be 203"); +assertEq(view[659], 255, "659th value should be 255"); +assertEq(view[660], 0, "660th value should be 0"); +assertEq(view[661], 0, "661th value should be 0"); +assertEq(view[662], 0, "662th value should be 0"); +assertEq(view[663], 255, "663th value should be 255"); +assertEq(view[664], 0, "664th value should be 0"); +assertEq(view[665], 0, "665th value should be 0"); +assertEq(view[666], 0, "666th value should be 0"); +assertEq(view[667], 255, "667th value should be 255"); +assertEq(view[668], 0, "668th value should be 0"); +assertEq(view[669], 0, "669th value should be 0"); +assertEq(view[670], 0, "670th value should be 0"); +assertEq(view[671], 255, "671th value should be 255"); +assertEq(view[672], 0, "672th value should be 0"); +assertEq(view[673], 0, "673th value should be 0"); +assertEq(view[674], 0, "674th value should be 0"); +assertEq(view[675], 255, "675th value should be 255"); +assertEq(view[676], 0, "676th value should be 0"); +assertEq(view[677], 0, "677th value should be 0"); +assertEq(view[678], 0, "678th value should be 0"); +assertEq(view[679], 255, "679th value should be 255"); +assertEq(view[680], 0, "680th value should be 0"); +assertEq(view[681], 0, "681th value should be 0"); +assertEq(view[682], 0, "682th value should be 0"); +assertEq(view[683], 255, "683th value should be 255"); +assertEq(view[684], 0, "684th value should be 0"); +assertEq(view[685], 0, "685th value should be 0"); +assertEq(view[686], 0, "686th value should be 0"); +assertEq(view[687], 255, "687th value should be 255"); +assertEq(view[688], 0, "688th value should be 0"); +assertEq(view[689], 0, "689th value should be 0"); +assertEq(view[690], 0, "690th value should be 0"); +assertEq(view[691], 255, "691th value should be 255"); +assertEq(view[692], 0, "692th value should be 0"); +assertEq(view[693], 0, "693th value should be 0"); +assertEq(view[694], 0, "694th value should be 0"); +assertEq(view[695], 255, "695th value should be 255"); +assertEq(view[696], 0, "696th value should be 0"); +assertEq(view[697], 0, "697th value should be 0"); +assertEq(view[698], 0, "698th value should be 0"); +assertEq(view[699], 255, "699th value should be 255"); +assertEq(view[700], 0, "700th value should be 0"); +assertEq(view[701], 0, "701th value should be 0"); +assertEq(view[702], 0, "702th value should be 0"); +assertEq(view[703], 255, "703th value should be 255"); +assertEq(view[704], 0, "704th value should be 0"); +assertEq(view[705], 0, "705th value should be 0"); +assertEq(view[706], 0, "706th value should be 0"); +assertEq(view[707], 255, "707th value should be 255"); +assertEq(view[708], 154, "708th value should be 154"); +assertEq(view[709], 255, "709th value should be 255"); +assertEq(view[710], 101, "710th value should be 101"); +assertEq(view[711], 255, "711th value should be 255"); +assertEq(view[712], 179, "712th value should be 179"); +assertEq(view[713], 127, "713th value should be 127"); +assertEq(view[714], 76, "714th value should be 76"); +assertEq(view[715], 255, "715th value should be 255"); +assertEq(view[716], 205, "716th value should be 205"); +assertEq(view[717], 255, "717th value should be 255"); +assertEq(view[718], 50, "718th value should be 50"); +assertEq(view[719], 255, "719th value should be 255"); +assertEq(view[720], 154, "720th value should be 154"); +assertEq(view[721], 255, "721th value should be 255"); +assertEq(view[722], 101, "722th value should be 101"); +assertEq(view[723], 255, "723th value should be 255"); +assertEq(view[724], 52, "724th value should be 52"); +assertEq(view[725], 255, "725th value should be 255"); +assertEq(view[726], 203, "726th value should be 203"); +assertEq(view[727], 255, "727th value should be 255"); +assertEq(view[728], 128, "728th value should be 128"); +assertEq(view[729], 127, "729th value should be 127"); +assertEq(view[730], 127, "730th value should be 127"); +assertEq(view[731], 255, "731th value should be 255"); +assertEq(view[732], 78, "732th value should be 78"); +assertEq(view[733], 127, "733th value should be 127"); +assertEq(view[734], 178, "734th value should be 178"); +assertEq(view[735], 255, "735th value should be 255"); +assertEq(view[736], 0, "736th value should be 0"); +assertEq(view[737], 0, "737th value should be 0"); +assertEq(view[738], 0, "738th value should be 0"); +assertEq(view[739], 255, "739th value should be 255"); +assertEq(view[740], 0, "740th value should be 0"); +assertEq(view[741], 0, "741th value should be 0"); +assertEq(view[742], 0, "742th value should be 0"); +assertEq(view[743], 255, "743th value should be 255"); +assertEq(view[744], 0, "744th value should be 0"); +assertEq(view[745], 0, "745th value should be 0"); +assertEq(view[746], 0, "746th value should be 0"); +assertEq(view[747], 255, "747th value should be 255"); +assertEq(view[748], 0, "748th value should be 0"); +assertEq(view[749], 0, "749th value should be 0"); +assertEq(view[750], 0, "750th value should be 0"); +assertEq(view[751], 255, "751th value should be 255"); +assertEq(view[752], 0, "752th value should be 0"); +assertEq(view[753], 0, "753th value should be 0"); +assertEq(view[754], 0, "754th value should be 0"); +assertEq(view[755], 255, "755th value should be 255"); +assertEq(view[756], 0, "756th value should be 0"); +assertEq(view[757], 0, "757th value should be 0"); +assertEq(view[758], 0, "758th value should be 0"); +assertEq(view[759], 255, "759th value should be 255"); +assertEq(view[760], 0, "760th value should be 0"); +assertEq(view[761], 0, "761th value should be 0"); +assertEq(view[762], 0, "762th value should be 0"); +assertEq(view[763], 255, "763th value should be 255"); +assertEq(view[764], 0, "764th value should be 0"); +assertEq(view[765], 0, "765th value should be 0"); +assertEq(view[766], 0, "766th value should be 0"); +assertEq(view[767], 255, "767th value should be 255"); +assertEq(view[768], 0, "768th value should be 0"); +assertEq(view[769], 0, "769th value should be 0"); +assertEq(view[770], 0, "770th value should be 0"); +assertEq(view[771], 255, "771th value should be 255"); +assertEq(view[772], 0, "772th value should be 0"); +assertEq(view[773], 0, "773th value should be 0"); +assertEq(view[774], 0, "774th value should be 0"); +assertEq(view[775], 255, "775th value should be 255"); +assertEq(view[776], 0, "776th value should be 0"); +assertEq(view[777], 0, "777th value should be 0"); +assertEq(view[778], 0, "778th value should be 0"); +assertEq(view[779], 255, "779th value should be 255"); +assertEq(view[780], 0, "780th value should be 0"); +assertEq(view[781], 0, "781th value should be 0"); +assertEq(view[782], 0, "782th value should be 0"); +assertEq(view[783], 255, "783th value should be 255"); +assertEq(view[784], 78, "784th value should be 78"); +assertEq(view[785], 127, "785th value should be 127"); +assertEq(view[786], 178, "786th value should be 178"); +assertEq(view[787], 255, "787th value should be 255"); +assertEq(view[788], 154, "788th value should be 154"); +assertEq(view[789], 255, "789th value should be 255"); +assertEq(view[790], 101, "790th value should be 101"); +assertEq(view[791], 255, "791th value should be 255"); +assertEq(view[792], 179, "792th value should be 179"); +assertEq(view[793], 127, "793th value should be 127"); +assertEq(view[794], 76, "794th value should be 76"); +assertEq(view[795], 255, "795th value should be 255"); +assertEq(view[796], 205, "796th value should be 205"); +assertEq(view[797], 255, "797th value should be 255"); +assertEq(view[798], 50, "798th value should be 50"); +assertEq(view[799], 255, "799th value should be 255"); +assertEq(view[800], 128, "800th value should be 128"); +assertEq(view[801], 127, "801th value should be 127"); +assertEq(view[802], 127, "802th value should be 127"); +assertEq(view[803], 255, "803th value should be 255"); +assertEq(view[804], 0, "804th value should be 0"); +assertEq(view[805], 0, "805th value should be 0"); +assertEq(view[806], 0, "806th value should be 0"); +assertEq(view[807], 255, "807th value should be 255"); +assertEq(view[808], 26, "808th value should be 26"); +assertEq(view[809], 127, "809th value should be 127"); +assertEq(view[810], 229, "810th value should be 229"); +assertEq(view[811], 255, "811th value should be 255"); +assertEq(view[812], 0, "812th value should be 0"); +assertEq(view[813], 0, "813th value should be 0"); +assertEq(view[814], 0, "814th value should be 0"); +assertEq(view[815], 255, "815th value should be 255"); +assertEq(view[816], 0, "816th value should be 0"); +assertEq(view[817], 0, "817th value should be 0"); +assertEq(view[818], 0, "818th value should be 0"); +assertEq(view[819], 255, "819th value should be 255"); +assertEq(view[820], 0, "820th value should be 0"); +assertEq(view[821], 0, "821th value should be 0"); +assertEq(view[822], 0, "822th value should be 0"); +assertEq(view[823], 255, "823th value should be 255"); +assertEq(view[824], 0, "824th value should be 0"); +assertEq(view[825], 0, "825th value should be 0"); +assertEq(view[826], 0, "826th value should be 0"); +assertEq(view[827], 255, "827th value should be 255"); +assertEq(view[828], 0, "828th value should be 0"); +assertEq(view[829], 0, "829th value should be 0"); +assertEq(view[830], 0, "830th value should be 0"); +assertEq(view[831], 255, "831th value should be 255"); +assertEq(view[832], 0, "832th value should be 0"); +assertEq(view[833], 0, "833th value should be 0"); +assertEq(view[834], 0, "834th value should be 0"); +assertEq(view[835], 255, "835th value should be 255"); +assertEq(view[836], 0, "836th value should be 0"); +assertEq(view[837], 0, "837th value should be 0"); +assertEq(view[838], 0, "838th value should be 0"); +assertEq(view[839], 255, "839th value should be 255"); +assertEq(view[840], 0, "840th value should be 0"); +assertEq(view[841], 0, "841th value should be 0"); +assertEq(view[842], 0, "842th value should be 0"); +assertEq(view[843], 255, "843th value should be 255"); +assertEq(view[844], 0, "844th value should be 0"); +assertEq(view[845], 0, "845th value should be 0"); +assertEq(view[846], 0, "846th value should be 0"); +assertEq(view[847], 255, "847th value should be 255"); +assertEq(view[848], 0, "848th value should be 0"); +assertEq(view[849], 0, "849th value should be 0"); +assertEq(view[850], 0, "850th value should be 0"); +assertEq(view[851], 255, "851th value should be 255"); +assertEq(view[852], 0, "852th value should be 0"); +assertEq(view[853], 0, "853th value should be 0"); +assertEq(view[854], 0, "854th value should be 0"); +assertEq(view[855], 255, "855th value should be 255"); +assertEq(view[856], 0, "856th value should be 0"); +assertEq(view[857], 0, "857th value should be 0"); +assertEq(view[858], 0, "858th value should be 0"); +assertEq(view[859], 255, "859th value should be 255"); +assertEq(view[860], 0, "860th value should be 0"); +assertEq(view[861], 0, "861th value should be 0"); +assertEq(view[862], 0, "862th value should be 0"); +assertEq(view[863], 255, "863th value should be 255"); +assertEq(view[864], 103, "864th value should be 103"); +assertEq(view[865], 255, "865th value should be 255"); +assertEq(view[866], 152, "866th value should be 152"); +assertEq(view[867], 255, "867th value should be 255"); +assertEq(view[868], 154, "868th value should be 154"); +assertEq(view[869], 255, "869th value should be 255"); +assertEq(view[870], 101, "870th value should be 101"); +assertEq(view[871], 255, "871th value should be 255"); +assertEq(view[872], 179, "872th value should be 179"); +assertEq(view[873], 127, "873th value should be 127"); +assertEq(view[874], 76, "874th value should be 76"); +assertEq(view[875], 255, "875th value should be 255"); +assertEq(view[876], 205, "876th value should be 205"); +assertEq(view[877], 255, "877th value should be 255"); +assertEq(view[878], 50, "878th value should be 50"); +assertEq(view[879], 255, "879th value should be 255"); +assertEq(view[880], 179, "880th value should be 179"); +assertEq(view[881], 127, "881th value should be 127"); +assertEq(view[882], 76, "882th value should be 76"); +assertEq(view[883], 255, "883th value should be 255"); +assertEq(view[884], 179, "884th value should be 179"); +assertEq(view[885], 127, "885th value should be 127"); +assertEq(view[886], 76, "886th value should be 76"); +assertEq(view[887], 255, "887th value should be 255"); +assertEq(view[888], 128, "888th value should be 128"); +assertEq(view[889], 127, "889th value should be 127"); +assertEq(view[890], 127, "890th value should be 127"); +assertEq(view[891], 255, "891th value should be 255"); +assertEq(view[892], 103, "892th value should be 103"); +assertEq(view[893], 255, "893th value should be 255"); +assertEq(view[894], 152, "894th value should be 152"); +assertEq(view[895], 255, "895th value should be 255"); +assertEq(view[896], 26, "896th value should be 26"); +assertEq(view[897], 127, "897th value should be 127"); +assertEq(view[898], 229, "898th value should be 229"); +assertEq(view[899], 255, "899th value should be 255"); +assertEq(view[900], 0, "900th value should be 0"); +assertEq(view[901], 0, "901th value should be 0"); +assertEq(view[902], 0, "902th value should be 0"); +assertEq(view[903], 255, "903th value should be 255"); +assertEq(view[904], 0, "904th value should be 0"); +assertEq(view[905], 0, "905th value should be 0"); +assertEq(view[906], 0, "906th value should be 0"); +assertEq(view[907], 255, "907th value should be 255"); +assertEq(view[908], 0, "908th value should be 0"); +assertEq(view[909], 0, "909th value should be 0"); +assertEq(view[910], 0, "910th value should be 0"); +assertEq(view[911], 255, "911th value should be 255"); +assertEq(view[912], 0, "912th value should be 0"); +assertEq(view[913], 0, "913th value should be 0"); +assertEq(view[914], 0, "914th value should be 0"); +assertEq(view[915], 255, "915th value should be 255"); +assertEq(view[916], 0, "916th value should be 0"); +assertEq(view[917], 0, "917th value should be 0"); +assertEq(view[918], 0, "918th value should be 0"); +assertEq(view[919], 255, "919th value should be 255"); +assertEq(view[920], 0, "920th value should be 0"); +assertEq(view[921], 0, "921th value should be 0"); +assertEq(view[922], 0, "922th value should be 0"); +assertEq(view[923], 255, "923th value should be 255"); +assertEq(view[924], 0, "924th value should be 0"); +assertEq(view[925], 0, "925th value should be 0"); +assertEq(view[926], 0, "926th value should be 0"); +assertEq(view[927], 255, "927th value should be 255"); +assertEq(view[928], 0, "928th value should be 0"); +assertEq(view[929], 0, "929th value should be 0"); +assertEq(view[930], 0, "930th value should be 0"); +assertEq(view[931], 255, "931th value should be 255"); +assertEq(view[932], 0, "932th value should be 0"); +assertEq(view[933], 0, "933th value should be 0"); +assertEq(view[934], 0, "934th value should be 0"); +assertEq(view[935], 255, "935th value should be 255"); +assertEq(view[936], 0, "936th value should be 0"); +assertEq(view[937], 0, "937th value should be 0"); +assertEq(view[938], 0, "938th value should be 0"); +assertEq(view[939], 255, "939th value should be 255"); +assertEq(view[940], 0, "940th value should be 0"); +assertEq(view[941], 0, "941th value should be 0"); +assertEq(view[942], 0, "942th value should be 0"); +assertEq(view[943], 255, "943th value should be 255"); +assertEq(view[944], 0, "944th value should be 0"); +assertEq(view[945], 0, "945th value should be 0"); +assertEq(view[946], 0, "946th value should be 0"); +assertEq(view[947], 255, "947th value should be 255"); +assertEq(view[948], 154, "948th value should be 154"); +assertEq(view[949], 255, "949th value should be 255"); +assertEq(view[950], 101, "950th value should be 101"); +assertEq(view[951], 255, "951th value should be 255"); +assertEq(view[952], 179, "952th value should be 179"); +assertEq(view[953], 127, "953th value should be 127"); +assertEq(view[954], 76, "954th value should be 76"); +assertEq(view[955], 255, "955th value should be 255"); +assertEq(view[956], 205, "956th value should be 205"); +assertEq(view[957], 255, "957th value should be 255"); +assertEq(view[958], 50, "958th value should be 50"); +assertEq(view[959], 255, "959th value should be 255"); +assertEq(view[960], 179, "960th value should be 179"); +assertEq(view[961], 127, "961th value should be 127"); +assertEq(view[962], 76, "962th value should be 76"); +assertEq(view[963], 255, "963th value should be 255"); +assertEq(view[964], 179, "964th value should be 179"); +assertEq(view[965], 127, "965th value should be 127"); +assertEq(view[966], 76, "966th value should be 76"); +assertEq(view[967], 255, "967th value should be 255"); +assertEq(view[968], 179, "968th value should be 179"); +assertEq(view[969], 127, "969th value should be 127"); +assertEq(view[970], 76, "970th value should be 76"); +assertEq(view[971], 255, "971th value should be 255"); +assertEq(view[972], 154, "972th value should be 154"); +assertEq(view[973], 255, "973th value should be 255"); +assertEq(view[974], 101, "974th value should be 101"); +assertEq(view[975], 255, "975th value should be 255"); +assertEq(view[976], 103, "976th value should be 103"); +assertEq(view[977], 255, "977th value should be 255"); +assertEq(view[978], 152, "978th value should be 152"); +assertEq(view[979], 255, "979th value should be 255"); +assertEq(view[980], 0, "980th value should be 0"); +assertEq(view[981], 0, "981th value should be 0"); +assertEq(view[982], 0, "982th value should be 0"); +assertEq(view[983], 255, "983th value should be 255"); +assertEq(view[984], 0, "984th value should be 0"); +assertEq(view[985], 0, "985th value should be 0"); +assertEq(view[986], 0, "986th value should be 0"); +assertEq(view[987], 255, "987th value should be 255"); +assertEq(view[988], 0, "988th value should be 0"); +assertEq(view[989], 0, "989th value should be 0"); +assertEq(view[990], 0, "990th value should be 0"); +assertEq(view[991], 255, "991th value should be 255"); +assertEq(view[992], 0, "992th value should be 0"); +assertEq(view[993], 0, "993th value should be 0"); +assertEq(view[994], 0, "994th value should be 0"); +assertEq(view[995], 255, "995th value should be 255"); +assertEq(view[996], 0, "996th value should be 0"); +assertEq(view[997], 0, "997th value should be 0"); +assertEq(view[998], 0, "998th value should be 0"); +assertEq(view[999], 255, "999th value should be 255"); +assertEq(view[1000], 0, "1000th value should be 0"); +assertEq(view[1001], 0, "1001th value should be 0"); +assertEq(view[1002], 0, "1002th value should be 0"); +assertEq(view[1003], 255, "1003th value should be 255"); +assertEq(view[1004], 0, "1004th value should be 0"); +assertEq(view[1005], 0, "1005th value should be 0"); +assertEq(view[1006], 0, "1006th value should be 0"); +assertEq(view[1007], 255, "1007th value should be 255"); +assertEq(view[1008], 0, "1008th value should be 0"); +assertEq(view[1009], 0, "1009th value should be 0"); +assertEq(view[1010], 0, "1010th value should be 0"); +assertEq(view[1011], 255, "1011th value should be 255"); +assertEq(view[1012], 0, "1012th value should be 0"); +assertEq(view[1013], 0, "1013th value should be 0"); +assertEq(view[1014], 0, "1014th value should be 0"); +assertEq(view[1015], 255, "1015th value should be 255"); +assertEq(view[1016], 0, "1016th value should be 0"); +assertEq(view[1017], 0, "1017th value should be 0"); +assertEq(view[1018], 0, "1018th value should be 0"); +assertEq(view[1019], 255, "1019th value should be 255"); +assertEq(view[1020], 0, "1020th value should be 0"); +assertEq(view[1021], 0, "1021th value should be 0"); +assertEq(view[1022], 0, "1022th value should be 0"); +assertEq(view[1023], 255, "1023th value should be 255"); +assertEq(view[1024], 0, "1024th value should be 0"); +assertEq(view[1025], 0, "1025th value should be 0"); +assertEq(view[1026], 0, "1026th value should be 0"); +assertEq(view[1027], 255, "1027th value should be 255"); +assertEq(view[1028], 154, "1028th value should be 154"); +assertEq(view[1029], 255, "1029th value should be 255"); +assertEq(view[1030], 101, "1030th value should be 101"); +assertEq(view[1031], 255, "1031th value should be 255"); +assertEq(view[1032], 205, "1032th value should be 205"); +assertEq(view[1033], 255, "1033th value should be 255"); +assertEq(view[1034], 50, "1034th value should be 50"); +assertEq(view[1035], 255, "1035th value should be 255"); +assertEq(view[1036], 205, "1036th value should be 205"); +assertEq(view[1037], 255, "1037th value should be 255"); +assertEq(view[1038], 50, "1038th value should be 50"); +assertEq(view[1039], 255, "1039th value should be 255"); +assertEq(view[1040], 205, "1040th value should be 205"); +assertEq(view[1041], 255, "1041th value should be 255"); +assertEq(view[1042], 50, "1042th value should be 50"); +assertEq(view[1043], 255, "1043th value should be 255"); +assertEq(view[1044], 179, "1044th value should be 179"); +assertEq(view[1045], 127, "1045th value should be 127"); +assertEq(view[1046], 76, "1046th value should be 76"); +assertEq(view[1047], 255, "1047th value should be 255"); +assertEq(view[1048], 179, "1048th value should be 179"); +assertEq(view[1049], 127, "1049th value should be 127"); +assertEq(view[1050], 76, "1050th value should be 76"); +assertEq(view[1051], 255, "1051th value should be 255"); +assertEq(view[1052], 154, "1052th value should be 154"); +assertEq(view[1053], 255, "1053th value should be 255"); +assertEq(view[1054], 101, "1054th value should be 101"); +assertEq(view[1055], 255, "1055th value should be 255"); +assertEq(view[1056], 128, "1056th value should be 128"); +assertEq(view[1057], 127, "1057th value should be 127"); +assertEq(view[1058], 127, "1058th value should be 127"); +assertEq(view[1059], 255, "1059th value should be 255"); +assertEq(view[1060], 0, "1060th value should be 0"); +assertEq(view[1061], 0, "1061th value should be 0"); +assertEq(view[1062], 0, "1062th value should be 0"); +assertEq(view[1063], 255, "1063th value should be 255"); +assertEq(view[1064], 0, "1064th value should be 0"); +assertEq(view[1065], 0, "1065th value should be 0"); +assertEq(view[1066], 0, "1066th value should be 0"); +assertEq(view[1067], 255, "1067th value should be 255"); +assertEq(view[1068], 26, "1068th value should be 26"); +assertEq(view[1069], 127, "1069th value should be 127"); +assertEq(view[1070], 229, "1070th value should be 229"); +assertEq(view[1071], 255, "1071th value should be 255"); +assertEq(view[1072], 26, "1072th value should be 26"); +assertEq(view[1073], 127, "1073th value should be 127"); +assertEq(view[1074], 229, "1074th value should be 229"); +assertEq(view[1075], 255, "1075th value should be 255"); +assertEq(view[1076], 0, "1076th value should be 0"); +assertEq(view[1077], 0, "1077th value should be 0"); +assertEq(view[1078], 0, "1078th value should be 0"); +assertEq(view[1079], 255, "1079th value should be 255"); +assertEq(view[1080], 0, "1080th value should be 0"); +assertEq(view[1081], 0, "1081th value should be 0"); +assertEq(view[1082], 0, "1082th value should be 0"); +assertEq(view[1083], 255, "1083th value should be 255"); +assertEq(view[1084], 0, "1084th value should be 0"); +assertEq(view[1085], 0, "1085th value should be 0"); +assertEq(view[1086], 0, "1086th value should be 0"); +assertEq(view[1087], 255, "1087th value should be 255"); +assertEq(view[1088], 0, "1088th value should be 0"); +assertEq(view[1089], 0, "1089th value should be 0"); +assertEq(view[1090], 0, "1090th value should be 0"); +assertEq(view[1091], 255, "1091th value should be 255"); +assertEq(view[1092], 0, "1092th value should be 0"); +assertEq(view[1093], 0, "1093th value should be 0"); +assertEq(view[1094], 0, "1094th value should be 0"); +assertEq(view[1095], 255, "1095th value should be 255"); +assertEq(view[1096], 0, "1096th value should be 0"); +assertEq(view[1097], 0, "1097th value should be 0"); +assertEq(view[1098], 0, "1098th value should be 0"); +assertEq(view[1099], 255, "1099th value should be 255"); +assertEq(view[1100], 0, "1100th value should be 0"); +assertEq(view[1101], 0, "1101th value should be 0"); +assertEq(view[1102], 0, "1102th value should be 0"); +assertEq(view[1103], 255, "1103th value should be 255"); +assertEq(view[1104], 0, "1104th value should be 0"); +assertEq(view[1105], 0, "1105th value should be 0"); +assertEq(view[1106], 0, "1106th value should be 0"); +assertEq(view[1107], 255, "1107th value should be 255"); +assertEq(view[1108], 154, "1108th value should be 154"); +assertEq(view[1109], 255, "1109th value should be 255"); +assertEq(view[1110], 101, "1110th value should be 101"); +assertEq(view[1111], 255, "1111th value should be 255"); +assertEq(view[1112], 205, "1112th value should be 205"); +assertEq(view[1113], 255, "1113th value should be 255"); +assertEq(view[1114], 50, "1114th value should be 50"); +assertEq(view[1115], 255, "1115th value should be 255"); +assertEq(view[1116], 205, "1116th value should be 205"); +assertEq(view[1117], 255, "1117th value should be 255"); +assertEq(view[1118], 50, "1118th value should be 50"); +assertEq(view[1119], 255, "1119th value should be 255"); +assertEq(view[1120], 205, "1120th value should be 205"); +assertEq(view[1121], 255, "1121th value should be 255"); +assertEq(view[1122], 50, "1122th value should be 50"); +assertEq(view[1123], 255, "1123th value should be 255"); +assertEq(view[1124], 205, "1124th value should be 205"); +assertEq(view[1125], 255, "1125th value should be 255"); +assertEq(view[1126], 50, "1126th value should be 50"); +assertEq(view[1127], 255, "1127th value should be 255"); +assertEq(view[1128], 205, "1128th value should be 205"); +assertEq(view[1129], 255, "1129th value should be 255"); +assertEq(view[1130], 50, "1130th value should be 50"); +assertEq(view[1131], 255, "1131th value should be 255"); +assertEq(view[1132], 179, "1132th value should be 179"); +assertEq(view[1133], 127, "1133th value should be 127"); +assertEq(view[1134], 76, "1134th value should be 76"); +assertEq(view[1135], 255, "1135th value should be 255"); +assertEq(view[1136], 154, "1136th value should be 154"); +assertEq(view[1137], 255, "1137th value should be 255"); +assertEq(view[1138], 101, "1138th value should be 101"); +assertEq(view[1139], 255, "1139th value should be 255"); +assertEq(view[1140], 128, "1140th value should be 128"); +assertEq(view[1141], 127, "1141th value should be 127"); +assertEq(view[1142], 127, "1142th value should be 127"); +assertEq(view[1143], 255, "1143th value should be 255"); +assertEq(view[1144], 128, "1144th value should be 128"); +assertEq(view[1145], 127, "1145th value should be 127"); +assertEq(view[1146], 127, "1146th value should be 127"); +assertEq(view[1147], 255, "1147th value should be 255"); +assertEq(view[1148], 103, "1148th value should be 103"); +assertEq(view[1149], 255, "1149th value should be 255"); +assertEq(view[1150], 152, "1150th value should be 152"); +assertEq(view[1151], 255, "1151th value should be 255"); +assertEq(view[1152], 78, "1152th value should be 78"); +assertEq(view[1153], 127, "1153th value should be 127"); +assertEq(view[1154], 178, "1154th value should be 178"); +assertEq(view[1155], 255, "1155th value should be 255"); +assertEq(view[1156], 0, "1156th value should be 0"); +assertEq(view[1157], 0, "1157th value should be 0"); +assertEq(view[1158], 0, "1158th value should be 0"); +assertEq(view[1159], 255, "1159th value should be 255"); +assertEq(view[1160], 0, "1160th value should be 0"); +assertEq(view[1161], 0, "1161th value should be 0"); +assertEq(view[1162], 0, "1162th value should be 0"); +assertEq(view[1163], 255, "1163th value should be 255"); +assertEq(view[1164], 0, "1164th value should be 0"); +assertEq(view[1165], 0, "1165th value should be 0"); +assertEq(view[1166], 0, "1166th value should be 0"); +assertEq(view[1167], 255, "1167th value should be 255"); +assertEq(view[1168], 0, "1168th value should be 0"); +assertEq(view[1169], 0, "1169th value should be 0"); +assertEq(view[1170], 0, "1170th value should be 0"); +assertEq(view[1171], 255, "1171th value should be 255"); +assertEq(view[1172], 0, "1172th value should be 0"); +assertEq(view[1173], 0, "1173th value should be 0"); +assertEq(view[1174], 0, "1174th value should be 0"); +assertEq(view[1175], 255, "1175th value should be 255"); +assertEq(view[1176], 0, "1176th value should be 0"); +assertEq(view[1177], 0, "1177th value should be 0"); +assertEq(view[1178], 0, "1178th value should be 0"); +assertEq(view[1179], 255, "1179th value should be 255"); +assertEq(view[1180], 0, "1180th value should be 0"); +assertEq(view[1181], 0, "1181th value should be 0"); +assertEq(view[1182], 0, "1182th value should be 0"); +assertEq(view[1183], 255, "1183th value should be 255"); +assertEq(view[1184], 26, "1184th value should be 26"); +assertEq(view[1185], 127, "1185th value should be 127"); +assertEq(view[1186], 229, "1186th value should be 229"); +assertEq(view[1187], 255, "1187th value should be 255"); +assertEq(view[1188], 154, "1188th value should be 154"); +assertEq(view[1189], 255, "1189th value should be 255"); +assertEq(view[1190], 101, "1190th value should be 101"); +assertEq(view[1191], 255, "1191th value should be 255"); +assertEq(view[1192], 205, "1192th value should be 205"); +assertEq(view[1193], 255, "1193th value should be 255"); +assertEq(view[1194], 50, "1194th value should be 50"); +assertEq(view[1195], 255, "1195th value should be 255"); +assertEq(view[1196], 205, "1196th value should be 205"); +assertEq(view[1197], 255, "1197th value should be 255"); +assertEq(view[1198], 50, "1198th value should be 50"); +assertEq(view[1199], 255, "1199th value should be 255"); +assertEq(view[1200], 230, "1200th value should be 230"); +assertEq(view[1201], 127, "1201th value should be 127"); +assertEq(view[1202], 25, "1202th value should be 25"); +assertEq(view[1203], 255, "1203th value should be 255"); +assertEq(view[1204], 205, "1204th value should be 205"); +assertEq(view[1205], 255, "1205th value should be 255"); +assertEq(view[1206], 50, "1206th value should be 50"); +assertEq(view[1207], 255, "1207th value should be 255"); +assertEq(view[1208], 205, "1208th value should be 205"); +assertEq(view[1209], 255, "1209th value should be 255"); +assertEq(view[1210], 50, "1210th value should be 50"); +assertEq(view[1211], 255, "1211th value should be 255"); +assertEq(view[1212], 205, "1212th value should be 205"); +assertEq(view[1213], 255, "1213th value should be 255"); +assertEq(view[1214], 50, "1214th value should be 50"); +assertEq(view[1215], 255, "1215th value should be 255"); +assertEq(view[1216], 205, "1216th value should be 205"); +assertEq(view[1217], 255, "1217th value should be 255"); +assertEq(view[1218], 50, "1218th value should be 50"); +assertEq(view[1219], 255, "1219th value should be 255"); +assertEq(view[1220], 154, "1220th value should be 154"); +assertEq(view[1221], 255, "1221th value should be 255"); +assertEq(view[1222], 101, "1222th value should be 101"); +assertEq(view[1223], 255, "1223th value should be 255"); +assertEq(view[1224], 154, "1224th value should be 154"); +assertEq(view[1225], 255, "1225th value should be 255"); +assertEq(view[1226], 101, "1226th value should be 101"); +assertEq(view[1227], 255, "1227th value should be 255"); +assertEq(view[1228], 154, "1228th value should be 154"); +assertEq(view[1229], 255, "1229th value should be 255"); +assertEq(view[1230], 101, "1230th value should be 101"); +assertEq(view[1231], 255, "1231th value should be 255"); +assertEq(view[1232], 128, "1232th value should be 128"); +assertEq(view[1233], 127, "1233th value should be 127"); +assertEq(view[1234], 127, "1234th value should be 127"); +assertEq(view[1235], 255, "1235th value should be 255"); +assertEq(view[1236], 26, "1236th value should be 26"); +assertEq(view[1237], 127, "1237th value should be 127"); +assertEq(view[1238], 229, "1238th value should be 229"); +assertEq(view[1239], 255, "1239th value should be 255"); +assertEq(view[1240], 0, "1240th value should be 0"); +assertEq(view[1241], 0, "1241th value should be 0"); +assertEq(view[1242], 0, "1242th value should be 0"); +assertEq(view[1243], 255, "1243th value should be 255"); +assertEq(view[1244], 0, "1244th value should be 0"); +assertEq(view[1245], 0, "1245th value should be 0"); +assertEq(view[1246], 0, "1246th value should be 0"); +assertEq(view[1247], 255, "1247th value should be 255"); +assertEq(view[1248], 0, "1248th value should be 0"); +assertEq(view[1249], 0, "1249th value should be 0"); +assertEq(view[1250], 0, "1250th value should be 0"); +assertEq(view[1251], 255, "1251th value should be 255"); +assertEq(view[1252], 0, "1252th value should be 0"); +assertEq(view[1253], 0, "1253th value should be 0"); +assertEq(view[1254], 0, "1254th value should be 0"); +assertEq(view[1255], 255, "1255th value should be 255"); +assertEq(view[1256], 0, "1256th value should be 0"); +assertEq(view[1257], 0, "1257th value should be 0"); +assertEq(view[1258], 0, "1258th value should be 0"); +assertEq(view[1259], 255, "1259th value should be 255"); +assertEq(view[1260], 0, "1260th value should be 0"); +assertEq(view[1261], 0, "1261th value should be 0"); +assertEq(view[1262], 0, "1262th value should be 0"); +assertEq(view[1263], 255, "1263th value should be 255"); +assertEq(view[1264], 78, "1264th value should be 78"); +assertEq(view[1265], 127, "1265th value should be 127"); +assertEq(view[1266], 178, "1266th value should be 178"); +assertEq(view[1267], 255, "1267th value should be 255"); +assertEq(view[1268], 179, "1268th value should be 179"); +assertEq(view[1269], 127, "1269th value should be 127"); +assertEq(view[1270], 76, "1270th value should be 76"); +assertEq(view[1271], 255, "1271th value should be 255"); +assertEq(view[1272], 205, "1272th value should be 205"); +assertEq(view[1273], 255, "1273th value should be 255"); +assertEq(view[1274], 50, "1274th value should be 50"); +assertEq(view[1275], 255, "1275th value should be 255"); +assertEq(view[1276], 205, "1276th value should be 205"); +assertEq(view[1277], 255, "1277th value should be 255"); +assertEq(view[1278], 50, "1278th value should be 50"); +assertEq(view[1279], 255, "1279th value should be 255"); +assertEq(view[1280], 0, "1280th value should be 0"); +assertEq(view[1281], 0, "1281th value should be 0"); +assertEq(view[1282], 0, "1282th value should be 0"); +assertEq(view[1283], 255, "1283th value should be 255"); +assertEq(view[1284], 205, "1284th value should be 205"); +assertEq(view[1285], 255, "1285th value should be 255"); +assertEq(view[1286], 50, "1286th value should be 50"); +assertEq(view[1287], 255, "1287th value should be 255"); +assertEq(view[1288], 205, "1288th value should be 205"); +assertEq(view[1289], 255, "1289th value should be 255"); +assertEq(view[1290], 50, "1290th value should be 50"); +assertEq(view[1291], 255, "1291th value should be 255"); +assertEq(view[1292], 205, "1292th value should be 205"); +assertEq(view[1293], 255, "1293th value should be 255"); +assertEq(view[1294], 50, "1294th value should be 50"); +assertEq(view[1295], 255, "1295th value should be 255"); +assertEq(view[1296], 205, "1296th value should be 205"); +assertEq(view[1297], 255, "1297th value should be 255"); +assertEq(view[1298], 50, "1298th value should be 50"); +assertEq(view[1299], 255, "1299th value should be 255"); +assertEq(view[1300], 205, "1300th value should be 205"); +assertEq(view[1301], 255, "1301th value should be 255"); +assertEq(view[1302], 50, "1302th value should be 50"); +assertEq(view[1303], 255, "1303th value should be 255"); +assertEq(view[1304], 179, "1304th value should be 179"); +assertEq(view[1305], 127, "1305th value should be 127"); +assertEq(view[1306], 76, "1306th value should be 76"); +assertEq(view[1307], 255, "1307th value should be 255"); +assertEq(view[1308], 154, "1308th value should be 154"); +assertEq(view[1309], 255, "1309th value should be 255"); +assertEq(view[1310], 101, "1310th value should be 101"); +assertEq(view[1311], 255, "1311th value should be 255"); +assertEq(view[1312], 154, "1312th value should be 154"); +assertEq(view[1313], 255, "1313th value should be 255"); +assertEq(view[1314], 101, "1314th value should be 101"); +assertEq(view[1315], 255, "1315th value should be 255"); +assertEq(view[1316], 0, "1316th value should be 0"); +assertEq(view[1317], 0, "1317th value should be 0"); +assertEq(view[1318], 0, "1318th value should be 0"); +assertEq(view[1319], 255, "1319th value should be 255"); +assertEq(view[1320], 0, "1320th value should be 0"); +assertEq(view[1321], 0, "1321th value should be 0"); +assertEq(view[1322], 0, "1322th value should be 0"); +assertEq(view[1323], 255, "1323th value should be 255"); +assertEq(view[1324], 0, "1324th value should be 0"); +assertEq(view[1325], 0, "1325th value should be 0"); +assertEq(view[1326], 0, "1326th value should be 0"); +assertEq(view[1327], 255, "1327th value should be 255"); +assertEq(view[1328], 0, "1328th value should be 0"); +assertEq(view[1329], 0, "1329th value should be 0"); +assertEq(view[1330], 0, "1330th value should be 0"); +assertEq(view[1331], 255, "1331th value should be 255"); +assertEq(view[1332], 0, "1332th value should be 0"); +assertEq(view[1333], 0, "1333th value should be 0"); +assertEq(view[1334], 0, "1334th value should be 0"); +assertEq(view[1335], 255, "1335th value should be 255"); +assertEq(view[1336], 0, "1336th value should be 0"); +assertEq(view[1337], 0, "1337th value should be 0"); +assertEq(view[1338], 0, "1338th value should be 0"); +assertEq(view[1339], 255, "1339th value should be 255"); +assertEq(view[1340], 0, "1340th value should be 0"); +assertEq(view[1341], 0, "1341th value should be 0"); +assertEq(view[1342], 0, "1342th value should be 0"); +assertEq(view[1343], 255, "1343th value should be 255"); +assertEq(view[1344], 0, "1344th value should be 0"); +assertEq(view[1345], 0, "1345th value should be 0"); +assertEq(view[1346], 0, "1346th value should be 0"); +assertEq(view[1347], 255, "1347th value should be 255"); +assertEq(view[1348], 179, "1348th value should be 179"); +assertEq(view[1349], 127, "1349th value should be 127"); +assertEq(view[1350], 76, "1350th value should be 76"); +assertEq(view[1351], 255, "1351th value should be 255"); +assertEq(view[1352], 205, "1352th value should be 205"); +assertEq(view[1353], 255, "1353th value should be 255"); +assertEq(view[1354], 50, "1354th value should be 50"); +assertEq(view[1355], 255, "1355th value should be 255"); +assertEq(view[1356], 205, "1356th value should be 205"); +assertEq(view[1357], 255, "1357th value should be 255"); +assertEq(view[1358], 50, "1358th value should be 50"); +assertEq(view[1359], 255, "1359th value should be 255"); +assertEq(view[1360], 0, "1360th value should be 0"); +assertEq(view[1361], 0, "1361th value should be 0"); +assertEq(view[1362], 0, "1362th value should be 0"); +assertEq(view[1363], 255, "1363th value should be 255"); +assertEq(view[1364], 205, "1364th value should be 205"); +assertEq(view[1365], 255, "1365th value should be 255"); +assertEq(view[1366], 50, "1366th value should be 50"); +assertEq(view[1367], 255, "1367th value should be 255"); +assertEq(view[1368], 205, "1368th value should be 205"); +assertEq(view[1369], 255, "1369th value should be 255"); +assertEq(view[1370], 50, "1370th value should be 50"); +assertEq(view[1371], 255, "1371th value should be 255"); +assertEq(view[1372], 205, "1372th value should be 205"); +assertEq(view[1373], 255, "1373th value should be 255"); +assertEq(view[1374], 50, "1374th value should be 50"); +assertEq(view[1375], 255, "1375th value should be 255"); +assertEq(view[1376], 205, "1376th value should be 205"); +assertEq(view[1377], 255, "1377th value should be 255"); +assertEq(view[1378], 50, "1378th value should be 50"); +assertEq(view[1379], 255, "1379th value should be 255"); +assertEq(view[1380], 205, "1380th value should be 205"); +assertEq(view[1381], 255, "1381th value should be 255"); +assertEq(view[1382], 50, "1382th value should be 50"); +assertEq(view[1383], 255, "1383th value should be 255"); +assertEq(view[1384], 205, "1384th value should be 205"); +assertEq(view[1385], 255, "1385th value should be 255"); +assertEq(view[1386], 50, "1386th value should be 50"); +assertEq(view[1387], 255, "1387th value should be 255"); +assertEq(view[1388], 179, "1388th value should be 179"); +assertEq(view[1389], 127, "1389th value should be 127"); +assertEq(view[1390], 76, "1390th value should be 76"); +assertEq(view[1391], 255, "1391th value should be 255"); +assertEq(view[1392], 179, "1392th value should be 179"); +assertEq(view[1393], 127, "1393th value should be 127"); +assertEq(view[1394], 76, "1394th value should be 76"); +assertEq(view[1395], 255, "1395th value should be 255"); +assertEq(view[1396], 103, "1396th value should be 103"); +assertEq(view[1397], 255, "1397th value should be 255"); +assertEq(view[1398], 152, "1398th value should be 152"); +assertEq(view[1399], 255, "1399th value should be 255"); +assertEq(view[1400], 78, "1400th value should be 78"); +assertEq(view[1401], 127, "1401th value should be 127"); +assertEq(view[1402], 178, "1402th value should be 178"); +assertEq(view[1403], 255, "1403th value should be 255"); +assertEq(view[1404], 52, "1404th value should be 52"); +assertEq(view[1405], 255, "1405th value should be 255"); +assertEq(view[1406], 203, "1406th value should be 203"); +assertEq(view[1407], 255, "1407th value should be 255"); +assertEq(view[1408], 0, "1408th value should be 0"); +assertEq(view[1409], 0, "1409th value should be 0"); +assertEq(view[1410], 0, "1410th value should be 0"); +assertEq(view[1411], 255, "1411th value should be 255"); +assertEq(view[1412], 0, "1412th value should be 0"); +assertEq(view[1413], 0, "1413th value should be 0"); +assertEq(view[1414], 0, "1414th value should be 0"); +assertEq(view[1415], 255, "1415th value should be 255"); +assertEq(view[1416], 52, "1416th value should be 52"); +assertEq(view[1417], 255, "1417th value should be 255"); +assertEq(view[1418], 203, "1418th value should be 203"); +assertEq(view[1419], 255, "1419th value should be 255"); +assertEq(view[1420], 128, "1420th value should be 128"); +assertEq(view[1421], 127, "1421th value should be 127"); +assertEq(view[1422], 127, "1422th value should be 127"); +assertEq(view[1423], 255, "1423th value should be 255"); +assertEq(view[1424], 128, "1424th value should be 128"); +assertEq(view[1425], 127, "1425th value should be 127"); +assertEq(view[1426], 127, "1426th value should be 127"); +assertEq(view[1427], 255, "1427th value should be 255"); +assertEq(view[1428], 205, "1428th value should be 205"); +assertEq(view[1429], 255, "1429th value should be 255"); +assertEq(view[1430], 50, "1430th value should be 50"); +assertEq(view[1431], 255, "1431th value should be 255"); +assertEq(view[1432], 205, "1432th value should be 205"); +assertEq(view[1433], 255, "1433th value should be 255"); +assertEq(view[1434], 50, "1434th value should be 50"); +assertEq(view[1435], 255, "1435th value should be 255"); +assertEq(view[1436], 230, "1436th value should be 230"); +assertEq(view[1437], 127, "1437th value should be 127"); +assertEq(view[1438], 25, "1438th value should be 25"); +assertEq(view[1439], 255, "1439th value should be 255"); +assertEq(view[1440], 0, "1440th value should be 0"); +assertEq(view[1441], 0, "1441th value should be 0"); +assertEq(view[1442], 0, "1442th value should be 0"); +assertEq(view[1443], 255, "1443th value should be 255"); +assertEq(view[1444], 230, "1444th value should be 230"); +assertEq(view[1445], 127, "1445th value should be 127"); +assertEq(view[1446], 25, "1446th value should be 25"); +assertEq(view[1447], 255, "1447th value should be 255"); +assertEq(view[1448], 205, "1448th value should be 205"); +assertEq(view[1449], 255, "1449th value should be 255"); +assertEq(view[1450], 50, "1450th value should be 50"); +assertEq(view[1451], 255, "1451th value should be 255"); +assertEq(view[1452], 205, "1452th value should be 205"); +assertEq(view[1453], 255, "1453th value should be 255"); +assertEq(view[1454], 50, "1454th value should be 50"); +assertEq(view[1455], 255, "1455th value should be 255"); +assertEq(view[1456], 205, "1456th value should be 205"); +assertEq(view[1457], 255, "1457th value should be 255"); +assertEq(view[1458], 50, "1458th value should be 50"); +assertEq(view[1459], 255, "1459th value should be 255"); +assertEq(view[1460], 205, "1460th value should be 205"); +assertEq(view[1461], 255, "1461th value should be 255"); +assertEq(view[1462], 50, "1462th value should be 50"); +assertEq(view[1463], 255, "1463th value should be 255"); +assertEq(view[1464], 205, "1464th value should be 205"); +assertEq(view[1465], 255, "1465th value should be 255"); +assertEq(view[1466], 50, "1466th value should be 50"); +assertEq(view[1467], 255, "1467th value should be 255"); +assertEq(view[1468], 179, "1468th value should be 179"); +assertEq(view[1469], 127, "1469th value should be 127"); +assertEq(view[1470], 76, "1470th value should be 76"); +assertEq(view[1471], 255, "1471th value should be 255"); +assertEq(view[1472], 179, "1472th value should be 179"); +assertEq(view[1473], 127, "1473th value should be 127"); +assertEq(view[1474], 76, "1474th value should be 76"); +assertEq(view[1475], 255, "1475th value should be 255"); +assertEq(view[1476], 179, "1476th value should be 179"); +assertEq(view[1477], 127, "1477th value should be 127"); +assertEq(view[1478], 76, "1478th value should be 76"); +assertEq(view[1479], 255, "1479th value should be 255"); +assertEq(view[1480], 128, "1480th value should be 128"); +assertEq(view[1481], 127, "1481th value should be 127"); +assertEq(view[1482], 127, "1482th value should be 127"); +assertEq(view[1483], 255, "1483th value should be 255"); +assertEq(view[1484], 103, "1484th value should be 103"); +assertEq(view[1485], 255, "1485th value should be 255"); +assertEq(view[1486], 152, "1486th value should be 152"); +assertEq(view[1487], 255, "1487th value should be 255"); +assertEq(view[1488], 0, "1488th value should be 0"); +assertEq(view[1489], 0, "1489th value should be 0"); +assertEq(view[1490], 0, "1490th value should be 0"); +assertEq(view[1491], 255, "1491th value should be 255"); +assertEq(view[1492], 0, "1492th value should be 0"); +assertEq(view[1493], 0, "1493th value should be 0"); +assertEq(view[1494], 0, "1494th value should be 0"); +assertEq(view[1495], 255, "1495th value should be 255"); +assertEq(view[1496], 128, "1496th value should be 128"); +assertEq(view[1497], 127, "1497th value should be 127"); +assertEq(view[1498], 127, "1498th value should be 127"); +assertEq(view[1499], 255, "1499th value should be 255"); +assertEq(view[1500], 154, "1500th value should be 154"); +assertEq(view[1501], 255, "1501th value should be 255"); +assertEq(view[1502], 101, "1502th value should be 101"); +assertEq(view[1503], 255, "1503th value should be 255"); +assertEq(view[1504], 179, "1504th value should be 179"); +assertEq(view[1505], 127, "1505th value should be 127"); +assertEq(view[1506], 76, "1506th value should be 76"); +assertEq(view[1507], 255, "1507th value should be 255"); +assertEq(view[1508], 205, "1508th value should be 205"); +assertEq(view[1509], 255, "1509th value should be 255"); +assertEq(view[1510], 50, "1510th value should be 50"); +assertEq(view[1511], 255, "1511th value should be 255"); +assertEq(view[1512], 205, "1512th value should be 205"); +assertEq(view[1513], 255, "1513th value should be 255"); +assertEq(view[1514], 50, "1514th value should be 50"); +assertEq(view[1515], 255, "1515th value should be 255"); +assertEq(view[1516], 230, "1516th value should be 230"); +assertEq(view[1517], 127, "1517th value should be 127"); +assertEq(view[1518], 25, "1518th value should be 25"); +assertEq(view[1519], 255, "1519th value should be 255"); +assertEq(view[1520], 0, "1520th value should be 0"); +assertEq(view[1521], 0, "1521th value should be 0"); +assertEq(view[1522], 0, "1522th value should be 0"); +assertEq(view[1523], 255, "1523th value should be 255"); +assertEq(view[1524], 230, "1524th value should be 230"); +assertEq(view[1525], 127, "1525th value should be 127"); +assertEq(view[1526], 25, "1526th value should be 25"); +assertEq(view[1527], 255, "1527th value should be 255"); +assertEq(view[1528], 230, "1528th value should be 230"); +assertEq(view[1529], 127, "1529th value should be 127"); +assertEq(view[1530], 25, "1530th value should be 25"); +assertEq(view[1531], 255, "1531th value should be 255"); +assertEq(view[1532], 205, "1532th value should be 205"); +assertEq(view[1533], 255, "1533th value should be 255"); +assertEq(view[1534], 50, "1534th value should be 50"); +assertEq(view[1535], 255, "1535th value should be 255"); +assertEq(view[1536], 205, "1536th value should be 205"); +assertEq(view[1537], 255, "1537th value should be 255"); +assertEq(view[1538], 50, "1538th value should be 50"); +assertEq(view[1539], 255, "1539th value should be 255"); +assertEq(view[1540], 205, "1540th value should be 205"); +assertEq(view[1541], 255, "1541th value should be 255"); +assertEq(view[1542], 50, "1542th value should be 50"); +assertEq(view[1543], 255, "1543th value should be 255"); +assertEq(view[1544], 205, "1544th value should be 205"); +assertEq(view[1545], 255, "1545th value should be 255"); +assertEq(view[1546], 50, "1546th value should be 50"); +assertEq(view[1547], 255, "1547th value should be 255"); +assertEq(view[1548], 205, "1548th value should be 205"); +assertEq(view[1549], 255, "1549th value should be 255"); +assertEq(view[1550], 50, "1550th value should be 50"); +assertEq(view[1551], 255, "1551th value should be 255"); +assertEq(view[1552], 179, "1552th value should be 179"); +assertEq(view[1553], 127, "1553th value should be 127"); +assertEq(view[1554], 76, "1554th value should be 76"); +assertEq(view[1555], 255, "1555th value should be 255"); +assertEq(view[1556], 179, "1556th value should be 179"); +assertEq(view[1557], 127, "1557th value should be 127"); +assertEq(view[1558], 76, "1558th value should be 76"); +assertEq(view[1559], 255, "1559th value should be 255"); +assertEq(view[1560], 179, "1560th value should be 179"); +assertEq(view[1561], 127, "1561th value should be 127"); +assertEq(view[1562], 76, "1562th value should be 76"); +assertEq(view[1563], 255, "1563th value should be 255"); +assertEq(view[1564], 154, "1564th value should be 154"); +assertEq(view[1565], 255, "1565th value should be 255"); +assertEq(view[1566], 101, "1566th value should be 101"); +assertEq(view[1567], 255, "1567th value should be 255"); +assertEq(view[1568], 26, "1568th value should be 26"); +assertEq(view[1569], 127, "1569th value should be 127"); +assertEq(view[1570], 229, "1570th value should be 229"); +assertEq(view[1571], 255, "1571th value should be 255"); +assertEq(view[1572], 0, "1572th value should be 0"); +assertEq(view[1573], 0, "1573th value should be 0"); +assertEq(view[1574], 0, "1574th value should be 0"); +assertEq(view[1575], 255, "1575th value should be 255"); +assertEq(view[1576], 154, "1576th value should be 154"); +assertEq(view[1577], 255, "1577th value should be 255"); +assertEq(view[1578], 101, "1578th value should be 101"); +assertEq(view[1579], 255, "1579th value should be 255"); +assertEq(view[1580], 179, "1580th value should be 179"); +assertEq(view[1581], 127, "1581th value should be 127"); +assertEq(view[1582], 76, "1582th value should be 76"); +assertEq(view[1583], 255, "1583th value should be 255"); +assertEq(view[1584], 205, "1584th value should be 205"); +assertEq(view[1585], 255, "1585th value should be 255"); +assertEq(view[1586], 50, "1586th value should be 50"); +assertEq(view[1587], 255, "1587th value should be 255"); +assertEq(view[1588], 205, "1588th value should be 205"); +assertEq(view[1589], 255, "1589th value should be 255"); +assertEq(view[1590], 50, "1590th value should be 50"); +assertEq(view[1591], 255, "1591th value should be 255"); +assertEq(view[1592], 230, "1592th value should be 230"); +assertEq(view[1593], 127, "1593th value should be 127"); +assertEq(view[1594], 25, "1594th value should be 25"); +assertEq(view[1595], 255, "1595th value should be 255"); +assertEq(view[1596], 230, "1596th value should be 230"); +assertEq(view[1597], 127, "1597th value should be 127"); +assertEq(view[1598], 25, "1598th value should be 25"); +assertEq(view[1599], 255, "1599th value should be 255"); + +// Code used to generate the assertEq list above. +function generateAssertList() { + function template(i, x) { + return 'assertEq(view[' + i + '], ' + x + ', "' + i + 'th value should be ' + x + '");\n'; + } + var buf = '' + for (var i = 0; i < LIMIT_SHOW; i++) + buf += template(i, view[i]); + print(buf); +} +//generateAssertList(); From f3c6e8345949982e1f826b5a3cf3d2a1ae7e2091 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 30 Sep 2014 11:51:40 +0200 Subject: [PATCH 51/93] Backed out changeset 9dc808ef69a4 (bug 1068725) --- .../jit-test/tests/asm.js/simd-mandelbrot.js | 1814 ----------------- 1 file changed, 1814 deletions(-) delete mode 100644 js/src/jit-test/tests/asm.js/simd-mandelbrot.js diff --git a/js/src/jit-test/tests/asm.js/simd-mandelbrot.js b/js/src/jit-test/tests/asm.js/simd-mandelbrot.js deleted file mode 100644 index b6b364a5edfd..000000000000 --- a/js/src/jit-test/tests/asm.js/simd-mandelbrot.js +++ /dev/null @@ -1,1814 +0,0 @@ -/* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level : 2 ; js-curly-indent-offset: 0 -*- */ -/* vim: set ts=2 et sw=2 tw=80: */ - -// Mandelbrot using SIMD -// Author: Peter Jensen, Intel Corporation - -load(libdir + "asm.js"); -if (!isSimdAvailable() || typeof SIMD === 'undefined') { - print("won't run tests as simd extensions aren't activated yet"); - quit(0); -} - -// global variables -const MAX_ITERATIONS = 10; -const DRAW_ITERATIONS = 10; - -const CANVAS_WIDTH = 20; -const CANVAS_HEIGHT = 20; - -const LIMIT_SHOW = 20 * 20 * 4; - -// Asm.js module buffer. -var buffer = new ArrayBuffer(16 * 1024 * 1024); -var view = new Uint8Array(buffer); - -var moduleCode = ` - "use asm" - var b8 = new global.Uint8Array(buffer); - var toF = global.Math.fround; - var i4 = global.SIMD.int32x4; - var f4 = global.SIMD.float32x4; - var i4add = i4.add; - var i4and = i4.and; - var f4add = f4.add; - var f4sub = f4.sub; - var f4mul = f4.mul; - var f4lessThanOrEqual = f4.lessThanOrEqual; - var f4splat = f4.splat; - var imul = global.Math.imul; - const one4 = i4(1,1,1,1), two4 = f4(2,2,2,2), four4 = f4(4,4,4,4); - - const mk0 = 0x007fffff; - - function declareHeapLength() { - b8[0x00ffffff] = 0; - } - - function mapColorAndSetPixel (x, y, width, value, max_iterations) { - x = x | 0; - y = y | 0; - width = width | 0; - value = value | 0; - max_iterations = max_iterations | 0; - - var rgb = 0, r = 0, g = 0, b = 0, index = 0; - - index = (((imul((width >>> 0), (y >>> 0)) + x) | 0) * 4) | 0; - if ((value | 0) == (max_iterations | 0)) { - r = 0; - g = 0; - b = 0; - } else { - rgb = ~~toF(toF(toF(toF(value >>> 0) * toF(0xffff)) / toF(max_iterations >>> 0)) * toF(0xff)); - r = rgb & 0xff; - g = (rgb >>> 8) & 0xff; - b = (rgb >>> 16) & 0xff; - } - b8[(index & mk0) >> 0] = r; - b8[(index & mk0) + 1 >> 0] = g; - b8[(index & mk0) + 2 >> 0] = b; - b8[(index & mk0) + 3 >> 0] = 255; - } - - function mandelPixelX4 (xf, yf, yd, max_iterations) { - xf = toF(xf); - yf = toF(yf); - yd = toF(yd); - max_iterations = max_iterations | 0; - var c_re4 = f4(0,0,0,0), c_im4 = f4(0,0,0,0); - var z_re4 = f4(0,0,0,0), z_im4 = f4(0,0,0,0); - var count4 = i4(0,0,0,0); - var z_re24 = f4(0,0,0,0), z_im24 = f4(0,0,0,0); - var new_re4 = f4(0,0,0,0), new_im4 = f4(0,0,0,0); - var i = 0; - var mi4 = i4(0,0,0,0); - - c_re4 = f4splat(xf); - c_im4 = f4(yf, toF(yd + yf), toF(yd + toF(yd + yf)), toF(yd + toF(yd + toF(yd + yf)))); - - z_re4 = c_re4; - z_im4 = c_im4; - - for (i = 0; (i | 0) < (max_iterations | 0); i = (i + 1) | 0) { - z_re24 = f4mul(z_re4, z_re4); - z_im24 = f4mul(z_im4, z_im4); - mi4 = f4lessThanOrEqual(f4add(z_re24, z_im24), four4); - // If all 4 values are greater than 4.0, there's no reason to continue. - if ((mi4.signMask | 0) == 0x00) - break; - - new_re4 = f4sub(z_re24, z_im24); - new_im4 = f4mul(f4mul(two4, z_re4), z_im4); - z_re4 = f4add(c_re4, new_re4); - z_im4 = f4add(c_im4, new_im4); - count4 = i4add(count4, i4and(mi4, one4)); - } - return i4(count4); - } - - function mandelColumnX4 (x, width, height, xf, yf, yd, max_iterations) { - x = x | 0; - width = width | 0; - height = height | 0; - xf = toF(xf); - yf = toF(yf); - yd = toF(yd); - max_iterations = max_iterations | 0; - - var y = 0; - var ydx4 = toF(0); - var m4 = i4(0,0,0,0); - - ydx4 = toF(yd * toF(4)); - for (y = 0; (y | 0) < (height | 0); y = (y + 4) | 0) { - m4 = i4(mandelPixelX4(toF(xf), toF(yf), toF(yd), max_iterations)); - mapColorAndSetPixel(x | 0, y | 0, width, m4.x, max_iterations); - mapColorAndSetPixel(x | 0, (y + 1) | 0, width, m4.y, max_iterations); - mapColorAndSetPixel(x | 0, (y + 2) | 0, width, m4.z, max_iterations); - mapColorAndSetPixel(x | 0, (y + 3) | 0, width, m4.w, max_iterations); - yf = toF(yf + ydx4); - } - } - - function mandel (width, height, xc, yc, scale, max_iterations) { - width = width | 0; - height = height | 0; - xc = toF(xc); - yc = toF(yc); - scale = toF(scale); - max_iterations = max_iterations | 0; - - var x0 = toF(0), y0 = toF(0); - var xd = toF(0), yd = toF(0); - var xf = toF(0); - var x = 0; - - x0 = toF(xc - toF(scale * toF(1.5))); - y0 = toF(yc - scale); - xd = toF(toF(scale * toF(3)) / toF(width >>> 0)); - yd = toF(toF(scale * toF(2)) / toF(height >>> 0)); - xf = x0; - - for (x = 0; (x | 0) < (width | 0); x = (x + 1) | 0) { - mandelColumnX4(x, width, height, xf, y0, yd, max_iterations); - xf = toF(xf + xd); - } - } - - return mandel; -`; - -var FFI = {}; -var mandelbro = asmLink(asmCompile('global', 'ffi', 'buffer', moduleCode), this, FFI, buffer); - -function animateMandelbrot () { - var scale_start = 1.0; - var scale_end = 0.0005; - var xc_start = -0.5; - var yc_start = 0.0; - var xc_end = 0.0; - var yc_end = 0.75; - var steps = 200.0; - var scale_step = (scale_end - scale_start)/steps; - var xc_step = (xc_end - xc_start)/steps; - var yc_step = (yc_end - yc_start)/steps; - var scale = scale_start; - var xc = xc_start; - var yc = yc_start; - var i = 0; - var now = dateNow(); - - function draw1 () { - mandelbro(CANVAS_WIDTH, CANVAS_HEIGHT, xc, yc, scale, MAX_ITERATIONS); - if (scale < scale_end || scale > scale_start) { - scale_step = -scale_step; - xc_step = -xc_step; - yc_step = -yc_step; - } - scale += scale_step; - xc += xc_step; - yc += yc_step; - i++; - } - - var b = dateNow(); - for (var j = DRAW_ITERATIONS; j --> 0;) - draw1(); - print(dateNow() - b); -} - -animateMandelbrot(); - -assertEq(view[0], 0, "0th value should be 0"); -assertEq(view[1], 0, "1th value should be 0"); -assertEq(view[2], 0, "2th value should be 0"); -assertEq(view[3], 255, "3th value should be 255"); -assertEq(view[4], 230, "4th value should be 230"); -assertEq(view[5], 127, "5th value should be 127"); -assertEq(view[6], 25, "6th value should be 25"); -assertEq(view[7], 255, "7th value should be 255"); -assertEq(view[8], 230, "8th value should be 230"); -assertEq(view[9], 127, "9th value should be 127"); -assertEq(view[10], 25, "10th value should be 25"); -assertEq(view[11], 255, "11th value should be 255"); -assertEq(view[12], 205, "12th value should be 205"); -assertEq(view[13], 255, "13th value should be 255"); -assertEq(view[14], 50, "14th value should be 50"); -assertEq(view[15], 255, "15th value should be 255"); -assertEq(view[16], 205, "16th value should be 205"); -assertEq(view[17], 255, "17th value should be 255"); -assertEq(view[18], 50, "18th value should be 50"); -assertEq(view[19], 255, "19th value should be 255"); -assertEq(view[20], 205, "20th value should be 205"); -assertEq(view[21], 255, "21th value should be 255"); -assertEq(view[22], 50, "22th value should be 50"); -assertEq(view[23], 255, "23th value should be 255"); -assertEq(view[24], 205, "24th value should be 205"); -assertEq(view[25], 255, "25th value should be 255"); -assertEq(view[26], 50, "26th value should be 50"); -assertEq(view[27], 255, "27th value should be 255"); -assertEq(view[28], 205, "28th value should be 205"); -assertEq(view[29], 255, "29th value should be 255"); -assertEq(view[30], 50, "30th value should be 50"); -assertEq(view[31], 255, "31th value should be 255"); -assertEq(view[32], 179, "32th value should be 179"); -assertEq(view[33], 127, "33th value should be 127"); -assertEq(view[34], 76, "34th value should be 76"); -assertEq(view[35], 255, "35th value should be 255"); -assertEq(view[36], 179, "36th value should be 179"); -assertEq(view[37], 127, "37th value should be 127"); -assertEq(view[38], 76, "38th value should be 76"); -assertEq(view[39], 255, "39th value should be 255"); -assertEq(view[40], 179, "40th value should be 179"); -assertEq(view[41], 127, "41th value should be 127"); -assertEq(view[42], 76, "42th value should be 76"); -assertEq(view[43], 255, "43th value should be 255"); -assertEq(view[44], 154, "44th value should be 154"); -assertEq(view[45], 255, "45th value should be 255"); -assertEq(view[46], 101, "46th value should be 101"); -assertEq(view[47], 255, "47th value should be 255"); -assertEq(view[48], 78, "48th value should be 78"); -assertEq(view[49], 127, "49th value should be 127"); -assertEq(view[50], 178, "50th value should be 178"); -assertEq(view[51], 255, "51th value should be 255"); -assertEq(view[52], 52, "52th value should be 52"); -assertEq(view[53], 255, "53th value should be 255"); -assertEq(view[54], 203, "54th value should be 203"); -assertEq(view[55], 255, "55th value should be 255"); -assertEq(view[56], 154, "56th value should be 154"); -assertEq(view[57], 255, "57th value should be 255"); -assertEq(view[58], 101, "58th value should be 101"); -assertEq(view[59], 255, "59th value should be 255"); -assertEq(view[60], 179, "60th value should be 179"); -assertEq(view[61], 127, "61th value should be 127"); -assertEq(view[62], 76, "62th value should be 76"); -assertEq(view[63], 255, "63th value should be 255"); -assertEq(view[64], 205, "64th value should be 205"); -assertEq(view[65], 255, "65th value should be 255"); -assertEq(view[66], 50, "66th value should be 50"); -assertEq(view[67], 255, "67th value should be 255"); -assertEq(view[68], 205, "68th value should be 205"); -assertEq(view[69], 255, "69th value should be 255"); -assertEq(view[70], 50, "70th value should be 50"); -assertEq(view[71], 255, "71th value should be 255"); -assertEq(view[72], 230, "72th value should be 230"); -assertEq(view[73], 127, "73th value should be 127"); -assertEq(view[74], 25, "74th value should be 25"); -assertEq(view[75], 255, "75th value should be 255"); -assertEq(view[76], 230, "76th value should be 230"); -assertEq(view[77], 127, "77th value should be 127"); -assertEq(view[78], 25, "78th value should be 25"); -assertEq(view[79], 255, "79th value should be 255"); -assertEq(view[80], 0, "80th value should be 0"); -assertEq(view[81], 0, "81th value should be 0"); -assertEq(view[82], 0, "82th value should be 0"); -assertEq(view[83], 255, "83th value should be 255"); -assertEq(view[84], 230, "84th value should be 230"); -assertEq(view[85], 127, "85th value should be 127"); -assertEq(view[86], 25, "86th value should be 25"); -assertEq(view[87], 255, "87th value should be 255"); -assertEq(view[88], 205, "88th value should be 205"); -assertEq(view[89], 255, "89th value should be 255"); -assertEq(view[90], 50, "90th value should be 50"); -assertEq(view[91], 255, "91th value should be 255"); -assertEq(view[92], 205, "92th value should be 205"); -assertEq(view[93], 255, "93th value should be 255"); -assertEq(view[94], 50, "94th value should be 50"); -assertEq(view[95], 255, "95th value should be 255"); -assertEq(view[96], 205, "96th value should be 205"); -assertEq(view[97], 255, "97th value should be 255"); -assertEq(view[98], 50, "98th value should be 50"); -assertEq(view[99], 255, "99th value should be 255"); -assertEq(view[100], 205, "100th value should be 205"); -assertEq(view[101], 255, "101th value should be 255"); -assertEq(view[102], 50, "102th value should be 50"); -assertEq(view[103], 255, "103th value should be 255"); -assertEq(view[104], 205, "104th value should be 205"); -assertEq(view[105], 255, "105th value should be 255"); -assertEq(view[106], 50, "106th value should be 50"); -assertEq(view[107], 255, "107th value should be 255"); -assertEq(view[108], 205, "108th value should be 205"); -assertEq(view[109], 255, "109th value should be 255"); -assertEq(view[110], 50, "110th value should be 50"); -assertEq(view[111], 255, "111th value should be 255"); -assertEq(view[112], 179, "112th value should be 179"); -assertEq(view[113], 127, "113th value should be 127"); -assertEq(view[114], 76, "114th value should be 76"); -assertEq(view[115], 255, "115th value should be 255"); -assertEq(view[116], 179, "116th value should be 179"); -assertEq(view[117], 127, "117th value should be 127"); -assertEq(view[118], 76, "118th value should be 76"); -assertEq(view[119], 255, "119th value should be 255"); -assertEq(view[120], 154, "120th value should be 154"); -assertEq(view[121], 255, "121th value should be 255"); -assertEq(view[122], 101, "122th value should be 101"); -assertEq(view[123], 255, "123th value should be 255"); -assertEq(view[124], 103, "124th value should be 103"); -assertEq(view[125], 255, "125th value should be 255"); -assertEq(view[126], 152, "126th value should be 152"); -assertEq(view[127], 255, "127th value should be 255"); -assertEq(view[128], 0, "128th value should be 0"); -assertEq(view[129], 0, "129th value should be 0"); -assertEq(view[130], 0, "130th value should be 0"); -assertEq(view[131], 255, "131th value should be 255"); -assertEq(view[132], 0, "132th value should be 0"); -assertEq(view[133], 0, "133th value should be 0"); -assertEq(view[134], 0, "134th value should be 0"); -assertEq(view[135], 255, "135th value should be 255"); -assertEq(view[136], 128, "136th value should be 128"); -assertEq(view[137], 127, "137th value should be 127"); -assertEq(view[138], 127, "138th value should be 127"); -assertEq(view[139], 255, "139th value should be 255"); -assertEq(view[140], 154, "140th value should be 154"); -assertEq(view[141], 255, "141th value should be 255"); -assertEq(view[142], 101, "142th value should be 101"); -assertEq(view[143], 255, "143th value should be 255"); -assertEq(view[144], 179, "144th value should be 179"); -assertEq(view[145], 127, "145th value should be 127"); -assertEq(view[146], 76, "146th value should be 76"); -assertEq(view[147], 255, "147th value should be 255"); -assertEq(view[148], 205, "148th value should be 205"); -assertEq(view[149], 255, "149th value should be 255"); -assertEq(view[150], 50, "150th value should be 50"); -assertEq(view[151], 255, "151th value should be 255"); -assertEq(view[152], 205, "152th value should be 205"); -assertEq(view[153], 255, "153th value should be 255"); -assertEq(view[154], 50, "154th value should be 50"); -assertEq(view[155], 255, "155th value should be 255"); -assertEq(view[156], 230, "156th value should be 230"); -assertEq(view[157], 127, "157th value should be 127"); -assertEq(view[158], 25, "158th value should be 25"); -assertEq(view[159], 255, "159th value should be 255"); -assertEq(view[160], 0, "160th value should be 0"); -assertEq(view[161], 0, "161th value should be 0"); -assertEq(view[162], 0, "162th value should be 0"); -assertEq(view[163], 255, "163th value should be 255"); -assertEq(view[164], 230, "164th value should be 230"); -assertEq(view[165], 127, "165th value should be 127"); -assertEq(view[166], 25, "166th value should be 25"); -assertEq(view[167], 255, "167th value should be 255"); -assertEq(view[168], 205, "168th value should be 205"); -assertEq(view[169], 255, "169th value should be 255"); -assertEq(view[170], 50, "170th value should be 50"); -assertEq(view[171], 255, "171th value should be 255"); -assertEq(view[172], 205, "172th value should be 205"); -assertEq(view[173], 255, "173th value should be 255"); -assertEq(view[174], 50, "174th value should be 50"); -assertEq(view[175], 255, "175th value should be 255"); -assertEq(view[176], 205, "176th value should be 205"); -assertEq(view[177], 255, "177th value should be 255"); -assertEq(view[178], 50, "178th value should be 50"); -assertEq(view[179], 255, "179th value should be 255"); -assertEq(view[180], 205, "180th value should be 205"); -assertEq(view[181], 255, "181th value should be 255"); -assertEq(view[182], 50, "182th value should be 50"); -assertEq(view[183], 255, "183th value should be 255"); -assertEq(view[184], 205, "184th value should be 205"); -assertEq(view[185], 255, "185th value should be 255"); -assertEq(view[186], 50, "186th value should be 50"); -assertEq(view[187], 255, "187th value should be 255"); -assertEq(view[188], 179, "188th value should be 179"); -assertEq(view[189], 127, "189th value should be 127"); -assertEq(view[190], 76, "190th value should be 76"); -assertEq(view[191], 255, "191th value should be 255"); -assertEq(view[192], 179, "192th value should be 179"); -assertEq(view[193], 127, "193th value should be 127"); -assertEq(view[194], 76, "194th value should be 76"); -assertEq(view[195], 255, "195th value should be 255"); -assertEq(view[196], 154, "196th value should be 154"); -assertEq(view[197], 255, "197th value should be 255"); -assertEq(view[198], 101, "198th value should be 101"); -assertEq(view[199], 255, "199th value should be 255"); -assertEq(view[200], 103, "200th value should be 103"); -assertEq(view[201], 255, "201th value should be 255"); -assertEq(view[202], 152, "202th value should be 152"); -assertEq(view[203], 255, "203th value should be 255"); -assertEq(view[204], 78, "204th value should be 78"); -assertEq(view[205], 127, "205th value should be 127"); -assertEq(view[206], 178, "206th value should be 178"); -assertEq(view[207], 255, "207th value should be 255"); -assertEq(view[208], 0, "208th value should be 0"); -assertEq(view[209], 0, "209th value should be 0"); -assertEq(view[210], 0, "210th value should be 0"); -assertEq(view[211], 255, "211th value should be 255"); -assertEq(view[212], 0, "212th value should be 0"); -assertEq(view[213], 0, "213th value should be 0"); -assertEq(view[214], 0, "214th value should be 0"); -assertEq(view[215], 255, "215th value should be 255"); -assertEq(view[216], 78, "216th value should be 78"); -assertEq(view[217], 127, "217th value should be 127"); -assertEq(view[218], 178, "218th value should be 178"); -assertEq(view[219], 255, "219th value should be 255"); -assertEq(view[220], 128, "220th value should be 128"); -assertEq(view[221], 127, "221th value should be 127"); -assertEq(view[222], 127, "222th value should be 127"); -assertEq(view[223], 255, "223th value should be 255"); -assertEq(view[224], 154, "224th value should be 154"); -assertEq(view[225], 255, "225th value should be 255"); -assertEq(view[226], 101, "226th value should be 101"); -assertEq(view[227], 255, "227th value should be 255"); -assertEq(view[228], 205, "228th value should be 205"); -assertEq(view[229], 255, "229th value should be 255"); -assertEq(view[230], 50, "230th value should be 50"); -assertEq(view[231], 255, "231th value should be 255"); -assertEq(view[232], 205, "232th value should be 205"); -assertEq(view[233], 255, "233th value should be 255"); -assertEq(view[234], 50, "234th value should be 50"); -assertEq(view[235], 255, "235th value should be 255"); -assertEq(view[236], 230, "236th value should be 230"); -assertEq(view[237], 127, "237th value should be 127"); -assertEq(view[238], 25, "238th value should be 25"); -assertEq(view[239], 255, "239th value should be 255"); -assertEq(view[240], 0, "240th value should be 0"); -assertEq(view[241], 0, "241th value should be 0"); -assertEq(view[242], 0, "242th value should be 0"); -assertEq(view[243], 255, "243th value should be 255"); -assertEq(view[244], 205, "244th value should be 205"); -assertEq(view[245], 255, "245th value should be 255"); -assertEq(view[246], 50, "246th value should be 50"); -assertEq(view[247], 255, "247th value should be 255"); -assertEq(view[248], 205, "248th value should be 205"); -assertEq(view[249], 255, "249th value should be 255"); -assertEq(view[250], 50, "250th value should be 50"); -assertEq(view[251], 255, "251th value should be 255"); -assertEq(view[252], 205, "252th value should be 205"); -assertEq(view[253], 255, "253th value should be 255"); -assertEq(view[254], 50, "254th value should be 50"); -assertEq(view[255], 255, "255th value should be 255"); -assertEq(view[256], 205, "256th value should be 205"); -assertEq(view[257], 255, "257th value should be 255"); -assertEq(view[258], 50, "258th value should be 50"); -assertEq(view[259], 255, "259th value should be 255"); -assertEq(view[260], 205, "260th value should be 205"); -assertEq(view[261], 255, "261th value should be 255"); -assertEq(view[262], 50, "262th value should be 50"); -assertEq(view[263], 255, "263th value should be 255"); -assertEq(view[264], 179, "264th value should be 179"); -assertEq(view[265], 127, "265th value should be 127"); -assertEq(view[266], 76, "266th value should be 76"); -assertEq(view[267], 255, "267th value should be 255"); -assertEq(view[268], 179, "268th value should be 179"); -assertEq(view[269], 127, "269th value should be 127"); -assertEq(view[270], 76, "270th value should be 76"); -assertEq(view[271], 255, "271th value should be 255"); -assertEq(view[272], 154, "272th value should be 154"); -assertEq(view[273], 255, "273th value should be 255"); -assertEq(view[274], 101, "274th value should be 101"); -assertEq(view[275], 255, "275th value should be 255"); -assertEq(view[276], 52, "276th value should be 52"); -assertEq(view[277], 255, "277th value should be 255"); -assertEq(view[278], 203, "278th value should be 203"); -assertEq(view[279], 255, "279th value should be 255"); -assertEq(view[280], 0, "280th value should be 0"); -assertEq(view[281], 0, "281th value should be 0"); -assertEq(view[282], 0, "282th value should be 0"); -assertEq(view[283], 255, "283th value should be 255"); -assertEq(view[284], 0, "284th value should be 0"); -assertEq(view[285], 0, "285th value should be 0"); -assertEq(view[286], 0, "286th value should be 0"); -assertEq(view[287], 255, "287th value should be 255"); -assertEq(view[288], 0, "288th value should be 0"); -assertEq(view[289], 0, "289th value should be 0"); -assertEq(view[290], 0, "290th value should be 0"); -assertEq(view[291], 255, "291th value should be 255"); -assertEq(view[292], 0, "292th value should be 0"); -assertEq(view[293], 0, "293th value should be 0"); -assertEq(view[294], 0, "294th value should be 0"); -assertEq(view[295], 255, "295th value should be 255"); -assertEq(view[296], 0, "296th value should be 0"); -assertEq(view[297], 0, "297th value should be 0"); -assertEq(view[298], 0, "298th value should be 0"); -assertEq(view[299], 255, "299th value should be 255"); -assertEq(view[300], 52, "300th value should be 52"); -assertEq(view[301], 255, "301th value should be 255"); -assertEq(view[302], 203, "302th value should be 203"); -assertEq(view[303], 255, "303th value should be 255"); -assertEq(view[304], 52, "304th value should be 52"); -assertEq(view[305], 255, "305th value should be 255"); -assertEq(view[306], 203, "306th value should be 203"); -assertEq(view[307], 255, "307th value should be 255"); -assertEq(view[308], 179, "308th value should be 179"); -assertEq(view[309], 127, "309th value should be 127"); -assertEq(view[310], 76, "310th value should be 76"); -assertEq(view[311], 255, "311th value should be 255"); -assertEq(view[312], 205, "312th value should be 205"); -assertEq(view[313], 255, "313th value should be 255"); -assertEq(view[314], 50, "314th value should be 50"); -assertEq(view[315], 255, "315th value should be 255"); -assertEq(view[316], 205, "316th value should be 205"); -assertEq(view[317], 255, "317th value should be 255"); -assertEq(view[318], 50, "318th value should be 50"); -assertEq(view[319], 255, "319th value should be 255"); -assertEq(view[320], 230, "320th value should be 230"); -assertEq(view[321], 127, "321th value should be 127"); -assertEq(view[322], 25, "322th value should be 25"); -assertEq(view[323], 255, "323th value should be 255"); -assertEq(view[324], 205, "324th value should be 205"); -assertEq(view[325], 255, "325th value should be 255"); -assertEq(view[326], 50, "326th value should be 50"); -assertEq(view[327], 255, "327th value should be 255"); -assertEq(view[328], 205, "328th value should be 205"); -assertEq(view[329], 255, "329th value should be 255"); -assertEq(view[330], 50, "330th value should be 50"); -assertEq(view[331], 255, "331th value should be 255"); -assertEq(view[332], 205, "332th value should be 205"); -assertEq(view[333], 255, "333th value should be 255"); -assertEq(view[334], 50, "334th value should be 50"); -assertEq(view[335], 255, "335th value should be 255"); -assertEq(view[336], 205, "336th value should be 205"); -assertEq(view[337], 255, "337th value should be 255"); -assertEq(view[338], 50, "338th value should be 50"); -assertEq(view[339], 255, "339th value should be 255"); -assertEq(view[340], 179, "340th value should be 179"); -assertEq(view[341], 127, "341th value should be 127"); -assertEq(view[342], 76, "342th value should be 76"); -assertEq(view[343], 255, "343th value should be 255"); -assertEq(view[344], 154, "344th value should be 154"); -assertEq(view[345], 255, "345th value should be 255"); -assertEq(view[346], 101, "346th value should be 101"); -assertEq(view[347], 255, "347th value should be 255"); -assertEq(view[348], 154, "348th value should be 154"); -assertEq(view[349], 255, "349th value should be 255"); -assertEq(view[350], 101, "350th value should be 101"); -assertEq(view[351], 255, "351th value should be 255"); -assertEq(view[352], 128, "352th value should be 128"); -assertEq(view[353], 127, "353th value should be 127"); -assertEq(view[354], 127, "354th value should be 127"); -assertEq(view[355], 255, "355th value should be 255"); -assertEq(view[356], 52, "356th value should be 52"); -assertEq(view[357], 255, "357th value should be 255"); -assertEq(view[358], 203, "358th value should be 203"); -assertEq(view[359], 255, "359th value should be 255"); -assertEq(view[360], 0, "360th value should be 0"); -assertEq(view[361], 0, "361th value should be 0"); -assertEq(view[362], 0, "362th value should be 0"); -assertEq(view[363], 255, "363th value should be 255"); -assertEq(view[364], 0, "364th value should be 0"); -assertEq(view[365], 0, "365th value should be 0"); -assertEq(view[366], 0, "366th value should be 0"); -assertEq(view[367], 255, "367th value should be 255"); -assertEq(view[368], 0, "368th value should be 0"); -assertEq(view[369], 0, "369th value should be 0"); -assertEq(view[370], 0, "370th value should be 0"); -assertEq(view[371], 255, "371th value should be 255"); -assertEq(view[372], 0, "372th value should be 0"); -assertEq(view[373], 0, "373th value should be 0"); -assertEq(view[374], 0, "374th value should be 0"); -assertEq(view[375], 255, "375th value should be 255"); -assertEq(view[376], 0, "376th value should be 0"); -assertEq(view[377], 0, "377th value should be 0"); -assertEq(view[378], 0, "378th value should be 0"); -assertEq(view[379], 255, "379th value should be 255"); -assertEq(view[380], 0, "380th value should be 0"); -assertEq(view[381], 0, "381th value should be 0"); -assertEq(view[382], 0, "382th value should be 0"); -assertEq(view[383], 255, "383th value should be 255"); -assertEq(view[384], 52, "384th value should be 52"); -assertEq(view[385], 255, "385th value should be 255"); -assertEq(view[386], 203, "386th value should be 203"); -assertEq(view[387], 255, "387th value should be 255"); -assertEq(view[388], 179, "388th value should be 179"); -assertEq(view[389], 127, "389th value should be 127"); -assertEq(view[390], 76, "390th value should be 76"); -assertEq(view[391], 255, "391th value should be 255"); -assertEq(view[392], 205, "392th value should be 205"); -assertEq(view[393], 255, "393th value should be 255"); -assertEq(view[394], 50, "394th value should be 50"); -assertEq(view[395], 255, "395th value should be 255"); -assertEq(view[396], 205, "396th value should be 205"); -assertEq(view[397], 255, "397th value should be 255"); -assertEq(view[398], 50, "398th value should be 50"); -assertEq(view[399], 255, "399th value should be 255"); -assertEq(view[400], 205, "400th value should be 205"); -assertEq(view[401], 255, "401th value should be 255"); -assertEq(view[402], 50, "402th value should be 50"); -assertEq(view[403], 255, "403th value should be 255"); -assertEq(view[404], 205, "404th value should be 205"); -assertEq(view[405], 255, "405th value should be 255"); -assertEq(view[406], 50, "406th value should be 50"); -assertEq(view[407], 255, "407th value should be 255"); -assertEq(view[408], 205, "408th value should be 205"); -assertEq(view[409], 255, "409th value should be 255"); -assertEq(view[410], 50, "410th value should be 50"); -assertEq(view[411], 255, "411th value should be 255"); -assertEq(view[412], 205, "412th value should be 205"); -assertEq(view[413], 255, "413th value should be 255"); -assertEq(view[414], 50, "414th value should be 50"); -assertEq(view[415], 255, "415th value should be 255"); -assertEq(view[416], 154, "416th value should be 154"); -assertEq(view[417], 255, "417th value should be 255"); -assertEq(view[418], 101, "418th value should be 101"); -assertEq(view[419], 255, "419th value should be 255"); -assertEq(view[420], 128, "420th value should be 128"); -assertEq(view[421], 127, "421th value should be 127"); -assertEq(view[422], 127, "422th value should be 127"); -assertEq(view[423], 255, "423th value should be 255"); -assertEq(view[424], 154, "424th value should be 154"); -assertEq(view[425], 255, "425th value should be 255"); -assertEq(view[426], 101, "426th value should be 101"); -assertEq(view[427], 255, "427th value should be 255"); -assertEq(view[428], 128, "428th value should be 128"); -assertEq(view[429], 127, "429th value should be 127"); -assertEq(view[430], 127, "430th value should be 127"); -assertEq(view[431], 255, "431th value should be 255"); -assertEq(view[432], 103, "432th value should be 103"); -assertEq(view[433], 255, "433th value should be 255"); -assertEq(view[434], 152, "434th value should be 152"); -assertEq(view[435], 255, "435th value should be 255"); -assertEq(view[436], 0, "436th value should be 0"); -assertEq(view[437], 0, "437th value should be 0"); -assertEq(view[438], 0, "438th value should be 0"); -assertEq(view[439], 255, "439th value should be 255"); -assertEq(view[440], 0, "440th value should be 0"); -assertEq(view[441], 0, "441th value should be 0"); -assertEq(view[442], 0, "442th value should be 0"); -assertEq(view[443], 255, "443th value should be 255"); -assertEq(view[444], 0, "444th value should be 0"); -assertEq(view[445], 0, "445th value should be 0"); -assertEq(view[446], 0, "446th value should be 0"); -assertEq(view[447], 255, "447th value should be 255"); -assertEq(view[448], 0, "448th value should be 0"); -assertEq(view[449], 0, "449th value should be 0"); -assertEq(view[450], 0, "450th value should be 0"); -assertEq(view[451], 255, "451th value should be 255"); -assertEq(view[452], 0, "452th value should be 0"); -assertEq(view[453], 0, "453th value should be 0"); -assertEq(view[454], 0, "454th value should be 0"); -assertEq(view[455], 255, "455th value should be 255"); -assertEq(view[456], 0, "456th value should be 0"); -assertEq(view[457], 0, "457th value should be 0"); -assertEq(view[458], 0, "458th value should be 0"); -assertEq(view[459], 255, "459th value should be 255"); -assertEq(view[460], 0, "460th value should be 0"); -assertEq(view[461], 0, "461th value should be 0"); -assertEq(view[462], 0, "462th value should be 0"); -assertEq(view[463], 255, "463th value should be 255"); -assertEq(view[464], 78, "464th value should be 78"); -assertEq(view[465], 127, "465th value should be 127"); -assertEq(view[466], 178, "466th value should be 178"); -assertEq(view[467], 255, "467th value should be 255"); -assertEq(view[468], 154, "468th value should be 154"); -assertEq(view[469], 255, "469th value should be 255"); -assertEq(view[470], 101, "470th value should be 101"); -assertEq(view[471], 255, "471th value should be 255"); -assertEq(view[472], 205, "472th value should be 205"); -assertEq(view[473], 255, "473th value should be 255"); -assertEq(view[474], 50, "474th value should be 50"); -assertEq(view[475], 255, "475th value should be 255"); -assertEq(view[476], 205, "476th value should be 205"); -assertEq(view[477], 255, "477th value should be 255"); -assertEq(view[478], 50, "478th value should be 50"); -assertEq(view[479], 255, "479th value should be 255"); -assertEq(view[480], 205, "480th value should be 205"); -assertEq(view[481], 255, "481th value should be 255"); -assertEq(view[482], 50, "482th value should be 50"); -assertEq(view[483], 255, "483th value should be 255"); -assertEq(view[484], 205, "484th value should be 205"); -assertEq(view[485], 255, "485th value should be 255"); -assertEq(view[486], 50, "486th value should be 50"); -assertEq(view[487], 255, "487th value should be 255"); -assertEq(view[488], 179, "488th value should be 179"); -assertEq(view[489], 127, "489th value should be 127"); -assertEq(view[490], 76, "490th value should be 76"); -assertEq(view[491], 255, "491th value should be 255"); -assertEq(view[492], 179, "492th value should be 179"); -assertEq(view[493], 127, "493th value should be 127"); -assertEq(view[494], 76, "494th value should be 76"); -assertEq(view[495], 255, "495th value should be 255"); -assertEq(view[496], 128, "496th value should be 128"); -assertEq(view[497], 127, "497th value should be 127"); -assertEq(view[498], 127, "498th value should be 127"); -assertEq(view[499], 255, "499th value should be 255"); -assertEq(view[500], 52, "500th value should be 52"); -assertEq(view[501], 255, "501th value should be 255"); -assertEq(view[502], 203, "502th value should be 203"); -assertEq(view[503], 255, "503th value should be 255"); -assertEq(view[504], 0, "504th value should be 0"); -assertEq(view[505], 0, "505th value should be 0"); -assertEq(view[506], 0, "506th value should be 0"); -assertEq(view[507], 255, "507th value should be 255"); -assertEq(view[508], 78, "508th value should be 78"); -assertEq(view[509], 127, "509th value should be 127"); -assertEq(view[510], 178, "510th value should be 178"); -assertEq(view[511], 255, "511th value should be 255"); -assertEq(view[512], 52, "512th value should be 52"); -assertEq(view[513], 255, "513th value should be 255"); -assertEq(view[514], 203, "514th value should be 203"); -assertEq(view[515], 255, "515th value should be 255"); -assertEq(view[516], 0, "516th value should be 0"); -assertEq(view[517], 0, "517th value should be 0"); -assertEq(view[518], 0, "518th value should be 0"); -assertEq(view[519], 255, "519th value should be 255"); -assertEq(view[520], 0, "520th value should be 0"); -assertEq(view[521], 0, "521th value should be 0"); -assertEq(view[522], 0, "522th value should be 0"); -assertEq(view[523], 255, "523th value should be 255"); -assertEq(view[524], 0, "524th value should be 0"); -assertEq(view[525], 0, "525th value should be 0"); -assertEq(view[526], 0, "526th value should be 0"); -assertEq(view[527], 255, "527th value should be 255"); -assertEq(view[528], 0, "528th value should be 0"); -assertEq(view[529], 0, "529th value should be 0"); -assertEq(view[530], 0, "530th value should be 0"); -assertEq(view[531], 255, "531th value should be 255"); -assertEq(view[532], 0, "532th value should be 0"); -assertEq(view[533], 0, "533th value should be 0"); -assertEq(view[534], 0, "534th value should be 0"); -assertEq(view[535], 255, "535th value should be 255"); -assertEq(view[536], 0, "536th value should be 0"); -assertEq(view[537], 0, "537th value should be 0"); -assertEq(view[538], 0, "538th value should be 0"); -assertEq(view[539], 255, "539th value should be 255"); -assertEq(view[540], 0, "540th value should be 0"); -assertEq(view[541], 0, "541th value should be 0"); -assertEq(view[542], 0, "542th value should be 0"); -assertEq(view[543], 255, "543th value should be 255"); -assertEq(view[544], 0, "544th value should be 0"); -assertEq(view[545], 0, "545th value should be 0"); -assertEq(view[546], 0, "546th value should be 0"); -assertEq(view[547], 255, "547th value should be 255"); -assertEq(view[548], 154, "548th value should be 154"); -assertEq(view[549], 255, "549th value should be 255"); -assertEq(view[550], 101, "550th value should be 101"); -assertEq(view[551], 255, "551th value should be 255"); -assertEq(view[552], 205, "552th value should be 205"); -assertEq(view[553], 255, "553th value should be 255"); -assertEq(view[554], 50, "554th value should be 50"); -assertEq(view[555], 255, "555th value should be 255"); -assertEq(view[556], 205, "556th value should be 205"); -assertEq(view[557], 255, "557th value should be 255"); -assertEq(view[558], 50, "558th value should be 50"); -assertEq(view[559], 255, "559th value should be 255"); -assertEq(view[560], 205, "560th value should be 205"); -assertEq(view[561], 255, "561th value should be 255"); -assertEq(view[562], 50, "562th value should be 50"); -assertEq(view[563], 255, "563th value should be 255"); -assertEq(view[564], 179, "564th value should be 179"); -assertEq(view[565], 127, "565th value should be 127"); -assertEq(view[566], 76, "566th value should be 76"); -assertEq(view[567], 255, "567th value should be 255"); -assertEq(view[568], 179, "568th value should be 179"); -assertEq(view[569], 127, "569th value should be 127"); -assertEq(view[570], 76, "570th value should be 76"); -assertEq(view[571], 255, "571th value should be 255"); -assertEq(view[572], 154, "572th value should be 154"); -assertEq(view[573], 255, "573th value should be 255"); -assertEq(view[574], 101, "574th value should be 101"); -assertEq(view[575], 255, "575th value should be 255"); -assertEq(view[576], 103, "576th value should be 103"); -assertEq(view[577], 255, "577th value should be 255"); -assertEq(view[578], 152, "578th value should be 152"); -assertEq(view[579], 255, "579th value should be 255"); -assertEq(view[580], 0, "580th value should be 0"); -assertEq(view[581], 0, "581th value should be 0"); -assertEq(view[582], 0, "582th value should be 0"); -assertEq(view[583], 255, "583th value should be 255"); -assertEq(view[584], 0, "584th value should be 0"); -assertEq(view[585], 0, "585th value should be 0"); -assertEq(view[586], 0, "586th value should be 0"); -assertEq(view[587], 255, "587th value should be 255"); -assertEq(view[588], 0, "588th value should be 0"); -assertEq(view[589], 0, "589th value should be 0"); -assertEq(view[590], 0, "590th value should be 0"); -assertEq(view[591], 255, "591th value should be 255"); -assertEq(view[592], 0, "592th value should be 0"); -assertEq(view[593], 0, "593th value should be 0"); -assertEq(view[594], 0, "594th value should be 0"); -assertEq(view[595], 255, "595th value should be 255"); -assertEq(view[596], 0, "596th value should be 0"); -assertEq(view[597], 0, "597th value should be 0"); -assertEq(view[598], 0, "598th value should be 0"); -assertEq(view[599], 255, "599th value should be 255"); -assertEq(view[600], 0, "600th value should be 0"); -assertEq(view[601], 0, "601th value should be 0"); -assertEq(view[602], 0, "602th value should be 0"); -assertEq(view[603], 255, "603th value should be 255"); -assertEq(view[604], 0, "604th value should be 0"); -assertEq(view[605], 0, "605th value should be 0"); -assertEq(view[606], 0, "606th value should be 0"); -assertEq(view[607], 255, "607th value should be 255"); -assertEq(view[608], 0, "608th value should be 0"); -assertEq(view[609], 0, "609th value should be 0"); -assertEq(view[610], 0, "610th value should be 0"); -assertEq(view[611], 255, "611th value should be 255"); -assertEq(view[612], 0, "612th value should be 0"); -assertEq(view[613], 0, "613th value should be 0"); -assertEq(view[614], 0, "614th value should be 0"); -assertEq(view[615], 255, "615th value should be 255"); -assertEq(view[616], 0, "616th value should be 0"); -assertEq(view[617], 0, "617th value should be 0"); -assertEq(view[618], 0, "618th value should be 0"); -assertEq(view[619], 255, "619th value should be 255"); -assertEq(view[620], 0, "620th value should be 0"); -assertEq(view[621], 0, "621th value should be 0"); -assertEq(view[622], 0, "622th value should be 0"); -assertEq(view[623], 255, "623th value should be 255"); -assertEq(view[624], 0, "624th value should be 0"); -assertEq(view[625], 0, "625th value should be 0"); -assertEq(view[626], 0, "626th value should be 0"); -assertEq(view[627], 255, "627th value should be 255"); -assertEq(view[628], 154, "628th value should be 154"); -assertEq(view[629], 255, "629th value should be 255"); -assertEq(view[630], 101, "630th value should be 101"); -assertEq(view[631], 255, "631th value should be 255"); -assertEq(view[632], 205, "632th value should be 205"); -assertEq(view[633], 255, "633th value should be 255"); -assertEq(view[634], 50, "634th value should be 50"); -assertEq(view[635], 255, "635th value should be 255"); -assertEq(view[636], 205, "636th value should be 205"); -assertEq(view[637], 255, "637th value should be 255"); -assertEq(view[638], 50, "638th value should be 50"); -assertEq(view[639], 255, "639th value should be 255"); -assertEq(view[640], 179, "640th value should be 179"); -assertEq(view[641], 127, "641th value should be 127"); -assertEq(view[642], 76, "642th value should be 76"); -assertEq(view[643], 255, "643th value should be 255"); -assertEq(view[644], 179, "644th value should be 179"); -assertEq(view[645], 127, "645th value should be 127"); -assertEq(view[646], 76, "646th value should be 76"); -assertEq(view[647], 255, "647th value should be 255"); -assertEq(view[648], 154, "648th value should be 154"); -assertEq(view[649], 255, "649th value should be 255"); -assertEq(view[650], 101, "650th value should be 101"); -assertEq(view[651], 255, "651th value should be 255"); -assertEq(view[652], 128, "652th value should be 128"); -assertEq(view[653], 127, "653th value should be 127"); -assertEq(view[654], 127, "654th value should be 127"); -assertEq(view[655], 255, "655th value should be 255"); -assertEq(view[656], 52, "656th value should be 52"); -assertEq(view[657], 255, "657th value should be 255"); -assertEq(view[658], 203, "658th value should be 203"); -assertEq(view[659], 255, "659th value should be 255"); -assertEq(view[660], 0, "660th value should be 0"); -assertEq(view[661], 0, "661th value should be 0"); -assertEq(view[662], 0, "662th value should be 0"); -assertEq(view[663], 255, "663th value should be 255"); -assertEq(view[664], 0, "664th value should be 0"); -assertEq(view[665], 0, "665th value should be 0"); -assertEq(view[666], 0, "666th value should be 0"); -assertEq(view[667], 255, "667th value should be 255"); -assertEq(view[668], 0, "668th value should be 0"); -assertEq(view[669], 0, "669th value should be 0"); -assertEq(view[670], 0, "670th value should be 0"); -assertEq(view[671], 255, "671th value should be 255"); -assertEq(view[672], 0, "672th value should be 0"); -assertEq(view[673], 0, "673th value should be 0"); -assertEq(view[674], 0, "674th value should be 0"); -assertEq(view[675], 255, "675th value should be 255"); -assertEq(view[676], 0, "676th value should be 0"); -assertEq(view[677], 0, "677th value should be 0"); -assertEq(view[678], 0, "678th value should be 0"); -assertEq(view[679], 255, "679th value should be 255"); -assertEq(view[680], 0, "680th value should be 0"); -assertEq(view[681], 0, "681th value should be 0"); -assertEq(view[682], 0, "682th value should be 0"); -assertEq(view[683], 255, "683th value should be 255"); -assertEq(view[684], 0, "684th value should be 0"); -assertEq(view[685], 0, "685th value should be 0"); -assertEq(view[686], 0, "686th value should be 0"); -assertEq(view[687], 255, "687th value should be 255"); -assertEq(view[688], 0, "688th value should be 0"); -assertEq(view[689], 0, "689th value should be 0"); -assertEq(view[690], 0, "690th value should be 0"); -assertEq(view[691], 255, "691th value should be 255"); -assertEq(view[692], 0, "692th value should be 0"); -assertEq(view[693], 0, "693th value should be 0"); -assertEq(view[694], 0, "694th value should be 0"); -assertEq(view[695], 255, "695th value should be 255"); -assertEq(view[696], 0, "696th value should be 0"); -assertEq(view[697], 0, "697th value should be 0"); -assertEq(view[698], 0, "698th value should be 0"); -assertEq(view[699], 255, "699th value should be 255"); -assertEq(view[700], 0, "700th value should be 0"); -assertEq(view[701], 0, "701th value should be 0"); -assertEq(view[702], 0, "702th value should be 0"); -assertEq(view[703], 255, "703th value should be 255"); -assertEq(view[704], 0, "704th value should be 0"); -assertEq(view[705], 0, "705th value should be 0"); -assertEq(view[706], 0, "706th value should be 0"); -assertEq(view[707], 255, "707th value should be 255"); -assertEq(view[708], 154, "708th value should be 154"); -assertEq(view[709], 255, "709th value should be 255"); -assertEq(view[710], 101, "710th value should be 101"); -assertEq(view[711], 255, "711th value should be 255"); -assertEq(view[712], 179, "712th value should be 179"); -assertEq(view[713], 127, "713th value should be 127"); -assertEq(view[714], 76, "714th value should be 76"); -assertEq(view[715], 255, "715th value should be 255"); -assertEq(view[716], 205, "716th value should be 205"); -assertEq(view[717], 255, "717th value should be 255"); -assertEq(view[718], 50, "718th value should be 50"); -assertEq(view[719], 255, "719th value should be 255"); -assertEq(view[720], 154, "720th value should be 154"); -assertEq(view[721], 255, "721th value should be 255"); -assertEq(view[722], 101, "722th value should be 101"); -assertEq(view[723], 255, "723th value should be 255"); -assertEq(view[724], 52, "724th value should be 52"); -assertEq(view[725], 255, "725th value should be 255"); -assertEq(view[726], 203, "726th value should be 203"); -assertEq(view[727], 255, "727th value should be 255"); -assertEq(view[728], 128, "728th value should be 128"); -assertEq(view[729], 127, "729th value should be 127"); -assertEq(view[730], 127, "730th value should be 127"); -assertEq(view[731], 255, "731th value should be 255"); -assertEq(view[732], 78, "732th value should be 78"); -assertEq(view[733], 127, "733th value should be 127"); -assertEq(view[734], 178, "734th value should be 178"); -assertEq(view[735], 255, "735th value should be 255"); -assertEq(view[736], 0, "736th value should be 0"); -assertEq(view[737], 0, "737th value should be 0"); -assertEq(view[738], 0, "738th value should be 0"); -assertEq(view[739], 255, "739th value should be 255"); -assertEq(view[740], 0, "740th value should be 0"); -assertEq(view[741], 0, "741th value should be 0"); -assertEq(view[742], 0, "742th value should be 0"); -assertEq(view[743], 255, "743th value should be 255"); -assertEq(view[744], 0, "744th value should be 0"); -assertEq(view[745], 0, "745th value should be 0"); -assertEq(view[746], 0, "746th value should be 0"); -assertEq(view[747], 255, "747th value should be 255"); -assertEq(view[748], 0, "748th value should be 0"); -assertEq(view[749], 0, "749th value should be 0"); -assertEq(view[750], 0, "750th value should be 0"); -assertEq(view[751], 255, "751th value should be 255"); -assertEq(view[752], 0, "752th value should be 0"); -assertEq(view[753], 0, "753th value should be 0"); -assertEq(view[754], 0, "754th value should be 0"); -assertEq(view[755], 255, "755th value should be 255"); -assertEq(view[756], 0, "756th value should be 0"); -assertEq(view[757], 0, "757th value should be 0"); -assertEq(view[758], 0, "758th value should be 0"); -assertEq(view[759], 255, "759th value should be 255"); -assertEq(view[760], 0, "760th value should be 0"); -assertEq(view[761], 0, "761th value should be 0"); -assertEq(view[762], 0, "762th value should be 0"); -assertEq(view[763], 255, "763th value should be 255"); -assertEq(view[764], 0, "764th value should be 0"); -assertEq(view[765], 0, "765th value should be 0"); -assertEq(view[766], 0, "766th value should be 0"); -assertEq(view[767], 255, "767th value should be 255"); -assertEq(view[768], 0, "768th value should be 0"); -assertEq(view[769], 0, "769th value should be 0"); -assertEq(view[770], 0, "770th value should be 0"); -assertEq(view[771], 255, "771th value should be 255"); -assertEq(view[772], 0, "772th value should be 0"); -assertEq(view[773], 0, "773th value should be 0"); -assertEq(view[774], 0, "774th value should be 0"); -assertEq(view[775], 255, "775th value should be 255"); -assertEq(view[776], 0, "776th value should be 0"); -assertEq(view[777], 0, "777th value should be 0"); -assertEq(view[778], 0, "778th value should be 0"); -assertEq(view[779], 255, "779th value should be 255"); -assertEq(view[780], 0, "780th value should be 0"); -assertEq(view[781], 0, "781th value should be 0"); -assertEq(view[782], 0, "782th value should be 0"); -assertEq(view[783], 255, "783th value should be 255"); -assertEq(view[784], 78, "784th value should be 78"); -assertEq(view[785], 127, "785th value should be 127"); -assertEq(view[786], 178, "786th value should be 178"); -assertEq(view[787], 255, "787th value should be 255"); -assertEq(view[788], 154, "788th value should be 154"); -assertEq(view[789], 255, "789th value should be 255"); -assertEq(view[790], 101, "790th value should be 101"); -assertEq(view[791], 255, "791th value should be 255"); -assertEq(view[792], 179, "792th value should be 179"); -assertEq(view[793], 127, "793th value should be 127"); -assertEq(view[794], 76, "794th value should be 76"); -assertEq(view[795], 255, "795th value should be 255"); -assertEq(view[796], 205, "796th value should be 205"); -assertEq(view[797], 255, "797th value should be 255"); -assertEq(view[798], 50, "798th value should be 50"); -assertEq(view[799], 255, "799th value should be 255"); -assertEq(view[800], 128, "800th value should be 128"); -assertEq(view[801], 127, "801th value should be 127"); -assertEq(view[802], 127, "802th value should be 127"); -assertEq(view[803], 255, "803th value should be 255"); -assertEq(view[804], 0, "804th value should be 0"); -assertEq(view[805], 0, "805th value should be 0"); -assertEq(view[806], 0, "806th value should be 0"); -assertEq(view[807], 255, "807th value should be 255"); -assertEq(view[808], 26, "808th value should be 26"); -assertEq(view[809], 127, "809th value should be 127"); -assertEq(view[810], 229, "810th value should be 229"); -assertEq(view[811], 255, "811th value should be 255"); -assertEq(view[812], 0, "812th value should be 0"); -assertEq(view[813], 0, "813th value should be 0"); -assertEq(view[814], 0, "814th value should be 0"); -assertEq(view[815], 255, "815th value should be 255"); -assertEq(view[816], 0, "816th value should be 0"); -assertEq(view[817], 0, "817th value should be 0"); -assertEq(view[818], 0, "818th value should be 0"); -assertEq(view[819], 255, "819th value should be 255"); -assertEq(view[820], 0, "820th value should be 0"); -assertEq(view[821], 0, "821th value should be 0"); -assertEq(view[822], 0, "822th value should be 0"); -assertEq(view[823], 255, "823th value should be 255"); -assertEq(view[824], 0, "824th value should be 0"); -assertEq(view[825], 0, "825th value should be 0"); -assertEq(view[826], 0, "826th value should be 0"); -assertEq(view[827], 255, "827th value should be 255"); -assertEq(view[828], 0, "828th value should be 0"); -assertEq(view[829], 0, "829th value should be 0"); -assertEq(view[830], 0, "830th value should be 0"); -assertEq(view[831], 255, "831th value should be 255"); -assertEq(view[832], 0, "832th value should be 0"); -assertEq(view[833], 0, "833th value should be 0"); -assertEq(view[834], 0, "834th value should be 0"); -assertEq(view[835], 255, "835th value should be 255"); -assertEq(view[836], 0, "836th value should be 0"); -assertEq(view[837], 0, "837th value should be 0"); -assertEq(view[838], 0, "838th value should be 0"); -assertEq(view[839], 255, "839th value should be 255"); -assertEq(view[840], 0, "840th value should be 0"); -assertEq(view[841], 0, "841th value should be 0"); -assertEq(view[842], 0, "842th value should be 0"); -assertEq(view[843], 255, "843th value should be 255"); -assertEq(view[844], 0, "844th value should be 0"); -assertEq(view[845], 0, "845th value should be 0"); -assertEq(view[846], 0, "846th value should be 0"); -assertEq(view[847], 255, "847th value should be 255"); -assertEq(view[848], 0, "848th value should be 0"); -assertEq(view[849], 0, "849th value should be 0"); -assertEq(view[850], 0, "850th value should be 0"); -assertEq(view[851], 255, "851th value should be 255"); -assertEq(view[852], 0, "852th value should be 0"); -assertEq(view[853], 0, "853th value should be 0"); -assertEq(view[854], 0, "854th value should be 0"); -assertEq(view[855], 255, "855th value should be 255"); -assertEq(view[856], 0, "856th value should be 0"); -assertEq(view[857], 0, "857th value should be 0"); -assertEq(view[858], 0, "858th value should be 0"); -assertEq(view[859], 255, "859th value should be 255"); -assertEq(view[860], 0, "860th value should be 0"); -assertEq(view[861], 0, "861th value should be 0"); -assertEq(view[862], 0, "862th value should be 0"); -assertEq(view[863], 255, "863th value should be 255"); -assertEq(view[864], 103, "864th value should be 103"); -assertEq(view[865], 255, "865th value should be 255"); -assertEq(view[866], 152, "866th value should be 152"); -assertEq(view[867], 255, "867th value should be 255"); -assertEq(view[868], 154, "868th value should be 154"); -assertEq(view[869], 255, "869th value should be 255"); -assertEq(view[870], 101, "870th value should be 101"); -assertEq(view[871], 255, "871th value should be 255"); -assertEq(view[872], 179, "872th value should be 179"); -assertEq(view[873], 127, "873th value should be 127"); -assertEq(view[874], 76, "874th value should be 76"); -assertEq(view[875], 255, "875th value should be 255"); -assertEq(view[876], 205, "876th value should be 205"); -assertEq(view[877], 255, "877th value should be 255"); -assertEq(view[878], 50, "878th value should be 50"); -assertEq(view[879], 255, "879th value should be 255"); -assertEq(view[880], 179, "880th value should be 179"); -assertEq(view[881], 127, "881th value should be 127"); -assertEq(view[882], 76, "882th value should be 76"); -assertEq(view[883], 255, "883th value should be 255"); -assertEq(view[884], 179, "884th value should be 179"); -assertEq(view[885], 127, "885th value should be 127"); -assertEq(view[886], 76, "886th value should be 76"); -assertEq(view[887], 255, "887th value should be 255"); -assertEq(view[888], 128, "888th value should be 128"); -assertEq(view[889], 127, "889th value should be 127"); -assertEq(view[890], 127, "890th value should be 127"); -assertEq(view[891], 255, "891th value should be 255"); -assertEq(view[892], 103, "892th value should be 103"); -assertEq(view[893], 255, "893th value should be 255"); -assertEq(view[894], 152, "894th value should be 152"); -assertEq(view[895], 255, "895th value should be 255"); -assertEq(view[896], 26, "896th value should be 26"); -assertEq(view[897], 127, "897th value should be 127"); -assertEq(view[898], 229, "898th value should be 229"); -assertEq(view[899], 255, "899th value should be 255"); -assertEq(view[900], 0, "900th value should be 0"); -assertEq(view[901], 0, "901th value should be 0"); -assertEq(view[902], 0, "902th value should be 0"); -assertEq(view[903], 255, "903th value should be 255"); -assertEq(view[904], 0, "904th value should be 0"); -assertEq(view[905], 0, "905th value should be 0"); -assertEq(view[906], 0, "906th value should be 0"); -assertEq(view[907], 255, "907th value should be 255"); -assertEq(view[908], 0, "908th value should be 0"); -assertEq(view[909], 0, "909th value should be 0"); -assertEq(view[910], 0, "910th value should be 0"); -assertEq(view[911], 255, "911th value should be 255"); -assertEq(view[912], 0, "912th value should be 0"); -assertEq(view[913], 0, "913th value should be 0"); -assertEq(view[914], 0, "914th value should be 0"); -assertEq(view[915], 255, "915th value should be 255"); -assertEq(view[916], 0, "916th value should be 0"); -assertEq(view[917], 0, "917th value should be 0"); -assertEq(view[918], 0, "918th value should be 0"); -assertEq(view[919], 255, "919th value should be 255"); -assertEq(view[920], 0, "920th value should be 0"); -assertEq(view[921], 0, "921th value should be 0"); -assertEq(view[922], 0, "922th value should be 0"); -assertEq(view[923], 255, "923th value should be 255"); -assertEq(view[924], 0, "924th value should be 0"); -assertEq(view[925], 0, "925th value should be 0"); -assertEq(view[926], 0, "926th value should be 0"); -assertEq(view[927], 255, "927th value should be 255"); -assertEq(view[928], 0, "928th value should be 0"); -assertEq(view[929], 0, "929th value should be 0"); -assertEq(view[930], 0, "930th value should be 0"); -assertEq(view[931], 255, "931th value should be 255"); -assertEq(view[932], 0, "932th value should be 0"); -assertEq(view[933], 0, "933th value should be 0"); -assertEq(view[934], 0, "934th value should be 0"); -assertEq(view[935], 255, "935th value should be 255"); -assertEq(view[936], 0, "936th value should be 0"); -assertEq(view[937], 0, "937th value should be 0"); -assertEq(view[938], 0, "938th value should be 0"); -assertEq(view[939], 255, "939th value should be 255"); -assertEq(view[940], 0, "940th value should be 0"); -assertEq(view[941], 0, "941th value should be 0"); -assertEq(view[942], 0, "942th value should be 0"); -assertEq(view[943], 255, "943th value should be 255"); -assertEq(view[944], 0, "944th value should be 0"); -assertEq(view[945], 0, "945th value should be 0"); -assertEq(view[946], 0, "946th value should be 0"); -assertEq(view[947], 255, "947th value should be 255"); -assertEq(view[948], 154, "948th value should be 154"); -assertEq(view[949], 255, "949th value should be 255"); -assertEq(view[950], 101, "950th value should be 101"); -assertEq(view[951], 255, "951th value should be 255"); -assertEq(view[952], 179, "952th value should be 179"); -assertEq(view[953], 127, "953th value should be 127"); -assertEq(view[954], 76, "954th value should be 76"); -assertEq(view[955], 255, "955th value should be 255"); -assertEq(view[956], 205, "956th value should be 205"); -assertEq(view[957], 255, "957th value should be 255"); -assertEq(view[958], 50, "958th value should be 50"); -assertEq(view[959], 255, "959th value should be 255"); -assertEq(view[960], 179, "960th value should be 179"); -assertEq(view[961], 127, "961th value should be 127"); -assertEq(view[962], 76, "962th value should be 76"); -assertEq(view[963], 255, "963th value should be 255"); -assertEq(view[964], 179, "964th value should be 179"); -assertEq(view[965], 127, "965th value should be 127"); -assertEq(view[966], 76, "966th value should be 76"); -assertEq(view[967], 255, "967th value should be 255"); -assertEq(view[968], 179, "968th value should be 179"); -assertEq(view[969], 127, "969th value should be 127"); -assertEq(view[970], 76, "970th value should be 76"); -assertEq(view[971], 255, "971th value should be 255"); -assertEq(view[972], 154, "972th value should be 154"); -assertEq(view[973], 255, "973th value should be 255"); -assertEq(view[974], 101, "974th value should be 101"); -assertEq(view[975], 255, "975th value should be 255"); -assertEq(view[976], 103, "976th value should be 103"); -assertEq(view[977], 255, "977th value should be 255"); -assertEq(view[978], 152, "978th value should be 152"); -assertEq(view[979], 255, "979th value should be 255"); -assertEq(view[980], 0, "980th value should be 0"); -assertEq(view[981], 0, "981th value should be 0"); -assertEq(view[982], 0, "982th value should be 0"); -assertEq(view[983], 255, "983th value should be 255"); -assertEq(view[984], 0, "984th value should be 0"); -assertEq(view[985], 0, "985th value should be 0"); -assertEq(view[986], 0, "986th value should be 0"); -assertEq(view[987], 255, "987th value should be 255"); -assertEq(view[988], 0, "988th value should be 0"); -assertEq(view[989], 0, "989th value should be 0"); -assertEq(view[990], 0, "990th value should be 0"); -assertEq(view[991], 255, "991th value should be 255"); -assertEq(view[992], 0, "992th value should be 0"); -assertEq(view[993], 0, "993th value should be 0"); -assertEq(view[994], 0, "994th value should be 0"); -assertEq(view[995], 255, "995th value should be 255"); -assertEq(view[996], 0, "996th value should be 0"); -assertEq(view[997], 0, "997th value should be 0"); -assertEq(view[998], 0, "998th value should be 0"); -assertEq(view[999], 255, "999th value should be 255"); -assertEq(view[1000], 0, "1000th value should be 0"); -assertEq(view[1001], 0, "1001th value should be 0"); -assertEq(view[1002], 0, "1002th value should be 0"); -assertEq(view[1003], 255, "1003th value should be 255"); -assertEq(view[1004], 0, "1004th value should be 0"); -assertEq(view[1005], 0, "1005th value should be 0"); -assertEq(view[1006], 0, "1006th value should be 0"); -assertEq(view[1007], 255, "1007th value should be 255"); -assertEq(view[1008], 0, "1008th value should be 0"); -assertEq(view[1009], 0, "1009th value should be 0"); -assertEq(view[1010], 0, "1010th value should be 0"); -assertEq(view[1011], 255, "1011th value should be 255"); -assertEq(view[1012], 0, "1012th value should be 0"); -assertEq(view[1013], 0, "1013th value should be 0"); -assertEq(view[1014], 0, "1014th value should be 0"); -assertEq(view[1015], 255, "1015th value should be 255"); -assertEq(view[1016], 0, "1016th value should be 0"); -assertEq(view[1017], 0, "1017th value should be 0"); -assertEq(view[1018], 0, "1018th value should be 0"); -assertEq(view[1019], 255, "1019th value should be 255"); -assertEq(view[1020], 0, "1020th value should be 0"); -assertEq(view[1021], 0, "1021th value should be 0"); -assertEq(view[1022], 0, "1022th value should be 0"); -assertEq(view[1023], 255, "1023th value should be 255"); -assertEq(view[1024], 0, "1024th value should be 0"); -assertEq(view[1025], 0, "1025th value should be 0"); -assertEq(view[1026], 0, "1026th value should be 0"); -assertEq(view[1027], 255, "1027th value should be 255"); -assertEq(view[1028], 154, "1028th value should be 154"); -assertEq(view[1029], 255, "1029th value should be 255"); -assertEq(view[1030], 101, "1030th value should be 101"); -assertEq(view[1031], 255, "1031th value should be 255"); -assertEq(view[1032], 205, "1032th value should be 205"); -assertEq(view[1033], 255, "1033th value should be 255"); -assertEq(view[1034], 50, "1034th value should be 50"); -assertEq(view[1035], 255, "1035th value should be 255"); -assertEq(view[1036], 205, "1036th value should be 205"); -assertEq(view[1037], 255, "1037th value should be 255"); -assertEq(view[1038], 50, "1038th value should be 50"); -assertEq(view[1039], 255, "1039th value should be 255"); -assertEq(view[1040], 205, "1040th value should be 205"); -assertEq(view[1041], 255, "1041th value should be 255"); -assertEq(view[1042], 50, "1042th value should be 50"); -assertEq(view[1043], 255, "1043th value should be 255"); -assertEq(view[1044], 179, "1044th value should be 179"); -assertEq(view[1045], 127, "1045th value should be 127"); -assertEq(view[1046], 76, "1046th value should be 76"); -assertEq(view[1047], 255, "1047th value should be 255"); -assertEq(view[1048], 179, "1048th value should be 179"); -assertEq(view[1049], 127, "1049th value should be 127"); -assertEq(view[1050], 76, "1050th value should be 76"); -assertEq(view[1051], 255, "1051th value should be 255"); -assertEq(view[1052], 154, "1052th value should be 154"); -assertEq(view[1053], 255, "1053th value should be 255"); -assertEq(view[1054], 101, "1054th value should be 101"); -assertEq(view[1055], 255, "1055th value should be 255"); -assertEq(view[1056], 128, "1056th value should be 128"); -assertEq(view[1057], 127, "1057th value should be 127"); -assertEq(view[1058], 127, "1058th value should be 127"); -assertEq(view[1059], 255, "1059th value should be 255"); -assertEq(view[1060], 0, "1060th value should be 0"); -assertEq(view[1061], 0, "1061th value should be 0"); -assertEq(view[1062], 0, "1062th value should be 0"); -assertEq(view[1063], 255, "1063th value should be 255"); -assertEq(view[1064], 0, "1064th value should be 0"); -assertEq(view[1065], 0, "1065th value should be 0"); -assertEq(view[1066], 0, "1066th value should be 0"); -assertEq(view[1067], 255, "1067th value should be 255"); -assertEq(view[1068], 26, "1068th value should be 26"); -assertEq(view[1069], 127, "1069th value should be 127"); -assertEq(view[1070], 229, "1070th value should be 229"); -assertEq(view[1071], 255, "1071th value should be 255"); -assertEq(view[1072], 26, "1072th value should be 26"); -assertEq(view[1073], 127, "1073th value should be 127"); -assertEq(view[1074], 229, "1074th value should be 229"); -assertEq(view[1075], 255, "1075th value should be 255"); -assertEq(view[1076], 0, "1076th value should be 0"); -assertEq(view[1077], 0, "1077th value should be 0"); -assertEq(view[1078], 0, "1078th value should be 0"); -assertEq(view[1079], 255, "1079th value should be 255"); -assertEq(view[1080], 0, "1080th value should be 0"); -assertEq(view[1081], 0, "1081th value should be 0"); -assertEq(view[1082], 0, "1082th value should be 0"); -assertEq(view[1083], 255, "1083th value should be 255"); -assertEq(view[1084], 0, "1084th value should be 0"); -assertEq(view[1085], 0, "1085th value should be 0"); -assertEq(view[1086], 0, "1086th value should be 0"); -assertEq(view[1087], 255, "1087th value should be 255"); -assertEq(view[1088], 0, "1088th value should be 0"); -assertEq(view[1089], 0, "1089th value should be 0"); -assertEq(view[1090], 0, "1090th value should be 0"); -assertEq(view[1091], 255, "1091th value should be 255"); -assertEq(view[1092], 0, "1092th value should be 0"); -assertEq(view[1093], 0, "1093th value should be 0"); -assertEq(view[1094], 0, "1094th value should be 0"); -assertEq(view[1095], 255, "1095th value should be 255"); -assertEq(view[1096], 0, "1096th value should be 0"); -assertEq(view[1097], 0, "1097th value should be 0"); -assertEq(view[1098], 0, "1098th value should be 0"); -assertEq(view[1099], 255, "1099th value should be 255"); -assertEq(view[1100], 0, "1100th value should be 0"); -assertEq(view[1101], 0, "1101th value should be 0"); -assertEq(view[1102], 0, "1102th value should be 0"); -assertEq(view[1103], 255, "1103th value should be 255"); -assertEq(view[1104], 0, "1104th value should be 0"); -assertEq(view[1105], 0, "1105th value should be 0"); -assertEq(view[1106], 0, "1106th value should be 0"); -assertEq(view[1107], 255, "1107th value should be 255"); -assertEq(view[1108], 154, "1108th value should be 154"); -assertEq(view[1109], 255, "1109th value should be 255"); -assertEq(view[1110], 101, "1110th value should be 101"); -assertEq(view[1111], 255, "1111th value should be 255"); -assertEq(view[1112], 205, "1112th value should be 205"); -assertEq(view[1113], 255, "1113th value should be 255"); -assertEq(view[1114], 50, "1114th value should be 50"); -assertEq(view[1115], 255, "1115th value should be 255"); -assertEq(view[1116], 205, "1116th value should be 205"); -assertEq(view[1117], 255, "1117th value should be 255"); -assertEq(view[1118], 50, "1118th value should be 50"); -assertEq(view[1119], 255, "1119th value should be 255"); -assertEq(view[1120], 205, "1120th value should be 205"); -assertEq(view[1121], 255, "1121th value should be 255"); -assertEq(view[1122], 50, "1122th value should be 50"); -assertEq(view[1123], 255, "1123th value should be 255"); -assertEq(view[1124], 205, "1124th value should be 205"); -assertEq(view[1125], 255, "1125th value should be 255"); -assertEq(view[1126], 50, "1126th value should be 50"); -assertEq(view[1127], 255, "1127th value should be 255"); -assertEq(view[1128], 205, "1128th value should be 205"); -assertEq(view[1129], 255, "1129th value should be 255"); -assertEq(view[1130], 50, "1130th value should be 50"); -assertEq(view[1131], 255, "1131th value should be 255"); -assertEq(view[1132], 179, "1132th value should be 179"); -assertEq(view[1133], 127, "1133th value should be 127"); -assertEq(view[1134], 76, "1134th value should be 76"); -assertEq(view[1135], 255, "1135th value should be 255"); -assertEq(view[1136], 154, "1136th value should be 154"); -assertEq(view[1137], 255, "1137th value should be 255"); -assertEq(view[1138], 101, "1138th value should be 101"); -assertEq(view[1139], 255, "1139th value should be 255"); -assertEq(view[1140], 128, "1140th value should be 128"); -assertEq(view[1141], 127, "1141th value should be 127"); -assertEq(view[1142], 127, "1142th value should be 127"); -assertEq(view[1143], 255, "1143th value should be 255"); -assertEq(view[1144], 128, "1144th value should be 128"); -assertEq(view[1145], 127, "1145th value should be 127"); -assertEq(view[1146], 127, "1146th value should be 127"); -assertEq(view[1147], 255, "1147th value should be 255"); -assertEq(view[1148], 103, "1148th value should be 103"); -assertEq(view[1149], 255, "1149th value should be 255"); -assertEq(view[1150], 152, "1150th value should be 152"); -assertEq(view[1151], 255, "1151th value should be 255"); -assertEq(view[1152], 78, "1152th value should be 78"); -assertEq(view[1153], 127, "1153th value should be 127"); -assertEq(view[1154], 178, "1154th value should be 178"); -assertEq(view[1155], 255, "1155th value should be 255"); -assertEq(view[1156], 0, "1156th value should be 0"); -assertEq(view[1157], 0, "1157th value should be 0"); -assertEq(view[1158], 0, "1158th value should be 0"); -assertEq(view[1159], 255, "1159th value should be 255"); -assertEq(view[1160], 0, "1160th value should be 0"); -assertEq(view[1161], 0, "1161th value should be 0"); -assertEq(view[1162], 0, "1162th value should be 0"); -assertEq(view[1163], 255, "1163th value should be 255"); -assertEq(view[1164], 0, "1164th value should be 0"); -assertEq(view[1165], 0, "1165th value should be 0"); -assertEq(view[1166], 0, "1166th value should be 0"); -assertEq(view[1167], 255, "1167th value should be 255"); -assertEq(view[1168], 0, "1168th value should be 0"); -assertEq(view[1169], 0, "1169th value should be 0"); -assertEq(view[1170], 0, "1170th value should be 0"); -assertEq(view[1171], 255, "1171th value should be 255"); -assertEq(view[1172], 0, "1172th value should be 0"); -assertEq(view[1173], 0, "1173th value should be 0"); -assertEq(view[1174], 0, "1174th value should be 0"); -assertEq(view[1175], 255, "1175th value should be 255"); -assertEq(view[1176], 0, "1176th value should be 0"); -assertEq(view[1177], 0, "1177th value should be 0"); -assertEq(view[1178], 0, "1178th value should be 0"); -assertEq(view[1179], 255, "1179th value should be 255"); -assertEq(view[1180], 0, "1180th value should be 0"); -assertEq(view[1181], 0, "1181th value should be 0"); -assertEq(view[1182], 0, "1182th value should be 0"); -assertEq(view[1183], 255, "1183th value should be 255"); -assertEq(view[1184], 26, "1184th value should be 26"); -assertEq(view[1185], 127, "1185th value should be 127"); -assertEq(view[1186], 229, "1186th value should be 229"); -assertEq(view[1187], 255, "1187th value should be 255"); -assertEq(view[1188], 154, "1188th value should be 154"); -assertEq(view[1189], 255, "1189th value should be 255"); -assertEq(view[1190], 101, "1190th value should be 101"); -assertEq(view[1191], 255, "1191th value should be 255"); -assertEq(view[1192], 205, "1192th value should be 205"); -assertEq(view[1193], 255, "1193th value should be 255"); -assertEq(view[1194], 50, "1194th value should be 50"); -assertEq(view[1195], 255, "1195th value should be 255"); -assertEq(view[1196], 205, "1196th value should be 205"); -assertEq(view[1197], 255, "1197th value should be 255"); -assertEq(view[1198], 50, "1198th value should be 50"); -assertEq(view[1199], 255, "1199th value should be 255"); -assertEq(view[1200], 230, "1200th value should be 230"); -assertEq(view[1201], 127, "1201th value should be 127"); -assertEq(view[1202], 25, "1202th value should be 25"); -assertEq(view[1203], 255, "1203th value should be 255"); -assertEq(view[1204], 205, "1204th value should be 205"); -assertEq(view[1205], 255, "1205th value should be 255"); -assertEq(view[1206], 50, "1206th value should be 50"); -assertEq(view[1207], 255, "1207th value should be 255"); -assertEq(view[1208], 205, "1208th value should be 205"); -assertEq(view[1209], 255, "1209th value should be 255"); -assertEq(view[1210], 50, "1210th value should be 50"); -assertEq(view[1211], 255, "1211th value should be 255"); -assertEq(view[1212], 205, "1212th value should be 205"); -assertEq(view[1213], 255, "1213th value should be 255"); -assertEq(view[1214], 50, "1214th value should be 50"); -assertEq(view[1215], 255, "1215th value should be 255"); -assertEq(view[1216], 205, "1216th value should be 205"); -assertEq(view[1217], 255, "1217th value should be 255"); -assertEq(view[1218], 50, "1218th value should be 50"); -assertEq(view[1219], 255, "1219th value should be 255"); -assertEq(view[1220], 154, "1220th value should be 154"); -assertEq(view[1221], 255, "1221th value should be 255"); -assertEq(view[1222], 101, "1222th value should be 101"); -assertEq(view[1223], 255, "1223th value should be 255"); -assertEq(view[1224], 154, "1224th value should be 154"); -assertEq(view[1225], 255, "1225th value should be 255"); -assertEq(view[1226], 101, "1226th value should be 101"); -assertEq(view[1227], 255, "1227th value should be 255"); -assertEq(view[1228], 154, "1228th value should be 154"); -assertEq(view[1229], 255, "1229th value should be 255"); -assertEq(view[1230], 101, "1230th value should be 101"); -assertEq(view[1231], 255, "1231th value should be 255"); -assertEq(view[1232], 128, "1232th value should be 128"); -assertEq(view[1233], 127, "1233th value should be 127"); -assertEq(view[1234], 127, "1234th value should be 127"); -assertEq(view[1235], 255, "1235th value should be 255"); -assertEq(view[1236], 26, "1236th value should be 26"); -assertEq(view[1237], 127, "1237th value should be 127"); -assertEq(view[1238], 229, "1238th value should be 229"); -assertEq(view[1239], 255, "1239th value should be 255"); -assertEq(view[1240], 0, "1240th value should be 0"); -assertEq(view[1241], 0, "1241th value should be 0"); -assertEq(view[1242], 0, "1242th value should be 0"); -assertEq(view[1243], 255, "1243th value should be 255"); -assertEq(view[1244], 0, "1244th value should be 0"); -assertEq(view[1245], 0, "1245th value should be 0"); -assertEq(view[1246], 0, "1246th value should be 0"); -assertEq(view[1247], 255, "1247th value should be 255"); -assertEq(view[1248], 0, "1248th value should be 0"); -assertEq(view[1249], 0, "1249th value should be 0"); -assertEq(view[1250], 0, "1250th value should be 0"); -assertEq(view[1251], 255, "1251th value should be 255"); -assertEq(view[1252], 0, "1252th value should be 0"); -assertEq(view[1253], 0, "1253th value should be 0"); -assertEq(view[1254], 0, "1254th value should be 0"); -assertEq(view[1255], 255, "1255th value should be 255"); -assertEq(view[1256], 0, "1256th value should be 0"); -assertEq(view[1257], 0, "1257th value should be 0"); -assertEq(view[1258], 0, "1258th value should be 0"); -assertEq(view[1259], 255, "1259th value should be 255"); -assertEq(view[1260], 0, "1260th value should be 0"); -assertEq(view[1261], 0, "1261th value should be 0"); -assertEq(view[1262], 0, "1262th value should be 0"); -assertEq(view[1263], 255, "1263th value should be 255"); -assertEq(view[1264], 78, "1264th value should be 78"); -assertEq(view[1265], 127, "1265th value should be 127"); -assertEq(view[1266], 178, "1266th value should be 178"); -assertEq(view[1267], 255, "1267th value should be 255"); -assertEq(view[1268], 179, "1268th value should be 179"); -assertEq(view[1269], 127, "1269th value should be 127"); -assertEq(view[1270], 76, "1270th value should be 76"); -assertEq(view[1271], 255, "1271th value should be 255"); -assertEq(view[1272], 205, "1272th value should be 205"); -assertEq(view[1273], 255, "1273th value should be 255"); -assertEq(view[1274], 50, "1274th value should be 50"); -assertEq(view[1275], 255, "1275th value should be 255"); -assertEq(view[1276], 205, "1276th value should be 205"); -assertEq(view[1277], 255, "1277th value should be 255"); -assertEq(view[1278], 50, "1278th value should be 50"); -assertEq(view[1279], 255, "1279th value should be 255"); -assertEq(view[1280], 0, "1280th value should be 0"); -assertEq(view[1281], 0, "1281th value should be 0"); -assertEq(view[1282], 0, "1282th value should be 0"); -assertEq(view[1283], 255, "1283th value should be 255"); -assertEq(view[1284], 205, "1284th value should be 205"); -assertEq(view[1285], 255, "1285th value should be 255"); -assertEq(view[1286], 50, "1286th value should be 50"); -assertEq(view[1287], 255, "1287th value should be 255"); -assertEq(view[1288], 205, "1288th value should be 205"); -assertEq(view[1289], 255, "1289th value should be 255"); -assertEq(view[1290], 50, "1290th value should be 50"); -assertEq(view[1291], 255, "1291th value should be 255"); -assertEq(view[1292], 205, "1292th value should be 205"); -assertEq(view[1293], 255, "1293th value should be 255"); -assertEq(view[1294], 50, "1294th value should be 50"); -assertEq(view[1295], 255, "1295th value should be 255"); -assertEq(view[1296], 205, "1296th value should be 205"); -assertEq(view[1297], 255, "1297th value should be 255"); -assertEq(view[1298], 50, "1298th value should be 50"); -assertEq(view[1299], 255, "1299th value should be 255"); -assertEq(view[1300], 205, "1300th value should be 205"); -assertEq(view[1301], 255, "1301th value should be 255"); -assertEq(view[1302], 50, "1302th value should be 50"); -assertEq(view[1303], 255, "1303th value should be 255"); -assertEq(view[1304], 179, "1304th value should be 179"); -assertEq(view[1305], 127, "1305th value should be 127"); -assertEq(view[1306], 76, "1306th value should be 76"); -assertEq(view[1307], 255, "1307th value should be 255"); -assertEq(view[1308], 154, "1308th value should be 154"); -assertEq(view[1309], 255, "1309th value should be 255"); -assertEq(view[1310], 101, "1310th value should be 101"); -assertEq(view[1311], 255, "1311th value should be 255"); -assertEq(view[1312], 154, "1312th value should be 154"); -assertEq(view[1313], 255, "1313th value should be 255"); -assertEq(view[1314], 101, "1314th value should be 101"); -assertEq(view[1315], 255, "1315th value should be 255"); -assertEq(view[1316], 0, "1316th value should be 0"); -assertEq(view[1317], 0, "1317th value should be 0"); -assertEq(view[1318], 0, "1318th value should be 0"); -assertEq(view[1319], 255, "1319th value should be 255"); -assertEq(view[1320], 0, "1320th value should be 0"); -assertEq(view[1321], 0, "1321th value should be 0"); -assertEq(view[1322], 0, "1322th value should be 0"); -assertEq(view[1323], 255, "1323th value should be 255"); -assertEq(view[1324], 0, "1324th value should be 0"); -assertEq(view[1325], 0, "1325th value should be 0"); -assertEq(view[1326], 0, "1326th value should be 0"); -assertEq(view[1327], 255, "1327th value should be 255"); -assertEq(view[1328], 0, "1328th value should be 0"); -assertEq(view[1329], 0, "1329th value should be 0"); -assertEq(view[1330], 0, "1330th value should be 0"); -assertEq(view[1331], 255, "1331th value should be 255"); -assertEq(view[1332], 0, "1332th value should be 0"); -assertEq(view[1333], 0, "1333th value should be 0"); -assertEq(view[1334], 0, "1334th value should be 0"); -assertEq(view[1335], 255, "1335th value should be 255"); -assertEq(view[1336], 0, "1336th value should be 0"); -assertEq(view[1337], 0, "1337th value should be 0"); -assertEq(view[1338], 0, "1338th value should be 0"); -assertEq(view[1339], 255, "1339th value should be 255"); -assertEq(view[1340], 0, "1340th value should be 0"); -assertEq(view[1341], 0, "1341th value should be 0"); -assertEq(view[1342], 0, "1342th value should be 0"); -assertEq(view[1343], 255, "1343th value should be 255"); -assertEq(view[1344], 0, "1344th value should be 0"); -assertEq(view[1345], 0, "1345th value should be 0"); -assertEq(view[1346], 0, "1346th value should be 0"); -assertEq(view[1347], 255, "1347th value should be 255"); -assertEq(view[1348], 179, "1348th value should be 179"); -assertEq(view[1349], 127, "1349th value should be 127"); -assertEq(view[1350], 76, "1350th value should be 76"); -assertEq(view[1351], 255, "1351th value should be 255"); -assertEq(view[1352], 205, "1352th value should be 205"); -assertEq(view[1353], 255, "1353th value should be 255"); -assertEq(view[1354], 50, "1354th value should be 50"); -assertEq(view[1355], 255, "1355th value should be 255"); -assertEq(view[1356], 205, "1356th value should be 205"); -assertEq(view[1357], 255, "1357th value should be 255"); -assertEq(view[1358], 50, "1358th value should be 50"); -assertEq(view[1359], 255, "1359th value should be 255"); -assertEq(view[1360], 0, "1360th value should be 0"); -assertEq(view[1361], 0, "1361th value should be 0"); -assertEq(view[1362], 0, "1362th value should be 0"); -assertEq(view[1363], 255, "1363th value should be 255"); -assertEq(view[1364], 205, "1364th value should be 205"); -assertEq(view[1365], 255, "1365th value should be 255"); -assertEq(view[1366], 50, "1366th value should be 50"); -assertEq(view[1367], 255, "1367th value should be 255"); -assertEq(view[1368], 205, "1368th value should be 205"); -assertEq(view[1369], 255, "1369th value should be 255"); -assertEq(view[1370], 50, "1370th value should be 50"); -assertEq(view[1371], 255, "1371th value should be 255"); -assertEq(view[1372], 205, "1372th value should be 205"); -assertEq(view[1373], 255, "1373th value should be 255"); -assertEq(view[1374], 50, "1374th value should be 50"); -assertEq(view[1375], 255, "1375th value should be 255"); -assertEq(view[1376], 205, "1376th value should be 205"); -assertEq(view[1377], 255, "1377th value should be 255"); -assertEq(view[1378], 50, "1378th value should be 50"); -assertEq(view[1379], 255, "1379th value should be 255"); -assertEq(view[1380], 205, "1380th value should be 205"); -assertEq(view[1381], 255, "1381th value should be 255"); -assertEq(view[1382], 50, "1382th value should be 50"); -assertEq(view[1383], 255, "1383th value should be 255"); -assertEq(view[1384], 205, "1384th value should be 205"); -assertEq(view[1385], 255, "1385th value should be 255"); -assertEq(view[1386], 50, "1386th value should be 50"); -assertEq(view[1387], 255, "1387th value should be 255"); -assertEq(view[1388], 179, "1388th value should be 179"); -assertEq(view[1389], 127, "1389th value should be 127"); -assertEq(view[1390], 76, "1390th value should be 76"); -assertEq(view[1391], 255, "1391th value should be 255"); -assertEq(view[1392], 179, "1392th value should be 179"); -assertEq(view[1393], 127, "1393th value should be 127"); -assertEq(view[1394], 76, "1394th value should be 76"); -assertEq(view[1395], 255, "1395th value should be 255"); -assertEq(view[1396], 103, "1396th value should be 103"); -assertEq(view[1397], 255, "1397th value should be 255"); -assertEq(view[1398], 152, "1398th value should be 152"); -assertEq(view[1399], 255, "1399th value should be 255"); -assertEq(view[1400], 78, "1400th value should be 78"); -assertEq(view[1401], 127, "1401th value should be 127"); -assertEq(view[1402], 178, "1402th value should be 178"); -assertEq(view[1403], 255, "1403th value should be 255"); -assertEq(view[1404], 52, "1404th value should be 52"); -assertEq(view[1405], 255, "1405th value should be 255"); -assertEq(view[1406], 203, "1406th value should be 203"); -assertEq(view[1407], 255, "1407th value should be 255"); -assertEq(view[1408], 0, "1408th value should be 0"); -assertEq(view[1409], 0, "1409th value should be 0"); -assertEq(view[1410], 0, "1410th value should be 0"); -assertEq(view[1411], 255, "1411th value should be 255"); -assertEq(view[1412], 0, "1412th value should be 0"); -assertEq(view[1413], 0, "1413th value should be 0"); -assertEq(view[1414], 0, "1414th value should be 0"); -assertEq(view[1415], 255, "1415th value should be 255"); -assertEq(view[1416], 52, "1416th value should be 52"); -assertEq(view[1417], 255, "1417th value should be 255"); -assertEq(view[1418], 203, "1418th value should be 203"); -assertEq(view[1419], 255, "1419th value should be 255"); -assertEq(view[1420], 128, "1420th value should be 128"); -assertEq(view[1421], 127, "1421th value should be 127"); -assertEq(view[1422], 127, "1422th value should be 127"); -assertEq(view[1423], 255, "1423th value should be 255"); -assertEq(view[1424], 128, "1424th value should be 128"); -assertEq(view[1425], 127, "1425th value should be 127"); -assertEq(view[1426], 127, "1426th value should be 127"); -assertEq(view[1427], 255, "1427th value should be 255"); -assertEq(view[1428], 205, "1428th value should be 205"); -assertEq(view[1429], 255, "1429th value should be 255"); -assertEq(view[1430], 50, "1430th value should be 50"); -assertEq(view[1431], 255, "1431th value should be 255"); -assertEq(view[1432], 205, "1432th value should be 205"); -assertEq(view[1433], 255, "1433th value should be 255"); -assertEq(view[1434], 50, "1434th value should be 50"); -assertEq(view[1435], 255, "1435th value should be 255"); -assertEq(view[1436], 230, "1436th value should be 230"); -assertEq(view[1437], 127, "1437th value should be 127"); -assertEq(view[1438], 25, "1438th value should be 25"); -assertEq(view[1439], 255, "1439th value should be 255"); -assertEq(view[1440], 0, "1440th value should be 0"); -assertEq(view[1441], 0, "1441th value should be 0"); -assertEq(view[1442], 0, "1442th value should be 0"); -assertEq(view[1443], 255, "1443th value should be 255"); -assertEq(view[1444], 230, "1444th value should be 230"); -assertEq(view[1445], 127, "1445th value should be 127"); -assertEq(view[1446], 25, "1446th value should be 25"); -assertEq(view[1447], 255, "1447th value should be 255"); -assertEq(view[1448], 205, "1448th value should be 205"); -assertEq(view[1449], 255, "1449th value should be 255"); -assertEq(view[1450], 50, "1450th value should be 50"); -assertEq(view[1451], 255, "1451th value should be 255"); -assertEq(view[1452], 205, "1452th value should be 205"); -assertEq(view[1453], 255, "1453th value should be 255"); -assertEq(view[1454], 50, "1454th value should be 50"); -assertEq(view[1455], 255, "1455th value should be 255"); -assertEq(view[1456], 205, "1456th value should be 205"); -assertEq(view[1457], 255, "1457th value should be 255"); -assertEq(view[1458], 50, "1458th value should be 50"); -assertEq(view[1459], 255, "1459th value should be 255"); -assertEq(view[1460], 205, "1460th value should be 205"); -assertEq(view[1461], 255, "1461th value should be 255"); -assertEq(view[1462], 50, "1462th value should be 50"); -assertEq(view[1463], 255, "1463th value should be 255"); -assertEq(view[1464], 205, "1464th value should be 205"); -assertEq(view[1465], 255, "1465th value should be 255"); -assertEq(view[1466], 50, "1466th value should be 50"); -assertEq(view[1467], 255, "1467th value should be 255"); -assertEq(view[1468], 179, "1468th value should be 179"); -assertEq(view[1469], 127, "1469th value should be 127"); -assertEq(view[1470], 76, "1470th value should be 76"); -assertEq(view[1471], 255, "1471th value should be 255"); -assertEq(view[1472], 179, "1472th value should be 179"); -assertEq(view[1473], 127, "1473th value should be 127"); -assertEq(view[1474], 76, "1474th value should be 76"); -assertEq(view[1475], 255, "1475th value should be 255"); -assertEq(view[1476], 179, "1476th value should be 179"); -assertEq(view[1477], 127, "1477th value should be 127"); -assertEq(view[1478], 76, "1478th value should be 76"); -assertEq(view[1479], 255, "1479th value should be 255"); -assertEq(view[1480], 128, "1480th value should be 128"); -assertEq(view[1481], 127, "1481th value should be 127"); -assertEq(view[1482], 127, "1482th value should be 127"); -assertEq(view[1483], 255, "1483th value should be 255"); -assertEq(view[1484], 103, "1484th value should be 103"); -assertEq(view[1485], 255, "1485th value should be 255"); -assertEq(view[1486], 152, "1486th value should be 152"); -assertEq(view[1487], 255, "1487th value should be 255"); -assertEq(view[1488], 0, "1488th value should be 0"); -assertEq(view[1489], 0, "1489th value should be 0"); -assertEq(view[1490], 0, "1490th value should be 0"); -assertEq(view[1491], 255, "1491th value should be 255"); -assertEq(view[1492], 0, "1492th value should be 0"); -assertEq(view[1493], 0, "1493th value should be 0"); -assertEq(view[1494], 0, "1494th value should be 0"); -assertEq(view[1495], 255, "1495th value should be 255"); -assertEq(view[1496], 128, "1496th value should be 128"); -assertEq(view[1497], 127, "1497th value should be 127"); -assertEq(view[1498], 127, "1498th value should be 127"); -assertEq(view[1499], 255, "1499th value should be 255"); -assertEq(view[1500], 154, "1500th value should be 154"); -assertEq(view[1501], 255, "1501th value should be 255"); -assertEq(view[1502], 101, "1502th value should be 101"); -assertEq(view[1503], 255, "1503th value should be 255"); -assertEq(view[1504], 179, "1504th value should be 179"); -assertEq(view[1505], 127, "1505th value should be 127"); -assertEq(view[1506], 76, "1506th value should be 76"); -assertEq(view[1507], 255, "1507th value should be 255"); -assertEq(view[1508], 205, "1508th value should be 205"); -assertEq(view[1509], 255, "1509th value should be 255"); -assertEq(view[1510], 50, "1510th value should be 50"); -assertEq(view[1511], 255, "1511th value should be 255"); -assertEq(view[1512], 205, "1512th value should be 205"); -assertEq(view[1513], 255, "1513th value should be 255"); -assertEq(view[1514], 50, "1514th value should be 50"); -assertEq(view[1515], 255, "1515th value should be 255"); -assertEq(view[1516], 230, "1516th value should be 230"); -assertEq(view[1517], 127, "1517th value should be 127"); -assertEq(view[1518], 25, "1518th value should be 25"); -assertEq(view[1519], 255, "1519th value should be 255"); -assertEq(view[1520], 0, "1520th value should be 0"); -assertEq(view[1521], 0, "1521th value should be 0"); -assertEq(view[1522], 0, "1522th value should be 0"); -assertEq(view[1523], 255, "1523th value should be 255"); -assertEq(view[1524], 230, "1524th value should be 230"); -assertEq(view[1525], 127, "1525th value should be 127"); -assertEq(view[1526], 25, "1526th value should be 25"); -assertEq(view[1527], 255, "1527th value should be 255"); -assertEq(view[1528], 230, "1528th value should be 230"); -assertEq(view[1529], 127, "1529th value should be 127"); -assertEq(view[1530], 25, "1530th value should be 25"); -assertEq(view[1531], 255, "1531th value should be 255"); -assertEq(view[1532], 205, "1532th value should be 205"); -assertEq(view[1533], 255, "1533th value should be 255"); -assertEq(view[1534], 50, "1534th value should be 50"); -assertEq(view[1535], 255, "1535th value should be 255"); -assertEq(view[1536], 205, "1536th value should be 205"); -assertEq(view[1537], 255, "1537th value should be 255"); -assertEq(view[1538], 50, "1538th value should be 50"); -assertEq(view[1539], 255, "1539th value should be 255"); -assertEq(view[1540], 205, "1540th value should be 205"); -assertEq(view[1541], 255, "1541th value should be 255"); -assertEq(view[1542], 50, "1542th value should be 50"); -assertEq(view[1543], 255, "1543th value should be 255"); -assertEq(view[1544], 205, "1544th value should be 205"); -assertEq(view[1545], 255, "1545th value should be 255"); -assertEq(view[1546], 50, "1546th value should be 50"); -assertEq(view[1547], 255, "1547th value should be 255"); -assertEq(view[1548], 205, "1548th value should be 205"); -assertEq(view[1549], 255, "1549th value should be 255"); -assertEq(view[1550], 50, "1550th value should be 50"); -assertEq(view[1551], 255, "1551th value should be 255"); -assertEq(view[1552], 179, "1552th value should be 179"); -assertEq(view[1553], 127, "1553th value should be 127"); -assertEq(view[1554], 76, "1554th value should be 76"); -assertEq(view[1555], 255, "1555th value should be 255"); -assertEq(view[1556], 179, "1556th value should be 179"); -assertEq(view[1557], 127, "1557th value should be 127"); -assertEq(view[1558], 76, "1558th value should be 76"); -assertEq(view[1559], 255, "1559th value should be 255"); -assertEq(view[1560], 179, "1560th value should be 179"); -assertEq(view[1561], 127, "1561th value should be 127"); -assertEq(view[1562], 76, "1562th value should be 76"); -assertEq(view[1563], 255, "1563th value should be 255"); -assertEq(view[1564], 154, "1564th value should be 154"); -assertEq(view[1565], 255, "1565th value should be 255"); -assertEq(view[1566], 101, "1566th value should be 101"); -assertEq(view[1567], 255, "1567th value should be 255"); -assertEq(view[1568], 26, "1568th value should be 26"); -assertEq(view[1569], 127, "1569th value should be 127"); -assertEq(view[1570], 229, "1570th value should be 229"); -assertEq(view[1571], 255, "1571th value should be 255"); -assertEq(view[1572], 0, "1572th value should be 0"); -assertEq(view[1573], 0, "1573th value should be 0"); -assertEq(view[1574], 0, "1574th value should be 0"); -assertEq(view[1575], 255, "1575th value should be 255"); -assertEq(view[1576], 154, "1576th value should be 154"); -assertEq(view[1577], 255, "1577th value should be 255"); -assertEq(view[1578], 101, "1578th value should be 101"); -assertEq(view[1579], 255, "1579th value should be 255"); -assertEq(view[1580], 179, "1580th value should be 179"); -assertEq(view[1581], 127, "1581th value should be 127"); -assertEq(view[1582], 76, "1582th value should be 76"); -assertEq(view[1583], 255, "1583th value should be 255"); -assertEq(view[1584], 205, "1584th value should be 205"); -assertEq(view[1585], 255, "1585th value should be 255"); -assertEq(view[1586], 50, "1586th value should be 50"); -assertEq(view[1587], 255, "1587th value should be 255"); -assertEq(view[1588], 205, "1588th value should be 205"); -assertEq(view[1589], 255, "1589th value should be 255"); -assertEq(view[1590], 50, "1590th value should be 50"); -assertEq(view[1591], 255, "1591th value should be 255"); -assertEq(view[1592], 230, "1592th value should be 230"); -assertEq(view[1593], 127, "1593th value should be 127"); -assertEq(view[1594], 25, "1594th value should be 25"); -assertEq(view[1595], 255, "1595th value should be 255"); -assertEq(view[1596], 230, "1596th value should be 230"); -assertEq(view[1597], 127, "1597th value should be 127"); -assertEq(view[1598], 25, "1598th value should be 25"); -assertEq(view[1599], 255, "1599th value should be 255"); - -// Code used to generate the assertEq list above. -function generateAssertList() { - function template(i, x) { - return 'assertEq(view[' + i + '], ' + x + ', "' + i + 'th value should be ' + x + '");\n'; - } - var buf = '' - for (var i = 0; i < LIMIT_SHOW; i++) - buf += template(i, view[i]); - print(buf); -} -//generateAssertList(); From ff68fb749fe44336d43962f5ff8175762cc4893d Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 30 Sep 2014 11:51:49 +0200 Subject: [PATCH 52/93] Backed out changeset a3ed62c1d3f6 (bug 1068725) --- js/src/jit/BacktrackingAllocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index 5f1f004f5ffc..3498c0083a6a 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -1128,7 +1128,7 @@ BacktrackingAllocator::reifyAllocations() if (*res != *alloc) { LMoveGroup *group = getInputMoveGroup(inputOf(ins)); - if (!group->addAfter(sourceAlloc, res, reg->type())) + if (!group->addAfter(sourceAlloc, res, def->type())) return false; *alloc = *res; } From 951c3ef58ccfe461379198fac60acdb3596c0afe Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 30 Sep 2014 11:52:10 +0200 Subject: [PATCH 53/93] Backed out changeset 76009dc6ed72 (bug 1068725) for bustage on a CLOSED TREE --- js/src/jit/LIR.cpp | 24 +++--------------------- js/src/jit/LIR.h | 1 - js/src/jit/RegisterAllocator.cpp | 2 +- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/js/src/jit/LIR.cpp b/js/src/jit/LIR.cpp index 526da37a74fa..35a297093271 100644 --- a/js/src/jit/LIR.cpp +++ b/js/src/jit/LIR.cpp @@ -348,8 +348,6 @@ static const char * const TypeChars[] = "s", // SLOTS "f", // FLOAT32 "d", // DOUBLE - "i32x4", // INT32X4 - "f32x4", // FLOAT32X4 #ifdef JS_NUNBOX32 "t", // TYPE "p" // PAYLOAD @@ -543,25 +541,9 @@ bool LMoveGroup::add(LAllocation *from, LAllocation *to, LDefinition::Type type) { #ifdef DEBUG - MOZ_ASSERT(*from != *to); + JS_ASSERT(*from != *to); for (size_t i = 0; i < moves_.length(); i++) - MOZ_ASSERT(*to != *moves_[i].to()); - - // Check that SIMD moves are aligned according to ABI requirements. - if (LDefinition(type).isSimdType()) { - if (from->isMemory()) { - if (from->isArgument()) - MOZ_ASSERT(from->toArgument()->index() % SimdStackAlignment == 0); - else - MOZ_ASSERT(from->toStackSlot()->slot() % SimdStackAlignment == 0); - } - if (to->isMemory()) { - if (to->isArgument()) - MOZ_ASSERT(to->toArgument()->index() % SimdStackAlignment == 0); - else - MOZ_ASSERT(to->toStackSlot()->slot() % SimdStackAlignment == 0); - } - } + JS_ASSERT(*to != *moves_[i].to()); #endif return moves_.append(LMove(from, to, type)); } @@ -600,7 +582,7 @@ LMoveGroup::printOperands(FILE *fp) const LMove &move = getMove(i); // Use two printfs, as LAllocation::toString is not reentrant. fprintf(fp, " [%s", move.from()->toString()); - fprintf(fp, " -> %s, %s]", move.to()->toString(), TypeChars[move.type()]); + fprintf(fp, " -> %s]", move.to()->toString()); if (i != numMoves() - 1) fprintf(fp, ","); } diff --git a/js/src/jit/LIR.h b/js/src/jit/LIR.h index d80ddc0018d3..cda84bec76c5 100644 --- a/js/src/jit/LIR.h +++ b/js/src/jit/LIR.h @@ -416,7 +416,6 @@ class LDefinition MUST_REUSE_INPUT }; - // This should be kept in sync with LIR.cpp's TypeChars. enum Type { GENERAL, // Generic, integer or pointer-width data (GPR). INT32, // int32 data (GPR). diff --git a/js/src/jit/RegisterAllocator.cpp b/js/src/jit/RegisterAllocator.cpp index 27892b0c0a53..67621b27c46a 100644 --- a/js/src/jit/RegisterAllocator.cpp +++ b/js/src/jit/RegisterAllocator.cpp @@ -407,7 +407,7 @@ AllocationIntegrityState::dump() if (ins->isMoveGroup()) { LMoveGroup *group = ins->toMoveGroup(); for (int i = group->numMoves() - 1; i >= 0; i--) { - // Use two printfs, as LAllocation::toString is not reentrant. + // Use two printfs, as LAllocation::toString is not reentant. fprintf(stderr, " [%s", group->getMove(i).from()->toString()); fprintf(stderr, " -> %s]", group->getMove(i).to()->toString()); } From dfd05f13b0a99a49eb64fa8e92ebb968bea1b616 Mon Sep 17 00:00:00 2001 From: Simone Bruno Date: Tue, 30 Sep 2014 03:06:03 -0700 Subject: [PATCH 54/93] Bug 1058286 - Add intree tooltool manifests for avds artifacts needed for android tests. r=armenzg --- .../config/tooltool-manifests/androidarm/releng.manifest | 7 +++++++ .../config/tooltool-manifests/androidx86/releng.manifest | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 testing/config/tooltool-manifests/androidarm/releng.manifest create mode 100644 testing/config/tooltool-manifests/androidx86/releng.manifest diff --git a/testing/config/tooltool-manifests/androidarm/releng.manifest b/testing/config/tooltool-manifests/androidarm/releng.manifest new file mode 100644 index 000000000000..470e6a2bed56 --- /dev/null +++ b/testing/config/tooltool-manifests/androidarm/releng.manifest @@ -0,0 +1,7 @@ +[{ +"size": 261782928, +"digest": "7140e026b7b747236545dc30e377a959b0bdf91bb4d70efd7f97f92fce12a9196042503124b8df8d30c2d97b7eb5f9df9556afdffa0b5d9625008aead305c32b", +"algorithm": "sha512", +"filename": "AVDs-armv7a-gingerbread-build-2014-01-23-ubuntu.tar.gz", +"unpack": "True" +}] diff --git a/testing/config/tooltool-manifests/androidx86/releng.manifest b/testing/config/tooltool-manifests/androidx86/releng.manifest new file mode 100644 index 000000000000..b75a29da16f1 --- /dev/null +++ b/testing/config/tooltool-manifests/androidx86/releng.manifest @@ -0,0 +1,7 @@ +[{ +"size": 561274118, +"digest": "3b2d18eb0194d82c70c5ee17487ccbac309f9b2e9839fe7ca4a27a9a06f6338bb24394476da78559685d99151fccc85fdde03297aa73ee2f7fb3183e11925c4d", +"algorithm": "sha512", +"filename": "AVDs-x86-android-4.2_r1-build-2013-11-13-ubuntu.tar.gz", +"unpack": "True" +}] From 01552c03d907eb61f52d4cd129f4efd6aecf4351 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Sep 2014 11:33:11 +0200 Subject: [PATCH 55/93] Bug 1068725: More debugging and assertions for MoveGroups; r=sunfish * * * Bug 1068725: Make the MoveGroup type spew debug only; r=bustage --- js/src/jit/LIR.cpp | 28 +++++++++++++++++++++++++--- js/src/jit/LIR.h | 1 + js/src/jit/RegisterAllocator.cpp | 2 +- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/js/src/jit/LIR.cpp b/js/src/jit/LIR.cpp index 35a297093271..bad572f792ab 100644 --- a/js/src/jit/LIR.cpp +++ b/js/src/jit/LIR.cpp @@ -348,6 +348,8 @@ static const char * const TypeChars[] = "s", // SLOTS "f", // FLOAT32 "d", // DOUBLE + "i32x4", // INT32X4 + "f32x4", // FLOAT32X4 #ifdef JS_NUNBOX32 "t", // TYPE "p" // PAYLOAD @@ -541,9 +543,25 @@ bool LMoveGroup::add(LAllocation *from, LAllocation *to, LDefinition::Type type) { #ifdef DEBUG - JS_ASSERT(*from != *to); + MOZ_ASSERT(*from != *to); for (size_t i = 0; i < moves_.length(); i++) - JS_ASSERT(*to != *moves_[i].to()); + MOZ_ASSERT(*to != *moves_[i].to()); + + // Check that SIMD moves are aligned according to ABI requirements. + if (LDefinition(type).isSimdType()) { + if (from->isMemory()) { + if (from->isArgument()) + MOZ_ASSERT(from->toArgument()->index() % SimdStackAlignment == 0); + else + MOZ_ASSERT(from->toStackSlot()->slot() % SimdStackAlignment == 0); + } + if (to->isMemory()) { + if (to->isArgument()) + MOZ_ASSERT(to->toArgument()->index() % SimdStackAlignment == 0); + else + MOZ_ASSERT(to->toStackSlot()->slot() % SimdStackAlignment == 0); + } + } #endif return moves_.append(LMove(from, to, type)); } @@ -582,7 +600,11 @@ LMoveGroup::printOperands(FILE *fp) const LMove &move = getMove(i); // Use two printfs, as LAllocation::toString is not reentrant. fprintf(fp, " [%s", move.from()->toString()); - fprintf(fp, " -> %s]", move.to()->toString()); + fprintf(fp, " -> %s", move.to()->toString()); +#ifdef DEBUG + fprintf(fp, ", %s", TypeChars[move.type()]); +#endif + fprintf(fp, "]"); if (i != numMoves() - 1) fprintf(fp, ","); } diff --git a/js/src/jit/LIR.h b/js/src/jit/LIR.h index cda84bec76c5..d80ddc0018d3 100644 --- a/js/src/jit/LIR.h +++ b/js/src/jit/LIR.h @@ -416,6 +416,7 @@ class LDefinition MUST_REUSE_INPUT }; + // This should be kept in sync with LIR.cpp's TypeChars. enum Type { GENERAL, // Generic, integer or pointer-width data (GPR). INT32, // int32 data (GPR). diff --git a/js/src/jit/RegisterAllocator.cpp b/js/src/jit/RegisterAllocator.cpp index 67621b27c46a..27892b0c0a53 100644 --- a/js/src/jit/RegisterAllocator.cpp +++ b/js/src/jit/RegisterAllocator.cpp @@ -407,7 +407,7 @@ AllocationIntegrityState::dump() if (ins->isMoveGroup()) { LMoveGroup *group = ins->toMoveGroup(); for (int i = group->numMoves() - 1; i >= 0; i--) { - // Use two printfs, as LAllocation::toString is not reentant. + // Use two printfs, as LAllocation::toString is not reentrant. fprintf(stderr, " [%s", group->getMove(i).from()->toString()); fprintf(stderr, " -> %s]", group->getMove(i).to()->toString()); } From 8f19e3476ea84b2ff2286050cd98fc23920bb8b7 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Sep 2014 11:33:17 +0200 Subject: [PATCH 56/93] Bug 1068725: Use actual input's type for a move when reifying allocations with backtracking regalloc; r=sunfish --- js/src/jit/BacktrackingAllocator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp index 3498c0083a6a..5f1f004f5ffc 100644 --- a/js/src/jit/BacktrackingAllocator.cpp +++ b/js/src/jit/BacktrackingAllocator.cpp @@ -1128,7 +1128,7 @@ BacktrackingAllocator::reifyAllocations() if (*res != *alloc) { LMoveGroup *group = getInputMoveGroup(inputOf(ins)); - if (!group->addAfter(sourceAlloc, res, def->type())) + if (!group->addAfter(sourceAlloc, res, reg->type())) return false; *alloc = *res; } From ad8c123efb8cf65e508377b457862ff68e0d43f1 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Sep 2014 11:33:27 +0200 Subject: [PATCH 57/93] Bug 1068725: Add Mandelbrot SIMD demo to the test suite; r=luke --- .../jit-test/tests/asm.js/simd-mandelbrot.js | 1814 +++++++++++++++++ 1 file changed, 1814 insertions(+) create mode 100644 js/src/jit-test/tests/asm.js/simd-mandelbrot.js diff --git a/js/src/jit-test/tests/asm.js/simd-mandelbrot.js b/js/src/jit-test/tests/asm.js/simd-mandelbrot.js new file mode 100644 index 000000000000..b6b364a5edfd --- /dev/null +++ b/js/src/jit-test/tests/asm.js/simd-mandelbrot.js @@ -0,0 +1,1814 @@ +/* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level : 2 ; js-curly-indent-offset: 0 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ + +// Mandelbrot using SIMD +// Author: Peter Jensen, Intel Corporation + +load(libdir + "asm.js"); +if (!isSimdAvailable() || typeof SIMD === 'undefined') { + print("won't run tests as simd extensions aren't activated yet"); + quit(0); +} + +// global variables +const MAX_ITERATIONS = 10; +const DRAW_ITERATIONS = 10; + +const CANVAS_WIDTH = 20; +const CANVAS_HEIGHT = 20; + +const LIMIT_SHOW = 20 * 20 * 4; + +// Asm.js module buffer. +var buffer = new ArrayBuffer(16 * 1024 * 1024); +var view = new Uint8Array(buffer); + +var moduleCode = ` + "use asm" + var b8 = new global.Uint8Array(buffer); + var toF = global.Math.fround; + var i4 = global.SIMD.int32x4; + var f4 = global.SIMD.float32x4; + var i4add = i4.add; + var i4and = i4.and; + var f4add = f4.add; + var f4sub = f4.sub; + var f4mul = f4.mul; + var f4lessThanOrEqual = f4.lessThanOrEqual; + var f4splat = f4.splat; + var imul = global.Math.imul; + const one4 = i4(1,1,1,1), two4 = f4(2,2,2,2), four4 = f4(4,4,4,4); + + const mk0 = 0x007fffff; + + function declareHeapLength() { + b8[0x00ffffff] = 0; + } + + function mapColorAndSetPixel (x, y, width, value, max_iterations) { + x = x | 0; + y = y | 0; + width = width | 0; + value = value | 0; + max_iterations = max_iterations | 0; + + var rgb = 0, r = 0, g = 0, b = 0, index = 0; + + index = (((imul((width >>> 0), (y >>> 0)) + x) | 0) * 4) | 0; + if ((value | 0) == (max_iterations | 0)) { + r = 0; + g = 0; + b = 0; + } else { + rgb = ~~toF(toF(toF(toF(value >>> 0) * toF(0xffff)) / toF(max_iterations >>> 0)) * toF(0xff)); + r = rgb & 0xff; + g = (rgb >>> 8) & 0xff; + b = (rgb >>> 16) & 0xff; + } + b8[(index & mk0) >> 0] = r; + b8[(index & mk0) + 1 >> 0] = g; + b8[(index & mk0) + 2 >> 0] = b; + b8[(index & mk0) + 3 >> 0] = 255; + } + + function mandelPixelX4 (xf, yf, yd, max_iterations) { + xf = toF(xf); + yf = toF(yf); + yd = toF(yd); + max_iterations = max_iterations | 0; + var c_re4 = f4(0,0,0,0), c_im4 = f4(0,0,0,0); + var z_re4 = f4(0,0,0,0), z_im4 = f4(0,0,0,0); + var count4 = i4(0,0,0,0); + var z_re24 = f4(0,0,0,0), z_im24 = f4(0,0,0,0); + var new_re4 = f4(0,0,0,0), new_im4 = f4(0,0,0,0); + var i = 0; + var mi4 = i4(0,0,0,0); + + c_re4 = f4splat(xf); + c_im4 = f4(yf, toF(yd + yf), toF(yd + toF(yd + yf)), toF(yd + toF(yd + toF(yd + yf)))); + + z_re4 = c_re4; + z_im4 = c_im4; + + for (i = 0; (i | 0) < (max_iterations | 0); i = (i + 1) | 0) { + z_re24 = f4mul(z_re4, z_re4); + z_im24 = f4mul(z_im4, z_im4); + mi4 = f4lessThanOrEqual(f4add(z_re24, z_im24), four4); + // If all 4 values are greater than 4.0, there's no reason to continue. + if ((mi4.signMask | 0) == 0x00) + break; + + new_re4 = f4sub(z_re24, z_im24); + new_im4 = f4mul(f4mul(two4, z_re4), z_im4); + z_re4 = f4add(c_re4, new_re4); + z_im4 = f4add(c_im4, new_im4); + count4 = i4add(count4, i4and(mi4, one4)); + } + return i4(count4); + } + + function mandelColumnX4 (x, width, height, xf, yf, yd, max_iterations) { + x = x | 0; + width = width | 0; + height = height | 0; + xf = toF(xf); + yf = toF(yf); + yd = toF(yd); + max_iterations = max_iterations | 0; + + var y = 0; + var ydx4 = toF(0); + var m4 = i4(0,0,0,0); + + ydx4 = toF(yd * toF(4)); + for (y = 0; (y | 0) < (height | 0); y = (y + 4) | 0) { + m4 = i4(mandelPixelX4(toF(xf), toF(yf), toF(yd), max_iterations)); + mapColorAndSetPixel(x | 0, y | 0, width, m4.x, max_iterations); + mapColorAndSetPixel(x | 0, (y + 1) | 0, width, m4.y, max_iterations); + mapColorAndSetPixel(x | 0, (y + 2) | 0, width, m4.z, max_iterations); + mapColorAndSetPixel(x | 0, (y + 3) | 0, width, m4.w, max_iterations); + yf = toF(yf + ydx4); + } + } + + function mandel (width, height, xc, yc, scale, max_iterations) { + width = width | 0; + height = height | 0; + xc = toF(xc); + yc = toF(yc); + scale = toF(scale); + max_iterations = max_iterations | 0; + + var x0 = toF(0), y0 = toF(0); + var xd = toF(0), yd = toF(0); + var xf = toF(0); + var x = 0; + + x0 = toF(xc - toF(scale * toF(1.5))); + y0 = toF(yc - scale); + xd = toF(toF(scale * toF(3)) / toF(width >>> 0)); + yd = toF(toF(scale * toF(2)) / toF(height >>> 0)); + xf = x0; + + for (x = 0; (x | 0) < (width | 0); x = (x + 1) | 0) { + mandelColumnX4(x, width, height, xf, y0, yd, max_iterations); + xf = toF(xf + xd); + } + } + + return mandel; +`; + +var FFI = {}; +var mandelbro = asmLink(asmCompile('global', 'ffi', 'buffer', moduleCode), this, FFI, buffer); + +function animateMandelbrot () { + var scale_start = 1.0; + var scale_end = 0.0005; + var xc_start = -0.5; + var yc_start = 0.0; + var xc_end = 0.0; + var yc_end = 0.75; + var steps = 200.0; + var scale_step = (scale_end - scale_start)/steps; + var xc_step = (xc_end - xc_start)/steps; + var yc_step = (yc_end - yc_start)/steps; + var scale = scale_start; + var xc = xc_start; + var yc = yc_start; + var i = 0; + var now = dateNow(); + + function draw1 () { + mandelbro(CANVAS_WIDTH, CANVAS_HEIGHT, xc, yc, scale, MAX_ITERATIONS); + if (scale < scale_end || scale > scale_start) { + scale_step = -scale_step; + xc_step = -xc_step; + yc_step = -yc_step; + } + scale += scale_step; + xc += xc_step; + yc += yc_step; + i++; + } + + var b = dateNow(); + for (var j = DRAW_ITERATIONS; j --> 0;) + draw1(); + print(dateNow() - b); +} + +animateMandelbrot(); + +assertEq(view[0], 0, "0th value should be 0"); +assertEq(view[1], 0, "1th value should be 0"); +assertEq(view[2], 0, "2th value should be 0"); +assertEq(view[3], 255, "3th value should be 255"); +assertEq(view[4], 230, "4th value should be 230"); +assertEq(view[5], 127, "5th value should be 127"); +assertEq(view[6], 25, "6th value should be 25"); +assertEq(view[7], 255, "7th value should be 255"); +assertEq(view[8], 230, "8th value should be 230"); +assertEq(view[9], 127, "9th value should be 127"); +assertEq(view[10], 25, "10th value should be 25"); +assertEq(view[11], 255, "11th value should be 255"); +assertEq(view[12], 205, "12th value should be 205"); +assertEq(view[13], 255, "13th value should be 255"); +assertEq(view[14], 50, "14th value should be 50"); +assertEq(view[15], 255, "15th value should be 255"); +assertEq(view[16], 205, "16th value should be 205"); +assertEq(view[17], 255, "17th value should be 255"); +assertEq(view[18], 50, "18th value should be 50"); +assertEq(view[19], 255, "19th value should be 255"); +assertEq(view[20], 205, "20th value should be 205"); +assertEq(view[21], 255, "21th value should be 255"); +assertEq(view[22], 50, "22th value should be 50"); +assertEq(view[23], 255, "23th value should be 255"); +assertEq(view[24], 205, "24th value should be 205"); +assertEq(view[25], 255, "25th value should be 255"); +assertEq(view[26], 50, "26th value should be 50"); +assertEq(view[27], 255, "27th value should be 255"); +assertEq(view[28], 205, "28th value should be 205"); +assertEq(view[29], 255, "29th value should be 255"); +assertEq(view[30], 50, "30th value should be 50"); +assertEq(view[31], 255, "31th value should be 255"); +assertEq(view[32], 179, "32th value should be 179"); +assertEq(view[33], 127, "33th value should be 127"); +assertEq(view[34], 76, "34th value should be 76"); +assertEq(view[35], 255, "35th value should be 255"); +assertEq(view[36], 179, "36th value should be 179"); +assertEq(view[37], 127, "37th value should be 127"); +assertEq(view[38], 76, "38th value should be 76"); +assertEq(view[39], 255, "39th value should be 255"); +assertEq(view[40], 179, "40th value should be 179"); +assertEq(view[41], 127, "41th value should be 127"); +assertEq(view[42], 76, "42th value should be 76"); +assertEq(view[43], 255, "43th value should be 255"); +assertEq(view[44], 154, "44th value should be 154"); +assertEq(view[45], 255, "45th value should be 255"); +assertEq(view[46], 101, "46th value should be 101"); +assertEq(view[47], 255, "47th value should be 255"); +assertEq(view[48], 78, "48th value should be 78"); +assertEq(view[49], 127, "49th value should be 127"); +assertEq(view[50], 178, "50th value should be 178"); +assertEq(view[51], 255, "51th value should be 255"); +assertEq(view[52], 52, "52th value should be 52"); +assertEq(view[53], 255, "53th value should be 255"); +assertEq(view[54], 203, "54th value should be 203"); +assertEq(view[55], 255, "55th value should be 255"); +assertEq(view[56], 154, "56th value should be 154"); +assertEq(view[57], 255, "57th value should be 255"); +assertEq(view[58], 101, "58th value should be 101"); +assertEq(view[59], 255, "59th value should be 255"); +assertEq(view[60], 179, "60th value should be 179"); +assertEq(view[61], 127, "61th value should be 127"); +assertEq(view[62], 76, "62th value should be 76"); +assertEq(view[63], 255, "63th value should be 255"); +assertEq(view[64], 205, "64th value should be 205"); +assertEq(view[65], 255, "65th value should be 255"); +assertEq(view[66], 50, "66th value should be 50"); +assertEq(view[67], 255, "67th value should be 255"); +assertEq(view[68], 205, "68th value should be 205"); +assertEq(view[69], 255, "69th value should be 255"); +assertEq(view[70], 50, "70th value should be 50"); +assertEq(view[71], 255, "71th value should be 255"); +assertEq(view[72], 230, "72th value should be 230"); +assertEq(view[73], 127, "73th value should be 127"); +assertEq(view[74], 25, "74th value should be 25"); +assertEq(view[75], 255, "75th value should be 255"); +assertEq(view[76], 230, "76th value should be 230"); +assertEq(view[77], 127, "77th value should be 127"); +assertEq(view[78], 25, "78th value should be 25"); +assertEq(view[79], 255, "79th value should be 255"); +assertEq(view[80], 0, "80th value should be 0"); +assertEq(view[81], 0, "81th value should be 0"); +assertEq(view[82], 0, "82th value should be 0"); +assertEq(view[83], 255, "83th value should be 255"); +assertEq(view[84], 230, "84th value should be 230"); +assertEq(view[85], 127, "85th value should be 127"); +assertEq(view[86], 25, "86th value should be 25"); +assertEq(view[87], 255, "87th value should be 255"); +assertEq(view[88], 205, "88th value should be 205"); +assertEq(view[89], 255, "89th value should be 255"); +assertEq(view[90], 50, "90th value should be 50"); +assertEq(view[91], 255, "91th value should be 255"); +assertEq(view[92], 205, "92th value should be 205"); +assertEq(view[93], 255, "93th value should be 255"); +assertEq(view[94], 50, "94th value should be 50"); +assertEq(view[95], 255, "95th value should be 255"); +assertEq(view[96], 205, "96th value should be 205"); +assertEq(view[97], 255, "97th value should be 255"); +assertEq(view[98], 50, "98th value should be 50"); +assertEq(view[99], 255, "99th value should be 255"); +assertEq(view[100], 205, "100th value should be 205"); +assertEq(view[101], 255, "101th value should be 255"); +assertEq(view[102], 50, "102th value should be 50"); +assertEq(view[103], 255, "103th value should be 255"); +assertEq(view[104], 205, "104th value should be 205"); +assertEq(view[105], 255, "105th value should be 255"); +assertEq(view[106], 50, "106th value should be 50"); +assertEq(view[107], 255, "107th value should be 255"); +assertEq(view[108], 205, "108th value should be 205"); +assertEq(view[109], 255, "109th value should be 255"); +assertEq(view[110], 50, "110th value should be 50"); +assertEq(view[111], 255, "111th value should be 255"); +assertEq(view[112], 179, "112th value should be 179"); +assertEq(view[113], 127, "113th value should be 127"); +assertEq(view[114], 76, "114th value should be 76"); +assertEq(view[115], 255, "115th value should be 255"); +assertEq(view[116], 179, "116th value should be 179"); +assertEq(view[117], 127, "117th value should be 127"); +assertEq(view[118], 76, "118th value should be 76"); +assertEq(view[119], 255, "119th value should be 255"); +assertEq(view[120], 154, "120th value should be 154"); +assertEq(view[121], 255, "121th value should be 255"); +assertEq(view[122], 101, "122th value should be 101"); +assertEq(view[123], 255, "123th value should be 255"); +assertEq(view[124], 103, "124th value should be 103"); +assertEq(view[125], 255, "125th value should be 255"); +assertEq(view[126], 152, "126th value should be 152"); +assertEq(view[127], 255, "127th value should be 255"); +assertEq(view[128], 0, "128th value should be 0"); +assertEq(view[129], 0, "129th value should be 0"); +assertEq(view[130], 0, "130th value should be 0"); +assertEq(view[131], 255, "131th value should be 255"); +assertEq(view[132], 0, "132th value should be 0"); +assertEq(view[133], 0, "133th value should be 0"); +assertEq(view[134], 0, "134th value should be 0"); +assertEq(view[135], 255, "135th value should be 255"); +assertEq(view[136], 128, "136th value should be 128"); +assertEq(view[137], 127, "137th value should be 127"); +assertEq(view[138], 127, "138th value should be 127"); +assertEq(view[139], 255, "139th value should be 255"); +assertEq(view[140], 154, "140th value should be 154"); +assertEq(view[141], 255, "141th value should be 255"); +assertEq(view[142], 101, "142th value should be 101"); +assertEq(view[143], 255, "143th value should be 255"); +assertEq(view[144], 179, "144th value should be 179"); +assertEq(view[145], 127, "145th value should be 127"); +assertEq(view[146], 76, "146th value should be 76"); +assertEq(view[147], 255, "147th value should be 255"); +assertEq(view[148], 205, "148th value should be 205"); +assertEq(view[149], 255, "149th value should be 255"); +assertEq(view[150], 50, "150th value should be 50"); +assertEq(view[151], 255, "151th value should be 255"); +assertEq(view[152], 205, "152th value should be 205"); +assertEq(view[153], 255, "153th value should be 255"); +assertEq(view[154], 50, "154th value should be 50"); +assertEq(view[155], 255, "155th value should be 255"); +assertEq(view[156], 230, "156th value should be 230"); +assertEq(view[157], 127, "157th value should be 127"); +assertEq(view[158], 25, "158th value should be 25"); +assertEq(view[159], 255, "159th value should be 255"); +assertEq(view[160], 0, "160th value should be 0"); +assertEq(view[161], 0, "161th value should be 0"); +assertEq(view[162], 0, "162th value should be 0"); +assertEq(view[163], 255, "163th value should be 255"); +assertEq(view[164], 230, "164th value should be 230"); +assertEq(view[165], 127, "165th value should be 127"); +assertEq(view[166], 25, "166th value should be 25"); +assertEq(view[167], 255, "167th value should be 255"); +assertEq(view[168], 205, "168th value should be 205"); +assertEq(view[169], 255, "169th value should be 255"); +assertEq(view[170], 50, "170th value should be 50"); +assertEq(view[171], 255, "171th value should be 255"); +assertEq(view[172], 205, "172th value should be 205"); +assertEq(view[173], 255, "173th value should be 255"); +assertEq(view[174], 50, "174th value should be 50"); +assertEq(view[175], 255, "175th value should be 255"); +assertEq(view[176], 205, "176th value should be 205"); +assertEq(view[177], 255, "177th value should be 255"); +assertEq(view[178], 50, "178th value should be 50"); +assertEq(view[179], 255, "179th value should be 255"); +assertEq(view[180], 205, "180th value should be 205"); +assertEq(view[181], 255, "181th value should be 255"); +assertEq(view[182], 50, "182th value should be 50"); +assertEq(view[183], 255, "183th value should be 255"); +assertEq(view[184], 205, "184th value should be 205"); +assertEq(view[185], 255, "185th value should be 255"); +assertEq(view[186], 50, "186th value should be 50"); +assertEq(view[187], 255, "187th value should be 255"); +assertEq(view[188], 179, "188th value should be 179"); +assertEq(view[189], 127, "189th value should be 127"); +assertEq(view[190], 76, "190th value should be 76"); +assertEq(view[191], 255, "191th value should be 255"); +assertEq(view[192], 179, "192th value should be 179"); +assertEq(view[193], 127, "193th value should be 127"); +assertEq(view[194], 76, "194th value should be 76"); +assertEq(view[195], 255, "195th value should be 255"); +assertEq(view[196], 154, "196th value should be 154"); +assertEq(view[197], 255, "197th value should be 255"); +assertEq(view[198], 101, "198th value should be 101"); +assertEq(view[199], 255, "199th value should be 255"); +assertEq(view[200], 103, "200th value should be 103"); +assertEq(view[201], 255, "201th value should be 255"); +assertEq(view[202], 152, "202th value should be 152"); +assertEq(view[203], 255, "203th value should be 255"); +assertEq(view[204], 78, "204th value should be 78"); +assertEq(view[205], 127, "205th value should be 127"); +assertEq(view[206], 178, "206th value should be 178"); +assertEq(view[207], 255, "207th value should be 255"); +assertEq(view[208], 0, "208th value should be 0"); +assertEq(view[209], 0, "209th value should be 0"); +assertEq(view[210], 0, "210th value should be 0"); +assertEq(view[211], 255, "211th value should be 255"); +assertEq(view[212], 0, "212th value should be 0"); +assertEq(view[213], 0, "213th value should be 0"); +assertEq(view[214], 0, "214th value should be 0"); +assertEq(view[215], 255, "215th value should be 255"); +assertEq(view[216], 78, "216th value should be 78"); +assertEq(view[217], 127, "217th value should be 127"); +assertEq(view[218], 178, "218th value should be 178"); +assertEq(view[219], 255, "219th value should be 255"); +assertEq(view[220], 128, "220th value should be 128"); +assertEq(view[221], 127, "221th value should be 127"); +assertEq(view[222], 127, "222th value should be 127"); +assertEq(view[223], 255, "223th value should be 255"); +assertEq(view[224], 154, "224th value should be 154"); +assertEq(view[225], 255, "225th value should be 255"); +assertEq(view[226], 101, "226th value should be 101"); +assertEq(view[227], 255, "227th value should be 255"); +assertEq(view[228], 205, "228th value should be 205"); +assertEq(view[229], 255, "229th value should be 255"); +assertEq(view[230], 50, "230th value should be 50"); +assertEq(view[231], 255, "231th value should be 255"); +assertEq(view[232], 205, "232th value should be 205"); +assertEq(view[233], 255, "233th value should be 255"); +assertEq(view[234], 50, "234th value should be 50"); +assertEq(view[235], 255, "235th value should be 255"); +assertEq(view[236], 230, "236th value should be 230"); +assertEq(view[237], 127, "237th value should be 127"); +assertEq(view[238], 25, "238th value should be 25"); +assertEq(view[239], 255, "239th value should be 255"); +assertEq(view[240], 0, "240th value should be 0"); +assertEq(view[241], 0, "241th value should be 0"); +assertEq(view[242], 0, "242th value should be 0"); +assertEq(view[243], 255, "243th value should be 255"); +assertEq(view[244], 205, "244th value should be 205"); +assertEq(view[245], 255, "245th value should be 255"); +assertEq(view[246], 50, "246th value should be 50"); +assertEq(view[247], 255, "247th value should be 255"); +assertEq(view[248], 205, "248th value should be 205"); +assertEq(view[249], 255, "249th value should be 255"); +assertEq(view[250], 50, "250th value should be 50"); +assertEq(view[251], 255, "251th value should be 255"); +assertEq(view[252], 205, "252th value should be 205"); +assertEq(view[253], 255, "253th value should be 255"); +assertEq(view[254], 50, "254th value should be 50"); +assertEq(view[255], 255, "255th value should be 255"); +assertEq(view[256], 205, "256th value should be 205"); +assertEq(view[257], 255, "257th value should be 255"); +assertEq(view[258], 50, "258th value should be 50"); +assertEq(view[259], 255, "259th value should be 255"); +assertEq(view[260], 205, "260th value should be 205"); +assertEq(view[261], 255, "261th value should be 255"); +assertEq(view[262], 50, "262th value should be 50"); +assertEq(view[263], 255, "263th value should be 255"); +assertEq(view[264], 179, "264th value should be 179"); +assertEq(view[265], 127, "265th value should be 127"); +assertEq(view[266], 76, "266th value should be 76"); +assertEq(view[267], 255, "267th value should be 255"); +assertEq(view[268], 179, "268th value should be 179"); +assertEq(view[269], 127, "269th value should be 127"); +assertEq(view[270], 76, "270th value should be 76"); +assertEq(view[271], 255, "271th value should be 255"); +assertEq(view[272], 154, "272th value should be 154"); +assertEq(view[273], 255, "273th value should be 255"); +assertEq(view[274], 101, "274th value should be 101"); +assertEq(view[275], 255, "275th value should be 255"); +assertEq(view[276], 52, "276th value should be 52"); +assertEq(view[277], 255, "277th value should be 255"); +assertEq(view[278], 203, "278th value should be 203"); +assertEq(view[279], 255, "279th value should be 255"); +assertEq(view[280], 0, "280th value should be 0"); +assertEq(view[281], 0, "281th value should be 0"); +assertEq(view[282], 0, "282th value should be 0"); +assertEq(view[283], 255, "283th value should be 255"); +assertEq(view[284], 0, "284th value should be 0"); +assertEq(view[285], 0, "285th value should be 0"); +assertEq(view[286], 0, "286th value should be 0"); +assertEq(view[287], 255, "287th value should be 255"); +assertEq(view[288], 0, "288th value should be 0"); +assertEq(view[289], 0, "289th value should be 0"); +assertEq(view[290], 0, "290th value should be 0"); +assertEq(view[291], 255, "291th value should be 255"); +assertEq(view[292], 0, "292th value should be 0"); +assertEq(view[293], 0, "293th value should be 0"); +assertEq(view[294], 0, "294th value should be 0"); +assertEq(view[295], 255, "295th value should be 255"); +assertEq(view[296], 0, "296th value should be 0"); +assertEq(view[297], 0, "297th value should be 0"); +assertEq(view[298], 0, "298th value should be 0"); +assertEq(view[299], 255, "299th value should be 255"); +assertEq(view[300], 52, "300th value should be 52"); +assertEq(view[301], 255, "301th value should be 255"); +assertEq(view[302], 203, "302th value should be 203"); +assertEq(view[303], 255, "303th value should be 255"); +assertEq(view[304], 52, "304th value should be 52"); +assertEq(view[305], 255, "305th value should be 255"); +assertEq(view[306], 203, "306th value should be 203"); +assertEq(view[307], 255, "307th value should be 255"); +assertEq(view[308], 179, "308th value should be 179"); +assertEq(view[309], 127, "309th value should be 127"); +assertEq(view[310], 76, "310th value should be 76"); +assertEq(view[311], 255, "311th value should be 255"); +assertEq(view[312], 205, "312th value should be 205"); +assertEq(view[313], 255, "313th value should be 255"); +assertEq(view[314], 50, "314th value should be 50"); +assertEq(view[315], 255, "315th value should be 255"); +assertEq(view[316], 205, "316th value should be 205"); +assertEq(view[317], 255, "317th value should be 255"); +assertEq(view[318], 50, "318th value should be 50"); +assertEq(view[319], 255, "319th value should be 255"); +assertEq(view[320], 230, "320th value should be 230"); +assertEq(view[321], 127, "321th value should be 127"); +assertEq(view[322], 25, "322th value should be 25"); +assertEq(view[323], 255, "323th value should be 255"); +assertEq(view[324], 205, "324th value should be 205"); +assertEq(view[325], 255, "325th value should be 255"); +assertEq(view[326], 50, "326th value should be 50"); +assertEq(view[327], 255, "327th value should be 255"); +assertEq(view[328], 205, "328th value should be 205"); +assertEq(view[329], 255, "329th value should be 255"); +assertEq(view[330], 50, "330th value should be 50"); +assertEq(view[331], 255, "331th value should be 255"); +assertEq(view[332], 205, "332th value should be 205"); +assertEq(view[333], 255, "333th value should be 255"); +assertEq(view[334], 50, "334th value should be 50"); +assertEq(view[335], 255, "335th value should be 255"); +assertEq(view[336], 205, "336th value should be 205"); +assertEq(view[337], 255, "337th value should be 255"); +assertEq(view[338], 50, "338th value should be 50"); +assertEq(view[339], 255, "339th value should be 255"); +assertEq(view[340], 179, "340th value should be 179"); +assertEq(view[341], 127, "341th value should be 127"); +assertEq(view[342], 76, "342th value should be 76"); +assertEq(view[343], 255, "343th value should be 255"); +assertEq(view[344], 154, "344th value should be 154"); +assertEq(view[345], 255, "345th value should be 255"); +assertEq(view[346], 101, "346th value should be 101"); +assertEq(view[347], 255, "347th value should be 255"); +assertEq(view[348], 154, "348th value should be 154"); +assertEq(view[349], 255, "349th value should be 255"); +assertEq(view[350], 101, "350th value should be 101"); +assertEq(view[351], 255, "351th value should be 255"); +assertEq(view[352], 128, "352th value should be 128"); +assertEq(view[353], 127, "353th value should be 127"); +assertEq(view[354], 127, "354th value should be 127"); +assertEq(view[355], 255, "355th value should be 255"); +assertEq(view[356], 52, "356th value should be 52"); +assertEq(view[357], 255, "357th value should be 255"); +assertEq(view[358], 203, "358th value should be 203"); +assertEq(view[359], 255, "359th value should be 255"); +assertEq(view[360], 0, "360th value should be 0"); +assertEq(view[361], 0, "361th value should be 0"); +assertEq(view[362], 0, "362th value should be 0"); +assertEq(view[363], 255, "363th value should be 255"); +assertEq(view[364], 0, "364th value should be 0"); +assertEq(view[365], 0, "365th value should be 0"); +assertEq(view[366], 0, "366th value should be 0"); +assertEq(view[367], 255, "367th value should be 255"); +assertEq(view[368], 0, "368th value should be 0"); +assertEq(view[369], 0, "369th value should be 0"); +assertEq(view[370], 0, "370th value should be 0"); +assertEq(view[371], 255, "371th value should be 255"); +assertEq(view[372], 0, "372th value should be 0"); +assertEq(view[373], 0, "373th value should be 0"); +assertEq(view[374], 0, "374th value should be 0"); +assertEq(view[375], 255, "375th value should be 255"); +assertEq(view[376], 0, "376th value should be 0"); +assertEq(view[377], 0, "377th value should be 0"); +assertEq(view[378], 0, "378th value should be 0"); +assertEq(view[379], 255, "379th value should be 255"); +assertEq(view[380], 0, "380th value should be 0"); +assertEq(view[381], 0, "381th value should be 0"); +assertEq(view[382], 0, "382th value should be 0"); +assertEq(view[383], 255, "383th value should be 255"); +assertEq(view[384], 52, "384th value should be 52"); +assertEq(view[385], 255, "385th value should be 255"); +assertEq(view[386], 203, "386th value should be 203"); +assertEq(view[387], 255, "387th value should be 255"); +assertEq(view[388], 179, "388th value should be 179"); +assertEq(view[389], 127, "389th value should be 127"); +assertEq(view[390], 76, "390th value should be 76"); +assertEq(view[391], 255, "391th value should be 255"); +assertEq(view[392], 205, "392th value should be 205"); +assertEq(view[393], 255, "393th value should be 255"); +assertEq(view[394], 50, "394th value should be 50"); +assertEq(view[395], 255, "395th value should be 255"); +assertEq(view[396], 205, "396th value should be 205"); +assertEq(view[397], 255, "397th value should be 255"); +assertEq(view[398], 50, "398th value should be 50"); +assertEq(view[399], 255, "399th value should be 255"); +assertEq(view[400], 205, "400th value should be 205"); +assertEq(view[401], 255, "401th value should be 255"); +assertEq(view[402], 50, "402th value should be 50"); +assertEq(view[403], 255, "403th value should be 255"); +assertEq(view[404], 205, "404th value should be 205"); +assertEq(view[405], 255, "405th value should be 255"); +assertEq(view[406], 50, "406th value should be 50"); +assertEq(view[407], 255, "407th value should be 255"); +assertEq(view[408], 205, "408th value should be 205"); +assertEq(view[409], 255, "409th value should be 255"); +assertEq(view[410], 50, "410th value should be 50"); +assertEq(view[411], 255, "411th value should be 255"); +assertEq(view[412], 205, "412th value should be 205"); +assertEq(view[413], 255, "413th value should be 255"); +assertEq(view[414], 50, "414th value should be 50"); +assertEq(view[415], 255, "415th value should be 255"); +assertEq(view[416], 154, "416th value should be 154"); +assertEq(view[417], 255, "417th value should be 255"); +assertEq(view[418], 101, "418th value should be 101"); +assertEq(view[419], 255, "419th value should be 255"); +assertEq(view[420], 128, "420th value should be 128"); +assertEq(view[421], 127, "421th value should be 127"); +assertEq(view[422], 127, "422th value should be 127"); +assertEq(view[423], 255, "423th value should be 255"); +assertEq(view[424], 154, "424th value should be 154"); +assertEq(view[425], 255, "425th value should be 255"); +assertEq(view[426], 101, "426th value should be 101"); +assertEq(view[427], 255, "427th value should be 255"); +assertEq(view[428], 128, "428th value should be 128"); +assertEq(view[429], 127, "429th value should be 127"); +assertEq(view[430], 127, "430th value should be 127"); +assertEq(view[431], 255, "431th value should be 255"); +assertEq(view[432], 103, "432th value should be 103"); +assertEq(view[433], 255, "433th value should be 255"); +assertEq(view[434], 152, "434th value should be 152"); +assertEq(view[435], 255, "435th value should be 255"); +assertEq(view[436], 0, "436th value should be 0"); +assertEq(view[437], 0, "437th value should be 0"); +assertEq(view[438], 0, "438th value should be 0"); +assertEq(view[439], 255, "439th value should be 255"); +assertEq(view[440], 0, "440th value should be 0"); +assertEq(view[441], 0, "441th value should be 0"); +assertEq(view[442], 0, "442th value should be 0"); +assertEq(view[443], 255, "443th value should be 255"); +assertEq(view[444], 0, "444th value should be 0"); +assertEq(view[445], 0, "445th value should be 0"); +assertEq(view[446], 0, "446th value should be 0"); +assertEq(view[447], 255, "447th value should be 255"); +assertEq(view[448], 0, "448th value should be 0"); +assertEq(view[449], 0, "449th value should be 0"); +assertEq(view[450], 0, "450th value should be 0"); +assertEq(view[451], 255, "451th value should be 255"); +assertEq(view[452], 0, "452th value should be 0"); +assertEq(view[453], 0, "453th value should be 0"); +assertEq(view[454], 0, "454th value should be 0"); +assertEq(view[455], 255, "455th value should be 255"); +assertEq(view[456], 0, "456th value should be 0"); +assertEq(view[457], 0, "457th value should be 0"); +assertEq(view[458], 0, "458th value should be 0"); +assertEq(view[459], 255, "459th value should be 255"); +assertEq(view[460], 0, "460th value should be 0"); +assertEq(view[461], 0, "461th value should be 0"); +assertEq(view[462], 0, "462th value should be 0"); +assertEq(view[463], 255, "463th value should be 255"); +assertEq(view[464], 78, "464th value should be 78"); +assertEq(view[465], 127, "465th value should be 127"); +assertEq(view[466], 178, "466th value should be 178"); +assertEq(view[467], 255, "467th value should be 255"); +assertEq(view[468], 154, "468th value should be 154"); +assertEq(view[469], 255, "469th value should be 255"); +assertEq(view[470], 101, "470th value should be 101"); +assertEq(view[471], 255, "471th value should be 255"); +assertEq(view[472], 205, "472th value should be 205"); +assertEq(view[473], 255, "473th value should be 255"); +assertEq(view[474], 50, "474th value should be 50"); +assertEq(view[475], 255, "475th value should be 255"); +assertEq(view[476], 205, "476th value should be 205"); +assertEq(view[477], 255, "477th value should be 255"); +assertEq(view[478], 50, "478th value should be 50"); +assertEq(view[479], 255, "479th value should be 255"); +assertEq(view[480], 205, "480th value should be 205"); +assertEq(view[481], 255, "481th value should be 255"); +assertEq(view[482], 50, "482th value should be 50"); +assertEq(view[483], 255, "483th value should be 255"); +assertEq(view[484], 205, "484th value should be 205"); +assertEq(view[485], 255, "485th value should be 255"); +assertEq(view[486], 50, "486th value should be 50"); +assertEq(view[487], 255, "487th value should be 255"); +assertEq(view[488], 179, "488th value should be 179"); +assertEq(view[489], 127, "489th value should be 127"); +assertEq(view[490], 76, "490th value should be 76"); +assertEq(view[491], 255, "491th value should be 255"); +assertEq(view[492], 179, "492th value should be 179"); +assertEq(view[493], 127, "493th value should be 127"); +assertEq(view[494], 76, "494th value should be 76"); +assertEq(view[495], 255, "495th value should be 255"); +assertEq(view[496], 128, "496th value should be 128"); +assertEq(view[497], 127, "497th value should be 127"); +assertEq(view[498], 127, "498th value should be 127"); +assertEq(view[499], 255, "499th value should be 255"); +assertEq(view[500], 52, "500th value should be 52"); +assertEq(view[501], 255, "501th value should be 255"); +assertEq(view[502], 203, "502th value should be 203"); +assertEq(view[503], 255, "503th value should be 255"); +assertEq(view[504], 0, "504th value should be 0"); +assertEq(view[505], 0, "505th value should be 0"); +assertEq(view[506], 0, "506th value should be 0"); +assertEq(view[507], 255, "507th value should be 255"); +assertEq(view[508], 78, "508th value should be 78"); +assertEq(view[509], 127, "509th value should be 127"); +assertEq(view[510], 178, "510th value should be 178"); +assertEq(view[511], 255, "511th value should be 255"); +assertEq(view[512], 52, "512th value should be 52"); +assertEq(view[513], 255, "513th value should be 255"); +assertEq(view[514], 203, "514th value should be 203"); +assertEq(view[515], 255, "515th value should be 255"); +assertEq(view[516], 0, "516th value should be 0"); +assertEq(view[517], 0, "517th value should be 0"); +assertEq(view[518], 0, "518th value should be 0"); +assertEq(view[519], 255, "519th value should be 255"); +assertEq(view[520], 0, "520th value should be 0"); +assertEq(view[521], 0, "521th value should be 0"); +assertEq(view[522], 0, "522th value should be 0"); +assertEq(view[523], 255, "523th value should be 255"); +assertEq(view[524], 0, "524th value should be 0"); +assertEq(view[525], 0, "525th value should be 0"); +assertEq(view[526], 0, "526th value should be 0"); +assertEq(view[527], 255, "527th value should be 255"); +assertEq(view[528], 0, "528th value should be 0"); +assertEq(view[529], 0, "529th value should be 0"); +assertEq(view[530], 0, "530th value should be 0"); +assertEq(view[531], 255, "531th value should be 255"); +assertEq(view[532], 0, "532th value should be 0"); +assertEq(view[533], 0, "533th value should be 0"); +assertEq(view[534], 0, "534th value should be 0"); +assertEq(view[535], 255, "535th value should be 255"); +assertEq(view[536], 0, "536th value should be 0"); +assertEq(view[537], 0, "537th value should be 0"); +assertEq(view[538], 0, "538th value should be 0"); +assertEq(view[539], 255, "539th value should be 255"); +assertEq(view[540], 0, "540th value should be 0"); +assertEq(view[541], 0, "541th value should be 0"); +assertEq(view[542], 0, "542th value should be 0"); +assertEq(view[543], 255, "543th value should be 255"); +assertEq(view[544], 0, "544th value should be 0"); +assertEq(view[545], 0, "545th value should be 0"); +assertEq(view[546], 0, "546th value should be 0"); +assertEq(view[547], 255, "547th value should be 255"); +assertEq(view[548], 154, "548th value should be 154"); +assertEq(view[549], 255, "549th value should be 255"); +assertEq(view[550], 101, "550th value should be 101"); +assertEq(view[551], 255, "551th value should be 255"); +assertEq(view[552], 205, "552th value should be 205"); +assertEq(view[553], 255, "553th value should be 255"); +assertEq(view[554], 50, "554th value should be 50"); +assertEq(view[555], 255, "555th value should be 255"); +assertEq(view[556], 205, "556th value should be 205"); +assertEq(view[557], 255, "557th value should be 255"); +assertEq(view[558], 50, "558th value should be 50"); +assertEq(view[559], 255, "559th value should be 255"); +assertEq(view[560], 205, "560th value should be 205"); +assertEq(view[561], 255, "561th value should be 255"); +assertEq(view[562], 50, "562th value should be 50"); +assertEq(view[563], 255, "563th value should be 255"); +assertEq(view[564], 179, "564th value should be 179"); +assertEq(view[565], 127, "565th value should be 127"); +assertEq(view[566], 76, "566th value should be 76"); +assertEq(view[567], 255, "567th value should be 255"); +assertEq(view[568], 179, "568th value should be 179"); +assertEq(view[569], 127, "569th value should be 127"); +assertEq(view[570], 76, "570th value should be 76"); +assertEq(view[571], 255, "571th value should be 255"); +assertEq(view[572], 154, "572th value should be 154"); +assertEq(view[573], 255, "573th value should be 255"); +assertEq(view[574], 101, "574th value should be 101"); +assertEq(view[575], 255, "575th value should be 255"); +assertEq(view[576], 103, "576th value should be 103"); +assertEq(view[577], 255, "577th value should be 255"); +assertEq(view[578], 152, "578th value should be 152"); +assertEq(view[579], 255, "579th value should be 255"); +assertEq(view[580], 0, "580th value should be 0"); +assertEq(view[581], 0, "581th value should be 0"); +assertEq(view[582], 0, "582th value should be 0"); +assertEq(view[583], 255, "583th value should be 255"); +assertEq(view[584], 0, "584th value should be 0"); +assertEq(view[585], 0, "585th value should be 0"); +assertEq(view[586], 0, "586th value should be 0"); +assertEq(view[587], 255, "587th value should be 255"); +assertEq(view[588], 0, "588th value should be 0"); +assertEq(view[589], 0, "589th value should be 0"); +assertEq(view[590], 0, "590th value should be 0"); +assertEq(view[591], 255, "591th value should be 255"); +assertEq(view[592], 0, "592th value should be 0"); +assertEq(view[593], 0, "593th value should be 0"); +assertEq(view[594], 0, "594th value should be 0"); +assertEq(view[595], 255, "595th value should be 255"); +assertEq(view[596], 0, "596th value should be 0"); +assertEq(view[597], 0, "597th value should be 0"); +assertEq(view[598], 0, "598th value should be 0"); +assertEq(view[599], 255, "599th value should be 255"); +assertEq(view[600], 0, "600th value should be 0"); +assertEq(view[601], 0, "601th value should be 0"); +assertEq(view[602], 0, "602th value should be 0"); +assertEq(view[603], 255, "603th value should be 255"); +assertEq(view[604], 0, "604th value should be 0"); +assertEq(view[605], 0, "605th value should be 0"); +assertEq(view[606], 0, "606th value should be 0"); +assertEq(view[607], 255, "607th value should be 255"); +assertEq(view[608], 0, "608th value should be 0"); +assertEq(view[609], 0, "609th value should be 0"); +assertEq(view[610], 0, "610th value should be 0"); +assertEq(view[611], 255, "611th value should be 255"); +assertEq(view[612], 0, "612th value should be 0"); +assertEq(view[613], 0, "613th value should be 0"); +assertEq(view[614], 0, "614th value should be 0"); +assertEq(view[615], 255, "615th value should be 255"); +assertEq(view[616], 0, "616th value should be 0"); +assertEq(view[617], 0, "617th value should be 0"); +assertEq(view[618], 0, "618th value should be 0"); +assertEq(view[619], 255, "619th value should be 255"); +assertEq(view[620], 0, "620th value should be 0"); +assertEq(view[621], 0, "621th value should be 0"); +assertEq(view[622], 0, "622th value should be 0"); +assertEq(view[623], 255, "623th value should be 255"); +assertEq(view[624], 0, "624th value should be 0"); +assertEq(view[625], 0, "625th value should be 0"); +assertEq(view[626], 0, "626th value should be 0"); +assertEq(view[627], 255, "627th value should be 255"); +assertEq(view[628], 154, "628th value should be 154"); +assertEq(view[629], 255, "629th value should be 255"); +assertEq(view[630], 101, "630th value should be 101"); +assertEq(view[631], 255, "631th value should be 255"); +assertEq(view[632], 205, "632th value should be 205"); +assertEq(view[633], 255, "633th value should be 255"); +assertEq(view[634], 50, "634th value should be 50"); +assertEq(view[635], 255, "635th value should be 255"); +assertEq(view[636], 205, "636th value should be 205"); +assertEq(view[637], 255, "637th value should be 255"); +assertEq(view[638], 50, "638th value should be 50"); +assertEq(view[639], 255, "639th value should be 255"); +assertEq(view[640], 179, "640th value should be 179"); +assertEq(view[641], 127, "641th value should be 127"); +assertEq(view[642], 76, "642th value should be 76"); +assertEq(view[643], 255, "643th value should be 255"); +assertEq(view[644], 179, "644th value should be 179"); +assertEq(view[645], 127, "645th value should be 127"); +assertEq(view[646], 76, "646th value should be 76"); +assertEq(view[647], 255, "647th value should be 255"); +assertEq(view[648], 154, "648th value should be 154"); +assertEq(view[649], 255, "649th value should be 255"); +assertEq(view[650], 101, "650th value should be 101"); +assertEq(view[651], 255, "651th value should be 255"); +assertEq(view[652], 128, "652th value should be 128"); +assertEq(view[653], 127, "653th value should be 127"); +assertEq(view[654], 127, "654th value should be 127"); +assertEq(view[655], 255, "655th value should be 255"); +assertEq(view[656], 52, "656th value should be 52"); +assertEq(view[657], 255, "657th value should be 255"); +assertEq(view[658], 203, "658th value should be 203"); +assertEq(view[659], 255, "659th value should be 255"); +assertEq(view[660], 0, "660th value should be 0"); +assertEq(view[661], 0, "661th value should be 0"); +assertEq(view[662], 0, "662th value should be 0"); +assertEq(view[663], 255, "663th value should be 255"); +assertEq(view[664], 0, "664th value should be 0"); +assertEq(view[665], 0, "665th value should be 0"); +assertEq(view[666], 0, "666th value should be 0"); +assertEq(view[667], 255, "667th value should be 255"); +assertEq(view[668], 0, "668th value should be 0"); +assertEq(view[669], 0, "669th value should be 0"); +assertEq(view[670], 0, "670th value should be 0"); +assertEq(view[671], 255, "671th value should be 255"); +assertEq(view[672], 0, "672th value should be 0"); +assertEq(view[673], 0, "673th value should be 0"); +assertEq(view[674], 0, "674th value should be 0"); +assertEq(view[675], 255, "675th value should be 255"); +assertEq(view[676], 0, "676th value should be 0"); +assertEq(view[677], 0, "677th value should be 0"); +assertEq(view[678], 0, "678th value should be 0"); +assertEq(view[679], 255, "679th value should be 255"); +assertEq(view[680], 0, "680th value should be 0"); +assertEq(view[681], 0, "681th value should be 0"); +assertEq(view[682], 0, "682th value should be 0"); +assertEq(view[683], 255, "683th value should be 255"); +assertEq(view[684], 0, "684th value should be 0"); +assertEq(view[685], 0, "685th value should be 0"); +assertEq(view[686], 0, "686th value should be 0"); +assertEq(view[687], 255, "687th value should be 255"); +assertEq(view[688], 0, "688th value should be 0"); +assertEq(view[689], 0, "689th value should be 0"); +assertEq(view[690], 0, "690th value should be 0"); +assertEq(view[691], 255, "691th value should be 255"); +assertEq(view[692], 0, "692th value should be 0"); +assertEq(view[693], 0, "693th value should be 0"); +assertEq(view[694], 0, "694th value should be 0"); +assertEq(view[695], 255, "695th value should be 255"); +assertEq(view[696], 0, "696th value should be 0"); +assertEq(view[697], 0, "697th value should be 0"); +assertEq(view[698], 0, "698th value should be 0"); +assertEq(view[699], 255, "699th value should be 255"); +assertEq(view[700], 0, "700th value should be 0"); +assertEq(view[701], 0, "701th value should be 0"); +assertEq(view[702], 0, "702th value should be 0"); +assertEq(view[703], 255, "703th value should be 255"); +assertEq(view[704], 0, "704th value should be 0"); +assertEq(view[705], 0, "705th value should be 0"); +assertEq(view[706], 0, "706th value should be 0"); +assertEq(view[707], 255, "707th value should be 255"); +assertEq(view[708], 154, "708th value should be 154"); +assertEq(view[709], 255, "709th value should be 255"); +assertEq(view[710], 101, "710th value should be 101"); +assertEq(view[711], 255, "711th value should be 255"); +assertEq(view[712], 179, "712th value should be 179"); +assertEq(view[713], 127, "713th value should be 127"); +assertEq(view[714], 76, "714th value should be 76"); +assertEq(view[715], 255, "715th value should be 255"); +assertEq(view[716], 205, "716th value should be 205"); +assertEq(view[717], 255, "717th value should be 255"); +assertEq(view[718], 50, "718th value should be 50"); +assertEq(view[719], 255, "719th value should be 255"); +assertEq(view[720], 154, "720th value should be 154"); +assertEq(view[721], 255, "721th value should be 255"); +assertEq(view[722], 101, "722th value should be 101"); +assertEq(view[723], 255, "723th value should be 255"); +assertEq(view[724], 52, "724th value should be 52"); +assertEq(view[725], 255, "725th value should be 255"); +assertEq(view[726], 203, "726th value should be 203"); +assertEq(view[727], 255, "727th value should be 255"); +assertEq(view[728], 128, "728th value should be 128"); +assertEq(view[729], 127, "729th value should be 127"); +assertEq(view[730], 127, "730th value should be 127"); +assertEq(view[731], 255, "731th value should be 255"); +assertEq(view[732], 78, "732th value should be 78"); +assertEq(view[733], 127, "733th value should be 127"); +assertEq(view[734], 178, "734th value should be 178"); +assertEq(view[735], 255, "735th value should be 255"); +assertEq(view[736], 0, "736th value should be 0"); +assertEq(view[737], 0, "737th value should be 0"); +assertEq(view[738], 0, "738th value should be 0"); +assertEq(view[739], 255, "739th value should be 255"); +assertEq(view[740], 0, "740th value should be 0"); +assertEq(view[741], 0, "741th value should be 0"); +assertEq(view[742], 0, "742th value should be 0"); +assertEq(view[743], 255, "743th value should be 255"); +assertEq(view[744], 0, "744th value should be 0"); +assertEq(view[745], 0, "745th value should be 0"); +assertEq(view[746], 0, "746th value should be 0"); +assertEq(view[747], 255, "747th value should be 255"); +assertEq(view[748], 0, "748th value should be 0"); +assertEq(view[749], 0, "749th value should be 0"); +assertEq(view[750], 0, "750th value should be 0"); +assertEq(view[751], 255, "751th value should be 255"); +assertEq(view[752], 0, "752th value should be 0"); +assertEq(view[753], 0, "753th value should be 0"); +assertEq(view[754], 0, "754th value should be 0"); +assertEq(view[755], 255, "755th value should be 255"); +assertEq(view[756], 0, "756th value should be 0"); +assertEq(view[757], 0, "757th value should be 0"); +assertEq(view[758], 0, "758th value should be 0"); +assertEq(view[759], 255, "759th value should be 255"); +assertEq(view[760], 0, "760th value should be 0"); +assertEq(view[761], 0, "761th value should be 0"); +assertEq(view[762], 0, "762th value should be 0"); +assertEq(view[763], 255, "763th value should be 255"); +assertEq(view[764], 0, "764th value should be 0"); +assertEq(view[765], 0, "765th value should be 0"); +assertEq(view[766], 0, "766th value should be 0"); +assertEq(view[767], 255, "767th value should be 255"); +assertEq(view[768], 0, "768th value should be 0"); +assertEq(view[769], 0, "769th value should be 0"); +assertEq(view[770], 0, "770th value should be 0"); +assertEq(view[771], 255, "771th value should be 255"); +assertEq(view[772], 0, "772th value should be 0"); +assertEq(view[773], 0, "773th value should be 0"); +assertEq(view[774], 0, "774th value should be 0"); +assertEq(view[775], 255, "775th value should be 255"); +assertEq(view[776], 0, "776th value should be 0"); +assertEq(view[777], 0, "777th value should be 0"); +assertEq(view[778], 0, "778th value should be 0"); +assertEq(view[779], 255, "779th value should be 255"); +assertEq(view[780], 0, "780th value should be 0"); +assertEq(view[781], 0, "781th value should be 0"); +assertEq(view[782], 0, "782th value should be 0"); +assertEq(view[783], 255, "783th value should be 255"); +assertEq(view[784], 78, "784th value should be 78"); +assertEq(view[785], 127, "785th value should be 127"); +assertEq(view[786], 178, "786th value should be 178"); +assertEq(view[787], 255, "787th value should be 255"); +assertEq(view[788], 154, "788th value should be 154"); +assertEq(view[789], 255, "789th value should be 255"); +assertEq(view[790], 101, "790th value should be 101"); +assertEq(view[791], 255, "791th value should be 255"); +assertEq(view[792], 179, "792th value should be 179"); +assertEq(view[793], 127, "793th value should be 127"); +assertEq(view[794], 76, "794th value should be 76"); +assertEq(view[795], 255, "795th value should be 255"); +assertEq(view[796], 205, "796th value should be 205"); +assertEq(view[797], 255, "797th value should be 255"); +assertEq(view[798], 50, "798th value should be 50"); +assertEq(view[799], 255, "799th value should be 255"); +assertEq(view[800], 128, "800th value should be 128"); +assertEq(view[801], 127, "801th value should be 127"); +assertEq(view[802], 127, "802th value should be 127"); +assertEq(view[803], 255, "803th value should be 255"); +assertEq(view[804], 0, "804th value should be 0"); +assertEq(view[805], 0, "805th value should be 0"); +assertEq(view[806], 0, "806th value should be 0"); +assertEq(view[807], 255, "807th value should be 255"); +assertEq(view[808], 26, "808th value should be 26"); +assertEq(view[809], 127, "809th value should be 127"); +assertEq(view[810], 229, "810th value should be 229"); +assertEq(view[811], 255, "811th value should be 255"); +assertEq(view[812], 0, "812th value should be 0"); +assertEq(view[813], 0, "813th value should be 0"); +assertEq(view[814], 0, "814th value should be 0"); +assertEq(view[815], 255, "815th value should be 255"); +assertEq(view[816], 0, "816th value should be 0"); +assertEq(view[817], 0, "817th value should be 0"); +assertEq(view[818], 0, "818th value should be 0"); +assertEq(view[819], 255, "819th value should be 255"); +assertEq(view[820], 0, "820th value should be 0"); +assertEq(view[821], 0, "821th value should be 0"); +assertEq(view[822], 0, "822th value should be 0"); +assertEq(view[823], 255, "823th value should be 255"); +assertEq(view[824], 0, "824th value should be 0"); +assertEq(view[825], 0, "825th value should be 0"); +assertEq(view[826], 0, "826th value should be 0"); +assertEq(view[827], 255, "827th value should be 255"); +assertEq(view[828], 0, "828th value should be 0"); +assertEq(view[829], 0, "829th value should be 0"); +assertEq(view[830], 0, "830th value should be 0"); +assertEq(view[831], 255, "831th value should be 255"); +assertEq(view[832], 0, "832th value should be 0"); +assertEq(view[833], 0, "833th value should be 0"); +assertEq(view[834], 0, "834th value should be 0"); +assertEq(view[835], 255, "835th value should be 255"); +assertEq(view[836], 0, "836th value should be 0"); +assertEq(view[837], 0, "837th value should be 0"); +assertEq(view[838], 0, "838th value should be 0"); +assertEq(view[839], 255, "839th value should be 255"); +assertEq(view[840], 0, "840th value should be 0"); +assertEq(view[841], 0, "841th value should be 0"); +assertEq(view[842], 0, "842th value should be 0"); +assertEq(view[843], 255, "843th value should be 255"); +assertEq(view[844], 0, "844th value should be 0"); +assertEq(view[845], 0, "845th value should be 0"); +assertEq(view[846], 0, "846th value should be 0"); +assertEq(view[847], 255, "847th value should be 255"); +assertEq(view[848], 0, "848th value should be 0"); +assertEq(view[849], 0, "849th value should be 0"); +assertEq(view[850], 0, "850th value should be 0"); +assertEq(view[851], 255, "851th value should be 255"); +assertEq(view[852], 0, "852th value should be 0"); +assertEq(view[853], 0, "853th value should be 0"); +assertEq(view[854], 0, "854th value should be 0"); +assertEq(view[855], 255, "855th value should be 255"); +assertEq(view[856], 0, "856th value should be 0"); +assertEq(view[857], 0, "857th value should be 0"); +assertEq(view[858], 0, "858th value should be 0"); +assertEq(view[859], 255, "859th value should be 255"); +assertEq(view[860], 0, "860th value should be 0"); +assertEq(view[861], 0, "861th value should be 0"); +assertEq(view[862], 0, "862th value should be 0"); +assertEq(view[863], 255, "863th value should be 255"); +assertEq(view[864], 103, "864th value should be 103"); +assertEq(view[865], 255, "865th value should be 255"); +assertEq(view[866], 152, "866th value should be 152"); +assertEq(view[867], 255, "867th value should be 255"); +assertEq(view[868], 154, "868th value should be 154"); +assertEq(view[869], 255, "869th value should be 255"); +assertEq(view[870], 101, "870th value should be 101"); +assertEq(view[871], 255, "871th value should be 255"); +assertEq(view[872], 179, "872th value should be 179"); +assertEq(view[873], 127, "873th value should be 127"); +assertEq(view[874], 76, "874th value should be 76"); +assertEq(view[875], 255, "875th value should be 255"); +assertEq(view[876], 205, "876th value should be 205"); +assertEq(view[877], 255, "877th value should be 255"); +assertEq(view[878], 50, "878th value should be 50"); +assertEq(view[879], 255, "879th value should be 255"); +assertEq(view[880], 179, "880th value should be 179"); +assertEq(view[881], 127, "881th value should be 127"); +assertEq(view[882], 76, "882th value should be 76"); +assertEq(view[883], 255, "883th value should be 255"); +assertEq(view[884], 179, "884th value should be 179"); +assertEq(view[885], 127, "885th value should be 127"); +assertEq(view[886], 76, "886th value should be 76"); +assertEq(view[887], 255, "887th value should be 255"); +assertEq(view[888], 128, "888th value should be 128"); +assertEq(view[889], 127, "889th value should be 127"); +assertEq(view[890], 127, "890th value should be 127"); +assertEq(view[891], 255, "891th value should be 255"); +assertEq(view[892], 103, "892th value should be 103"); +assertEq(view[893], 255, "893th value should be 255"); +assertEq(view[894], 152, "894th value should be 152"); +assertEq(view[895], 255, "895th value should be 255"); +assertEq(view[896], 26, "896th value should be 26"); +assertEq(view[897], 127, "897th value should be 127"); +assertEq(view[898], 229, "898th value should be 229"); +assertEq(view[899], 255, "899th value should be 255"); +assertEq(view[900], 0, "900th value should be 0"); +assertEq(view[901], 0, "901th value should be 0"); +assertEq(view[902], 0, "902th value should be 0"); +assertEq(view[903], 255, "903th value should be 255"); +assertEq(view[904], 0, "904th value should be 0"); +assertEq(view[905], 0, "905th value should be 0"); +assertEq(view[906], 0, "906th value should be 0"); +assertEq(view[907], 255, "907th value should be 255"); +assertEq(view[908], 0, "908th value should be 0"); +assertEq(view[909], 0, "909th value should be 0"); +assertEq(view[910], 0, "910th value should be 0"); +assertEq(view[911], 255, "911th value should be 255"); +assertEq(view[912], 0, "912th value should be 0"); +assertEq(view[913], 0, "913th value should be 0"); +assertEq(view[914], 0, "914th value should be 0"); +assertEq(view[915], 255, "915th value should be 255"); +assertEq(view[916], 0, "916th value should be 0"); +assertEq(view[917], 0, "917th value should be 0"); +assertEq(view[918], 0, "918th value should be 0"); +assertEq(view[919], 255, "919th value should be 255"); +assertEq(view[920], 0, "920th value should be 0"); +assertEq(view[921], 0, "921th value should be 0"); +assertEq(view[922], 0, "922th value should be 0"); +assertEq(view[923], 255, "923th value should be 255"); +assertEq(view[924], 0, "924th value should be 0"); +assertEq(view[925], 0, "925th value should be 0"); +assertEq(view[926], 0, "926th value should be 0"); +assertEq(view[927], 255, "927th value should be 255"); +assertEq(view[928], 0, "928th value should be 0"); +assertEq(view[929], 0, "929th value should be 0"); +assertEq(view[930], 0, "930th value should be 0"); +assertEq(view[931], 255, "931th value should be 255"); +assertEq(view[932], 0, "932th value should be 0"); +assertEq(view[933], 0, "933th value should be 0"); +assertEq(view[934], 0, "934th value should be 0"); +assertEq(view[935], 255, "935th value should be 255"); +assertEq(view[936], 0, "936th value should be 0"); +assertEq(view[937], 0, "937th value should be 0"); +assertEq(view[938], 0, "938th value should be 0"); +assertEq(view[939], 255, "939th value should be 255"); +assertEq(view[940], 0, "940th value should be 0"); +assertEq(view[941], 0, "941th value should be 0"); +assertEq(view[942], 0, "942th value should be 0"); +assertEq(view[943], 255, "943th value should be 255"); +assertEq(view[944], 0, "944th value should be 0"); +assertEq(view[945], 0, "945th value should be 0"); +assertEq(view[946], 0, "946th value should be 0"); +assertEq(view[947], 255, "947th value should be 255"); +assertEq(view[948], 154, "948th value should be 154"); +assertEq(view[949], 255, "949th value should be 255"); +assertEq(view[950], 101, "950th value should be 101"); +assertEq(view[951], 255, "951th value should be 255"); +assertEq(view[952], 179, "952th value should be 179"); +assertEq(view[953], 127, "953th value should be 127"); +assertEq(view[954], 76, "954th value should be 76"); +assertEq(view[955], 255, "955th value should be 255"); +assertEq(view[956], 205, "956th value should be 205"); +assertEq(view[957], 255, "957th value should be 255"); +assertEq(view[958], 50, "958th value should be 50"); +assertEq(view[959], 255, "959th value should be 255"); +assertEq(view[960], 179, "960th value should be 179"); +assertEq(view[961], 127, "961th value should be 127"); +assertEq(view[962], 76, "962th value should be 76"); +assertEq(view[963], 255, "963th value should be 255"); +assertEq(view[964], 179, "964th value should be 179"); +assertEq(view[965], 127, "965th value should be 127"); +assertEq(view[966], 76, "966th value should be 76"); +assertEq(view[967], 255, "967th value should be 255"); +assertEq(view[968], 179, "968th value should be 179"); +assertEq(view[969], 127, "969th value should be 127"); +assertEq(view[970], 76, "970th value should be 76"); +assertEq(view[971], 255, "971th value should be 255"); +assertEq(view[972], 154, "972th value should be 154"); +assertEq(view[973], 255, "973th value should be 255"); +assertEq(view[974], 101, "974th value should be 101"); +assertEq(view[975], 255, "975th value should be 255"); +assertEq(view[976], 103, "976th value should be 103"); +assertEq(view[977], 255, "977th value should be 255"); +assertEq(view[978], 152, "978th value should be 152"); +assertEq(view[979], 255, "979th value should be 255"); +assertEq(view[980], 0, "980th value should be 0"); +assertEq(view[981], 0, "981th value should be 0"); +assertEq(view[982], 0, "982th value should be 0"); +assertEq(view[983], 255, "983th value should be 255"); +assertEq(view[984], 0, "984th value should be 0"); +assertEq(view[985], 0, "985th value should be 0"); +assertEq(view[986], 0, "986th value should be 0"); +assertEq(view[987], 255, "987th value should be 255"); +assertEq(view[988], 0, "988th value should be 0"); +assertEq(view[989], 0, "989th value should be 0"); +assertEq(view[990], 0, "990th value should be 0"); +assertEq(view[991], 255, "991th value should be 255"); +assertEq(view[992], 0, "992th value should be 0"); +assertEq(view[993], 0, "993th value should be 0"); +assertEq(view[994], 0, "994th value should be 0"); +assertEq(view[995], 255, "995th value should be 255"); +assertEq(view[996], 0, "996th value should be 0"); +assertEq(view[997], 0, "997th value should be 0"); +assertEq(view[998], 0, "998th value should be 0"); +assertEq(view[999], 255, "999th value should be 255"); +assertEq(view[1000], 0, "1000th value should be 0"); +assertEq(view[1001], 0, "1001th value should be 0"); +assertEq(view[1002], 0, "1002th value should be 0"); +assertEq(view[1003], 255, "1003th value should be 255"); +assertEq(view[1004], 0, "1004th value should be 0"); +assertEq(view[1005], 0, "1005th value should be 0"); +assertEq(view[1006], 0, "1006th value should be 0"); +assertEq(view[1007], 255, "1007th value should be 255"); +assertEq(view[1008], 0, "1008th value should be 0"); +assertEq(view[1009], 0, "1009th value should be 0"); +assertEq(view[1010], 0, "1010th value should be 0"); +assertEq(view[1011], 255, "1011th value should be 255"); +assertEq(view[1012], 0, "1012th value should be 0"); +assertEq(view[1013], 0, "1013th value should be 0"); +assertEq(view[1014], 0, "1014th value should be 0"); +assertEq(view[1015], 255, "1015th value should be 255"); +assertEq(view[1016], 0, "1016th value should be 0"); +assertEq(view[1017], 0, "1017th value should be 0"); +assertEq(view[1018], 0, "1018th value should be 0"); +assertEq(view[1019], 255, "1019th value should be 255"); +assertEq(view[1020], 0, "1020th value should be 0"); +assertEq(view[1021], 0, "1021th value should be 0"); +assertEq(view[1022], 0, "1022th value should be 0"); +assertEq(view[1023], 255, "1023th value should be 255"); +assertEq(view[1024], 0, "1024th value should be 0"); +assertEq(view[1025], 0, "1025th value should be 0"); +assertEq(view[1026], 0, "1026th value should be 0"); +assertEq(view[1027], 255, "1027th value should be 255"); +assertEq(view[1028], 154, "1028th value should be 154"); +assertEq(view[1029], 255, "1029th value should be 255"); +assertEq(view[1030], 101, "1030th value should be 101"); +assertEq(view[1031], 255, "1031th value should be 255"); +assertEq(view[1032], 205, "1032th value should be 205"); +assertEq(view[1033], 255, "1033th value should be 255"); +assertEq(view[1034], 50, "1034th value should be 50"); +assertEq(view[1035], 255, "1035th value should be 255"); +assertEq(view[1036], 205, "1036th value should be 205"); +assertEq(view[1037], 255, "1037th value should be 255"); +assertEq(view[1038], 50, "1038th value should be 50"); +assertEq(view[1039], 255, "1039th value should be 255"); +assertEq(view[1040], 205, "1040th value should be 205"); +assertEq(view[1041], 255, "1041th value should be 255"); +assertEq(view[1042], 50, "1042th value should be 50"); +assertEq(view[1043], 255, "1043th value should be 255"); +assertEq(view[1044], 179, "1044th value should be 179"); +assertEq(view[1045], 127, "1045th value should be 127"); +assertEq(view[1046], 76, "1046th value should be 76"); +assertEq(view[1047], 255, "1047th value should be 255"); +assertEq(view[1048], 179, "1048th value should be 179"); +assertEq(view[1049], 127, "1049th value should be 127"); +assertEq(view[1050], 76, "1050th value should be 76"); +assertEq(view[1051], 255, "1051th value should be 255"); +assertEq(view[1052], 154, "1052th value should be 154"); +assertEq(view[1053], 255, "1053th value should be 255"); +assertEq(view[1054], 101, "1054th value should be 101"); +assertEq(view[1055], 255, "1055th value should be 255"); +assertEq(view[1056], 128, "1056th value should be 128"); +assertEq(view[1057], 127, "1057th value should be 127"); +assertEq(view[1058], 127, "1058th value should be 127"); +assertEq(view[1059], 255, "1059th value should be 255"); +assertEq(view[1060], 0, "1060th value should be 0"); +assertEq(view[1061], 0, "1061th value should be 0"); +assertEq(view[1062], 0, "1062th value should be 0"); +assertEq(view[1063], 255, "1063th value should be 255"); +assertEq(view[1064], 0, "1064th value should be 0"); +assertEq(view[1065], 0, "1065th value should be 0"); +assertEq(view[1066], 0, "1066th value should be 0"); +assertEq(view[1067], 255, "1067th value should be 255"); +assertEq(view[1068], 26, "1068th value should be 26"); +assertEq(view[1069], 127, "1069th value should be 127"); +assertEq(view[1070], 229, "1070th value should be 229"); +assertEq(view[1071], 255, "1071th value should be 255"); +assertEq(view[1072], 26, "1072th value should be 26"); +assertEq(view[1073], 127, "1073th value should be 127"); +assertEq(view[1074], 229, "1074th value should be 229"); +assertEq(view[1075], 255, "1075th value should be 255"); +assertEq(view[1076], 0, "1076th value should be 0"); +assertEq(view[1077], 0, "1077th value should be 0"); +assertEq(view[1078], 0, "1078th value should be 0"); +assertEq(view[1079], 255, "1079th value should be 255"); +assertEq(view[1080], 0, "1080th value should be 0"); +assertEq(view[1081], 0, "1081th value should be 0"); +assertEq(view[1082], 0, "1082th value should be 0"); +assertEq(view[1083], 255, "1083th value should be 255"); +assertEq(view[1084], 0, "1084th value should be 0"); +assertEq(view[1085], 0, "1085th value should be 0"); +assertEq(view[1086], 0, "1086th value should be 0"); +assertEq(view[1087], 255, "1087th value should be 255"); +assertEq(view[1088], 0, "1088th value should be 0"); +assertEq(view[1089], 0, "1089th value should be 0"); +assertEq(view[1090], 0, "1090th value should be 0"); +assertEq(view[1091], 255, "1091th value should be 255"); +assertEq(view[1092], 0, "1092th value should be 0"); +assertEq(view[1093], 0, "1093th value should be 0"); +assertEq(view[1094], 0, "1094th value should be 0"); +assertEq(view[1095], 255, "1095th value should be 255"); +assertEq(view[1096], 0, "1096th value should be 0"); +assertEq(view[1097], 0, "1097th value should be 0"); +assertEq(view[1098], 0, "1098th value should be 0"); +assertEq(view[1099], 255, "1099th value should be 255"); +assertEq(view[1100], 0, "1100th value should be 0"); +assertEq(view[1101], 0, "1101th value should be 0"); +assertEq(view[1102], 0, "1102th value should be 0"); +assertEq(view[1103], 255, "1103th value should be 255"); +assertEq(view[1104], 0, "1104th value should be 0"); +assertEq(view[1105], 0, "1105th value should be 0"); +assertEq(view[1106], 0, "1106th value should be 0"); +assertEq(view[1107], 255, "1107th value should be 255"); +assertEq(view[1108], 154, "1108th value should be 154"); +assertEq(view[1109], 255, "1109th value should be 255"); +assertEq(view[1110], 101, "1110th value should be 101"); +assertEq(view[1111], 255, "1111th value should be 255"); +assertEq(view[1112], 205, "1112th value should be 205"); +assertEq(view[1113], 255, "1113th value should be 255"); +assertEq(view[1114], 50, "1114th value should be 50"); +assertEq(view[1115], 255, "1115th value should be 255"); +assertEq(view[1116], 205, "1116th value should be 205"); +assertEq(view[1117], 255, "1117th value should be 255"); +assertEq(view[1118], 50, "1118th value should be 50"); +assertEq(view[1119], 255, "1119th value should be 255"); +assertEq(view[1120], 205, "1120th value should be 205"); +assertEq(view[1121], 255, "1121th value should be 255"); +assertEq(view[1122], 50, "1122th value should be 50"); +assertEq(view[1123], 255, "1123th value should be 255"); +assertEq(view[1124], 205, "1124th value should be 205"); +assertEq(view[1125], 255, "1125th value should be 255"); +assertEq(view[1126], 50, "1126th value should be 50"); +assertEq(view[1127], 255, "1127th value should be 255"); +assertEq(view[1128], 205, "1128th value should be 205"); +assertEq(view[1129], 255, "1129th value should be 255"); +assertEq(view[1130], 50, "1130th value should be 50"); +assertEq(view[1131], 255, "1131th value should be 255"); +assertEq(view[1132], 179, "1132th value should be 179"); +assertEq(view[1133], 127, "1133th value should be 127"); +assertEq(view[1134], 76, "1134th value should be 76"); +assertEq(view[1135], 255, "1135th value should be 255"); +assertEq(view[1136], 154, "1136th value should be 154"); +assertEq(view[1137], 255, "1137th value should be 255"); +assertEq(view[1138], 101, "1138th value should be 101"); +assertEq(view[1139], 255, "1139th value should be 255"); +assertEq(view[1140], 128, "1140th value should be 128"); +assertEq(view[1141], 127, "1141th value should be 127"); +assertEq(view[1142], 127, "1142th value should be 127"); +assertEq(view[1143], 255, "1143th value should be 255"); +assertEq(view[1144], 128, "1144th value should be 128"); +assertEq(view[1145], 127, "1145th value should be 127"); +assertEq(view[1146], 127, "1146th value should be 127"); +assertEq(view[1147], 255, "1147th value should be 255"); +assertEq(view[1148], 103, "1148th value should be 103"); +assertEq(view[1149], 255, "1149th value should be 255"); +assertEq(view[1150], 152, "1150th value should be 152"); +assertEq(view[1151], 255, "1151th value should be 255"); +assertEq(view[1152], 78, "1152th value should be 78"); +assertEq(view[1153], 127, "1153th value should be 127"); +assertEq(view[1154], 178, "1154th value should be 178"); +assertEq(view[1155], 255, "1155th value should be 255"); +assertEq(view[1156], 0, "1156th value should be 0"); +assertEq(view[1157], 0, "1157th value should be 0"); +assertEq(view[1158], 0, "1158th value should be 0"); +assertEq(view[1159], 255, "1159th value should be 255"); +assertEq(view[1160], 0, "1160th value should be 0"); +assertEq(view[1161], 0, "1161th value should be 0"); +assertEq(view[1162], 0, "1162th value should be 0"); +assertEq(view[1163], 255, "1163th value should be 255"); +assertEq(view[1164], 0, "1164th value should be 0"); +assertEq(view[1165], 0, "1165th value should be 0"); +assertEq(view[1166], 0, "1166th value should be 0"); +assertEq(view[1167], 255, "1167th value should be 255"); +assertEq(view[1168], 0, "1168th value should be 0"); +assertEq(view[1169], 0, "1169th value should be 0"); +assertEq(view[1170], 0, "1170th value should be 0"); +assertEq(view[1171], 255, "1171th value should be 255"); +assertEq(view[1172], 0, "1172th value should be 0"); +assertEq(view[1173], 0, "1173th value should be 0"); +assertEq(view[1174], 0, "1174th value should be 0"); +assertEq(view[1175], 255, "1175th value should be 255"); +assertEq(view[1176], 0, "1176th value should be 0"); +assertEq(view[1177], 0, "1177th value should be 0"); +assertEq(view[1178], 0, "1178th value should be 0"); +assertEq(view[1179], 255, "1179th value should be 255"); +assertEq(view[1180], 0, "1180th value should be 0"); +assertEq(view[1181], 0, "1181th value should be 0"); +assertEq(view[1182], 0, "1182th value should be 0"); +assertEq(view[1183], 255, "1183th value should be 255"); +assertEq(view[1184], 26, "1184th value should be 26"); +assertEq(view[1185], 127, "1185th value should be 127"); +assertEq(view[1186], 229, "1186th value should be 229"); +assertEq(view[1187], 255, "1187th value should be 255"); +assertEq(view[1188], 154, "1188th value should be 154"); +assertEq(view[1189], 255, "1189th value should be 255"); +assertEq(view[1190], 101, "1190th value should be 101"); +assertEq(view[1191], 255, "1191th value should be 255"); +assertEq(view[1192], 205, "1192th value should be 205"); +assertEq(view[1193], 255, "1193th value should be 255"); +assertEq(view[1194], 50, "1194th value should be 50"); +assertEq(view[1195], 255, "1195th value should be 255"); +assertEq(view[1196], 205, "1196th value should be 205"); +assertEq(view[1197], 255, "1197th value should be 255"); +assertEq(view[1198], 50, "1198th value should be 50"); +assertEq(view[1199], 255, "1199th value should be 255"); +assertEq(view[1200], 230, "1200th value should be 230"); +assertEq(view[1201], 127, "1201th value should be 127"); +assertEq(view[1202], 25, "1202th value should be 25"); +assertEq(view[1203], 255, "1203th value should be 255"); +assertEq(view[1204], 205, "1204th value should be 205"); +assertEq(view[1205], 255, "1205th value should be 255"); +assertEq(view[1206], 50, "1206th value should be 50"); +assertEq(view[1207], 255, "1207th value should be 255"); +assertEq(view[1208], 205, "1208th value should be 205"); +assertEq(view[1209], 255, "1209th value should be 255"); +assertEq(view[1210], 50, "1210th value should be 50"); +assertEq(view[1211], 255, "1211th value should be 255"); +assertEq(view[1212], 205, "1212th value should be 205"); +assertEq(view[1213], 255, "1213th value should be 255"); +assertEq(view[1214], 50, "1214th value should be 50"); +assertEq(view[1215], 255, "1215th value should be 255"); +assertEq(view[1216], 205, "1216th value should be 205"); +assertEq(view[1217], 255, "1217th value should be 255"); +assertEq(view[1218], 50, "1218th value should be 50"); +assertEq(view[1219], 255, "1219th value should be 255"); +assertEq(view[1220], 154, "1220th value should be 154"); +assertEq(view[1221], 255, "1221th value should be 255"); +assertEq(view[1222], 101, "1222th value should be 101"); +assertEq(view[1223], 255, "1223th value should be 255"); +assertEq(view[1224], 154, "1224th value should be 154"); +assertEq(view[1225], 255, "1225th value should be 255"); +assertEq(view[1226], 101, "1226th value should be 101"); +assertEq(view[1227], 255, "1227th value should be 255"); +assertEq(view[1228], 154, "1228th value should be 154"); +assertEq(view[1229], 255, "1229th value should be 255"); +assertEq(view[1230], 101, "1230th value should be 101"); +assertEq(view[1231], 255, "1231th value should be 255"); +assertEq(view[1232], 128, "1232th value should be 128"); +assertEq(view[1233], 127, "1233th value should be 127"); +assertEq(view[1234], 127, "1234th value should be 127"); +assertEq(view[1235], 255, "1235th value should be 255"); +assertEq(view[1236], 26, "1236th value should be 26"); +assertEq(view[1237], 127, "1237th value should be 127"); +assertEq(view[1238], 229, "1238th value should be 229"); +assertEq(view[1239], 255, "1239th value should be 255"); +assertEq(view[1240], 0, "1240th value should be 0"); +assertEq(view[1241], 0, "1241th value should be 0"); +assertEq(view[1242], 0, "1242th value should be 0"); +assertEq(view[1243], 255, "1243th value should be 255"); +assertEq(view[1244], 0, "1244th value should be 0"); +assertEq(view[1245], 0, "1245th value should be 0"); +assertEq(view[1246], 0, "1246th value should be 0"); +assertEq(view[1247], 255, "1247th value should be 255"); +assertEq(view[1248], 0, "1248th value should be 0"); +assertEq(view[1249], 0, "1249th value should be 0"); +assertEq(view[1250], 0, "1250th value should be 0"); +assertEq(view[1251], 255, "1251th value should be 255"); +assertEq(view[1252], 0, "1252th value should be 0"); +assertEq(view[1253], 0, "1253th value should be 0"); +assertEq(view[1254], 0, "1254th value should be 0"); +assertEq(view[1255], 255, "1255th value should be 255"); +assertEq(view[1256], 0, "1256th value should be 0"); +assertEq(view[1257], 0, "1257th value should be 0"); +assertEq(view[1258], 0, "1258th value should be 0"); +assertEq(view[1259], 255, "1259th value should be 255"); +assertEq(view[1260], 0, "1260th value should be 0"); +assertEq(view[1261], 0, "1261th value should be 0"); +assertEq(view[1262], 0, "1262th value should be 0"); +assertEq(view[1263], 255, "1263th value should be 255"); +assertEq(view[1264], 78, "1264th value should be 78"); +assertEq(view[1265], 127, "1265th value should be 127"); +assertEq(view[1266], 178, "1266th value should be 178"); +assertEq(view[1267], 255, "1267th value should be 255"); +assertEq(view[1268], 179, "1268th value should be 179"); +assertEq(view[1269], 127, "1269th value should be 127"); +assertEq(view[1270], 76, "1270th value should be 76"); +assertEq(view[1271], 255, "1271th value should be 255"); +assertEq(view[1272], 205, "1272th value should be 205"); +assertEq(view[1273], 255, "1273th value should be 255"); +assertEq(view[1274], 50, "1274th value should be 50"); +assertEq(view[1275], 255, "1275th value should be 255"); +assertEq(view[1276], 205, "1276th value should be 205"); +assertEq(view[1277], 255, "1277th value should be 255"); +assertEq(view[1278], 50, "1278th value should be 50"); +assertEq(view[1279], 255, "1279th value should be 255"); +assertEq(view[1280], 0, "1280th value should be 0"); +assertEq(view[1281], 0, "1281th value should be 0"); +assertEq(view[1282], 0, "1282th value should be 0"); +assertEq(view[1283], 255, "1283th value should be 255"); +assertEq(view[1284], 205, "1284th value should be 205"); +assertEq(view[1285], 255, "1285th value should be 255"); +assertEq(view[1286], 50, "1286th value should be 50"); +assertEq(view[1287], 255, "1287th value should be 255"); +assertEq(view[1288], 205, "1288th value should be 205"); +assertEq(view[1289], 255, "1289th value should be 255"); +assertEq(view[1290], 50, "1290th value should be 50"); +assertEq(view[1291], 255, "1291th value should be 255"); +assertEq(view[1292], 205, "1292th value should be 205"); +assertEq(view[1293], 255, "1293th value should be 255"); +assertEq(view[1294], 50, "1294th value should be 50"); +assertEq(view[1295], 255, "1295th value should be 255"); +assertEq(view[1296], 205, "1296th value should be 205"); +assertEq(view[1297], 255, "1297th value should be 255"); +assertEq(view[1298], 50, "1298th value should be 50"); +assertEq(view[1299], 255, "1299th value should be 255"); +assertEq(view[1300], 205, "1300th value should be 205"); +assertEq(view[1301], 255, "1301th value should be 255"); +assertEq(view[1302], 50, "1302th value should be 50"); +assertEq(view[1303], 255, "1303th value should be 255"); +assertEq(view[1304], 179, "1304th value should be 179"); +assertEq(view[1305], 127, "1305th value should be 127"); +assertEq(view[1306], 76, "1306th value should be 76"); +assertEq(view[1307], 255, "1307th value should be 255"); +assertEq(view[1308], 154, "1308th value should be 154"); +assertEq(view[1309], 255, "1309th value should be 255"); +assertEq(view[1310], 101, "1310th value should be 101"); +assertEq(view[1311], 255, "1311th value should be 255"); +assertEq(view[1312], 154, "1312th value should be 154"); +assertEq(view[1313], 255, "1313th value should be 255"); +assertEq(view[1314], 101, "1314th value should be 101"); +assertEq(view[1315], 255, "1315th value should be 255"); +assertEq(view[1316], 0, "1316th value should be 0"); +assertEq(view[1317], 0, "1317th value should be 0"); +assertEq(view[1318], 0, "1318th value should be 0"); +assertEq(view[1319], 255, "1319th value should be 255"); +assertEq(view[1320], 0, "1320th value should be 0"); +assertEq(view[1321], 0, "1321th value should be 0"); +assertEq(view[1322], 0, "1322th value should be 0"); +assertEq(view[1323], 255, "1323th value should be 255"); +assertEq(view[1324], 0, "1324th value should be 0"); +assertEq(view[1325], 0, "1325th value should be 0"); +assertEq(view[1326], 0, "1326th value should be 0"); +assertEq(view[1327], 255, "1327th value should be 255"); +assertEq(view[1328], 0, "1328th value should be 0"); +assertEq(view[1329], 0, "1329th value should be 0"); +assertEq(view[1330], 0, "1330th value should be 0"); +assertEq(view[1331], 255, "1331th value should be 255"); +assertEq(view[1332], 0, "1332th value should be 0"); +assertEq(view[1333], 0, "1333th value should be 0"); +assertEq(view[1334], 0, "1334th value should be 0"); +assertEq(view[1335], 255, "1335th value should be 255"); +assertEq(view[1336], 0, "1336th value should be 0"); +assertEq(view[1337], 0, "1337th value should be 0"); +assertEq(view[1338], 0, "1338th value should be 0"); +assertEq(view[1339], 255, "1339th value should be 255"); +assertEq(view[1340], 0, "1340th value should be 0"); +assertEq(view[1341], 0, "1341th value should be 0"); +assertEq(view[1342], 0, "1342th value should be 0"); +assertEq(view[1343], 255, "1343th value should be 255"); +assertEq(view[1344], 0, "1344th value should be 0"); +assertEq(view[1345], 0, "1345th value should be 0"); +assertEq(view[1346], 0, "1346th value should be 0"); +assertEq(view[1347], 255, "1347th value should be 255"); +assertEq(view[1348], 179, "1348th value should be 179"); +assertEq(view[1349], 127, "1349th value should be 127"); +assertEq(view[1350], 76, "1350th value should be 76"); +assertEq(view[1351], 255, "1351th value should be 255"); +assertEq(view[1352], 205, "1352th value should be 205"); +assertEq(view[1353], 255, "1353th value should be 255"); +assertEq(view[1354], 50, "1354th value should be 50"); +assertEq(view[1355], 255, "1355th value should be 255"); +assertEq(view[1356], 205, "1356th value should be 205"); +assertEq(view[1357], 255, "1357th value should be 255"); +assertEq(view[1358], 50, "1358th value should be 50"); +assertEq(view[1359], 255, "1359th value should be 255"); +assertEq(view[1360], 0, "1360th value should be 0"); +assertEq(view[1361], 0, "1361th value should be 0"); +assertEq(view[1362], 0, "1362th value should be 0"); +assertEq(view[1363], 255, "1363th value should be 255"); +assertEq(view[1364], 205, "1364th value should be 205"); +assertEq(view[1365], 255, "1365th value should be 255"); +assertEq(view[1366], 50, "1366th value should be 50"); +assertEq(view[1367], 255, "1367th value should be 255"); +assertEq(view[1368], 205, "1368th value should be 205"); +assertEq(view[1369], 255, "1369th value should be 255"); +assertEq(view[1370], 50, "1370th value should be 50"); +assertEq(view[1371], 255, "1371th value should be 255"); +assertEq(view[1372], 205, "1372th value should be 205"); +assertEq(view[1373], 255, "1373th value should be 255"); +assertEq(view[1374], 50, "1374th value should be 50"); +assertEq(view[1375], 255, "1375th value should be 255"); +assertEq(view[1376], 205, "1376th value should be 205"); +assertEq(view[1377], 255, "1377th value should be 255"); +assertEq(view[1378], 50, "1378th value should be 50"); +assertEq(view[1379], 255, "1379th value should be 255"); +assertEq(view[1380], 205, "1380th value should be 205"); +assertEq(view[1381], 255, "1381th value should be 255"); +assertEq(view[1382], 50, "1382th value should be 50"); +assertEq(view[1383], 255, "1383th value should be 255"); +assertEq(view[1384], 205, "1384th value should be 205"); +assertEq(view[1385], 255, "1385th value should be 255"); +assertEq(view[1386], 50, "1386th value should be 50"); +assertEq(view[1387], 255, "1387th value should be 255"); +assertEq(view[1388], 179, "1388th value should be 179"); +assertEq(view[1389], 127, "1389th value should be 127"); +assertEq(view[1390], 76, "1390th value should be 76"); +assertEq(view[1391], 255, "1391th value should be 255"); +assertEq(view[1392], 179, "1392th value should be 179"); +assertEq(view[1393], 127, "1393th value should be 127"); +assertEq(view[1394], 76, "1394th value should be 76"); +assertEq(view[1395], 255, "1395th value should be 255"); +assertEq(view[1396], 103, "1396th value should be 103"); +assertEq(view[1397], 255, "1397th value should be 255"); +assertEq(view[1398], 152, "1398th value should be 152"); +assertEq(view[1399], 255, "1399th value should be 255"); +assertEq(view[1400], 78, "1400th value should be 78"); +assertEq(view[1401], 127, "1401th value should be 127"); +assertEq(view[1402], 178, "1402th value should be 178"); +assertEq(view[1403], 255, "1403th value should be 255"); +assertEq(view[1404], 52, "1404th value should be 52"); +assertEq(view[1405], 255, "1405th value should be 255"); +assertEq(view[1406], 203, "1406th value should be 203"); +assertEq(view[1407], 255, "1407th value should be 255"); +assertEq(view[1408], 0, "1408th value should be 0"); +assertEq(view[1409], 0, "1409th value should be 0"); +assertEq(view[1410], 0, "1410th value should be 0"); +assertEq(view[1411], 255, "1411th value should be 255"); +assertEq(view[1412], 0, "1412th value should be 0"); +assertEq(view[1413], 0, "1413th value should be 0"); +assertEq(view[1414], 0, "1414th value should be 0"); +assertEq(view[1415], 255, "1415th value should be 255"); +assertEq(view[1416], 52, "1416th value should be 52"); +assertEq(view[1417], 255, "1417th value should be 255"); +assertEq(view[1418], 203, "1418th value should be 203"); +assertEq(view[1419], 255, "1419th value should be 255"); +assertEq(view[1420], 128, "1420th value should be 128"); +assertEq(view[1421], 127, "1421th value should be 127"); +assertEq(view[1422], 127, "1422th value should be 127"); +assertEq(view[1423], 255, "1423th value should be 255"); +assertEq(view[1424], 128, "1424th value should be 128"); +assertEq(view[1425], 127, "1425th value should be 127"); +assertEq(view[1426], 127, "1426th value should be 127"); +assertEq(view[1427], 255, "1427th value should be 255"); +assertEq(view[1428], 205, "1428th value should be 205"); +assertEq(view[1429], 255, "1429th value should be 255"); +assertEq(view[1430], 50, "1430th value should be 50"); +assertEq(view[1431], 255, "1431th value should be 255"); +assertEq(view[1432], 205, "1432th value should be 205"); +assertEq(view[1433], 255, "1433th value should be 255"); +assertEq(view[1434], 50, "1434th value should be 50"); +assertEq(view[1435], 255, "1435th value should be 255"); +assertEq(view[1436], 230, "1436th value should be 230"); +assertEq(view[1437], 127, "1437th value should be 127"); +assertEq(view[1438], 25, "1438th value should be 25"); +assertEq(view[1439], 255, "1439th value should be 255"); +assertEq(view[1440], 0, "1440th value should be 0"); +assertEq(view[1441], 0, "1441th value should be 0"); +assertEq(view[1442], 0, "1442th value should be 0"); +assertEq(view[1443], 255, "1443th value should be 255"); +assertEq(view[1444], 230, "1444th value should be 230"); +assertEq(view[1445], 127, "1445th value should be 127"); +assertEq(view[1446], 25, "1446th value should be 25"); +assertEq(view[1447], 255, "1447th value should be 255"); +assertEq(view[1448], 205, "1448th value should be 205"); +assertEq(view[1449], 255, "1449th value should be 255"); +assertEq(view[1450], 50, "1450th value should be 50"); +assertEq(view[1451], 255, "1451th value should be 255"); +assertEq(view[1452], 205, "1452th value should be 205"); +assertEq(view[1453], 255, "1453th value should be 255"); +assertEq(view[1454], 50, "1454th value should be 50"); +assertEq(view[1455], 255, "1455th value should be 255"); +assertEq(view[1456], 205, "1456th value should be 205"); +assertEq(view[1457], 255, "1457th value should be 255"); +assertEq(view[1458], 50, "1458th value should be 50"); +assertEq(view[1459], 255, "1459th value should be 255"); +assertEq(view[1460], 205, "1460th value should be 205"); +assertEq(view[1461], 255, "1461th value should be 255"); +assertEq(view[1462], 50, "1462th value should be 50"); +assertEq(view[1463], 255, "1463th value should be 255"); +assertEq(view[1464], 205, "1464th value should be 205"); +assertEq(view[1465], 255, "1465th value should be 255"); +assertEq(view[1466], 50, "1466th value should be 50"); +assertEq(view[1467], 255, "1467th value should be 255"); +assertEq(view[1468], 179, "1468th value should be 179"); +assertEq(view[1469], 127, "1469th value should be 127"); +assertEq(view[1470], 76, "1470th value should be 76"); +assertEq(view[1471], 255, "1471th value should be 255"); +assertEq(view[1472], 179, "1472th value should be 179"); +assertEq(view[1473], 127, "1473th value should be 127"); +assertEq(view[1474], 76, "1474th value should be 76"); +assertEq(view[1475], 255, "1475th value should be 255"); +assertEq(view[1476], 179, "1476th value should be 179"); +assertEq(view[1477], 127, "1477th value should be 127"); +assertEq(view[1478], 76, "1478th value should be 76"); +assertEq(view[1479], 255, "1479th value should be 255"); +assertEq(view[1480], 128, "1480th value should be 128"); +assertEq(view[1481], 127, "1481th value should be 127"); +assertEq(view[1482], 127, "1482th value should be 127"); +assertEq(view[1483], 255, "1483th value should be 255"); +assertEq(view[1484], 103, "1484th value should be 103"); +assertEq(view[1485], 255, "1485th value should be 255"); +assertEq(view[1486], 152, "1486th value should be 152"); +assertEq(view[1487], 255, "1487th value should be 255"); +assertEq(view[1488], 0, "1488th value should be 0"); +assertEq(view[1489], 0, "1489th value should be 0"); +assertEq(view[1490], 0, "1490th value should be 0"); +assertEq(view[1491], 255, "1491th value should be 255"); +assertEq(view[1492], 0, "1492th value should be 0"); +assertEq(view[1493], 0, "1493th value should be 0"); +assertEq(view[1494], 0, "1494th value should be 0"); +assertEq(view[1495], 255, "1495th value should be 255"); +assertEq(view[1496], 128, "1496th value should be 128"); +assertEq(view[1497], 127, "1497th value should be 127"); +assertEq(view[1498], 127, "1498th value should be 127"); +assertEq(view[1499], 255, "1499th value should be 255"); +assertEq(view[1500], 154, "1500th value should be 154"); +assertEq(view[1501], 255, "1501th value should be 255"); +assertEq(view[1502], 101, "1502th value should be 101"); +assertEq(view[1503], 255, "1503th value should be 255"); +assertEq(view[1504], 179, "1504th value should be 179"); +assertEq(view[1505], 127, "1505th value should be 127"); +assertEq(view[1506], 76, "1506th value should be 76"); +assertEq(view[1507], 255, "1507th value should be 255"); +assertEq(view[1508], 205, "1508th value should be 205"); +assertEq(view[1509], 255, "1509th value should be 255"); +assertEq(view[1510], 50, "1510th value should be 50"); +assertEq(view[1511], 255, "1511th value should be 255"); +assertEq(view[1512], 205, "1512th value should be 205"); +assertEq(view[1513], 255, "1513th value should be 255"); +assertEq(view[1514], 50, "1514th value should be 50"); +assertEq(view[1515], 255, "1515th value should be 255"); +assertEq(view[1516], 230, "1516th value should be 230"); +assertEq(view[1517], 127, "1517th value should be 127"); +assertEq(view[1518], 25, "1518th value should be 25"); +assertEq(view[1519], 255, "1519th value should be 255"); +assertEq(view[1520], 0, "1520th value should be 0"); +assertEq(view[1521], 0, "1521th value should be 0"); +assertEq(view[1522], 0, "1522th value should be 0"); +assertEq(view[1523], 255, "1523th value should be 255"); +assertEq(view[1524], 230, "1524th value should be 230"); +assertEq(view[1525], 127, "1525th value should be 127"); +assertEq(view[1526], 25, "1526th value should be 25"); +assertEq(view[1527], 255, "1527th value should be 255"); +assertEq(view[1528], 230, "1528th value should be 230"); +assertEq(view[1529], 127, "1529th value should be 127"); +assertEq(view[1530], 25, "1530th value should be 25"); +assertEq(view[1531], 255, "1531th value should be 255"); +assertEq(view[1532], 205, "1532th value should be 205"); +assertEq(view[1533], 255, "1533th value should be 255"); +assertEq(view[1534], 50, "1534th value should be 50"); +assertEq(view[1535], 255, "1535th value should be 255"); +assertEq(view[1536], 205, "1536th value should be 205"); +assertEq(view[1537], 255, "1537th value should be 255"); +assertEq(view[1538], 50, "1538th value should be 50"); +assertEq(view[1539], 255, "1539th value should be 255"); +assertEq(view[1540], 205, "1540th value should be 205"); +assertEq(view[1541], 255, "1541th value should be 255"); +assertEq(view[1542], 50, "1542th value should be 50"); +assertEq(view[1543], 255, "1543th value should be 255"); +assertEq(view[1544], 205, "1544th value should be 205"); +assertEq(view[1545], 255, "1545th value should be 255"); +assertEq(view[1546], 50, "1546th value should be 50"); +assertEq(view[1547], 255, "1547th value should be 255"); +assertEq(view[1548], 205, "1548th value should be 205"); +assertEq(view[1549], 255, "1549th value should be 255"); +assertEq(view[1550], 50, "1550th value should be 50"); +assertEq(view[1551], 255, "1551th value should be 255"); +assertEq(view[1552], 179, "1552th value should be 179"); +assertEq(view[1553], 127, "1553th value should be 127"); +assertEq(view[1554], 76, "1554th value should be 76"); +assertEq(view[1555], 255, "1555th value should be 255"); +assertEq(view[1556], 179, "1556th value should be 179"); +assertEq(view[1557], 127, "1557th value should be 127"); +assertEq(view[1558], 76, "1558th value should be 76"); +assertEq(view[1559], 255, "1559th value should be 255"); +assertEq(view[1560], 179, "1560th value should be 179"); +assertEq(view[1561], 127, "1561th value should be 127"); +assertEq(view[1562], 76, "1562th value should be 76"); +assertEq(view[1563], 255, "1563th value should be 255"); +assertEq(view[1564], 154, "1564th value should be 154"); +assertEq(view[1565], 255, "1565th value should be 255"); +assertEq(view[1566], 101, "1566th value should be 101"); +assertEq(view[1567], 255, "1567th value should be 255"); +assertEq(view[1568], 26, "1568th value should be 26"); +assertEq(view[1569], 127, "1569th value should be 127"); +assertEq(view[1570], 229, "1570th value should be 229"); +assertEq(view[1571], 255, "1571th value should be 255"); +assertEq(view[1572], 0, "1572th value should be 0"); +assertEq(view[1573], 0, "1573th value should be 0"); +assertEq(view[1574], 0, "1574th value should be 0"); +assertEq(view[1575], 255, "1575th value should be 255"); +assertEq(view[1576], 154, "1576th value should be 154"); +assertEq(view[1577], 255, "1577th value should be 255"); +assertEq(view[1578], 101, "1578th value should be 101"); +assertEq(view[1579], 255, "1579th value should be 255"); +assertEq(view[1580], 179, "1580th value should be 179"); +assertEq(view[1581], 127, "1581th value should be 127"); +assertEq(view[1582], 76, "1582th value should be 76"); +assertEq(view[1583], 255, "1583th value should be 255"); +assertEq(view[1584], 205, "1584th value should be 205"); +assertEq(view[1585], 255, "1585th value should be 255"); +assertEq(view[1586], 50, "1586th value should be 50"); +assertEq(view[1587], 255, "1587th value should be 255"); +assertEq(view[1588], 205, "1588th value should be 205"); +assertEq(view[1589], 255, "1589th value should be 255"); +assertEq(view[1590], 50, "1590th value should be 50"); +assertEq(view[1591], 255, "1591th value should be 255"); +assertEq(view[1592], 230, "1592th value should be 230"); +assertEq(view[1593], 127, "1593th value should be 127"); +assertEq(view[1594], 25, "1594th value should be 25"); +assertEq(view[1595], 255, "1595th value should be 255"); +assertEq(view[1596], 230, "1596th value should be 230"); +assertEq(view[1597], 127, "1597th value should be 127"); +assertEq(view[1598], 25, "1598th value should be 25"); +assertEq(view[1599], 255, "1599th value should be 255"); + +// Code used to generate the assertEq list above. +function generateAssertList() { + function template(i, x) { + return 'assertEq(view[' + i + '], ' + x + ', "' + i + 'th value should be ' + x + '");\n'; + } + var buf = '' + for (var i = 0; i < LIMIT_SHOW; i++) + buf += template(i, view[i]); + print(buf); +} +//generateAssertList(); From 3b31b44e31f9cb43028961c38901d934de677bdd Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 30 Sep 2014 11:43:19 +0100 Subject: [PATCH 58/93] Bug 1060737 - Unloading a patch with SharedWorkers should not assert, r=bent --- dom/workers/WorkerPrivate.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 458dc063ac2c..648a2412d74d 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -2430,10 +2430,10 @@ WorkerPrivateParent::Suspend(JSContext* aCx, nsPIDOMWindow* aWindow) MOZ_ASSERT(aCx); // Shared workers are only suspended if all of their owning documents are - // suspended. - if (IsSharedWorker() || IsServiceWorker()) { + // suspended. It can happen that mSharedWorkers is empty but this thread has + // not been unregistered yet. + if ((IsSharedWorker() || IsServiceWorker()) && mSharedWorkers.Count()) { AssertIsOnMainThread(); - MOZ_ASSERT(mSharedWorkers.Count()); struct Closure { @@ -2515,9 +2515,10 @@ WorkerPrivateParent::Resume(JSContext* aCx, nsPIDOMWindow* aWindow) MOZ_ASSERT_IF(IsDedicatedWorker(), mParentSuspended); // Shared workers are resumed if any of their owning documents are resumed. - if (IsSharedWorker() || IsServiceWorker()) { + // It can happen that mSharedWorkers is empty but this thread has not been + // unregistered yet. + if ((IsSharedWorker() || IsServiceWorker()) && mSharedWorkers.Count()) { AssertIsOnMainThread(); - MOZ_ASSERT(mSharedWorkers.Count()); struct Closure { From db1eb677703783575a3c2030076976dc701b9a72 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 30 Sep 2014 13:51:09 +0200 Subject: [PATCH 59/93] Bug 1073230 - Address Jeff's review comments from bug 1011166 comment 60. r=jrmuizel --- gfx/cairo/cairo/src/cairo-image-surface.c | 11 +++++++++-- gfx/cairo/cairo/src/cairo-pattern.c | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c index cd3a92c1118c..a77f7867b3ef 100644 --- a/gfx/cairo/cairo/src/cairo-image-surface.c +++ b/gfx/cairo/cairo/src/cairo-image-surface.c @@ -1085,6 +1085,12 @@ UNLOCK: return image; } +static double +clamp (double val, double min, double max) +{ + return val < min ? min : (val > max ? max : val); +} + static pixman_image_t * _pixman_image_for_gradient (const cairo_gradient_pattern_t *pattern, const cairo_rectangle_int_t *extents, @@ -1146,6 +1152,7 @@ _pixman_image_for_gradient (const cairo_gradient_pattern_t *pattern, p2.x = _cairo_fixed_16_16_from_double (_cairo_fixed_to_double (linear->p2.x) * sf); p2.y = _cairo_fixed_16_16_from_double (_cairo_fixed_to_double (linear->p2.y) * sf); + /* cairo_matrix_scale does a pre-scale, we want a post-scale */ cairo_matrix_init_scale (&scale, sf, sf); cairo_matrix_multiply (&matrix, &matrix, &scale); } @@ -1210,9 +1217,9 @@ _pixman_image_for_gradient (const cairo_gradient_pattern_t *pattern, y = _cairo_lround (inv.y0 / 2); max_x = PIXMAN_MAX_INT - 1 - fabs (extents->x + extents->width); - x = x > max_x ? max_x : (x < -max_x ? -max_x : x); + x = clamp(x, -max_x, max_x); max_y = PIXMAN_MAX_INT - 1 - fabs (extents->y + extents->height); - y = y > max_y ? max_y : (y < -max_y ? -max_y : y); + y = clamp(y, -max_y, max_y); tx = -x; ty = -y; diff --git a/gfx/cairo/cairo/src/cairo-pattern.c b/gfx/cairo/cairo/src/cairo-pattern.c index d59a23ce3afa..c23d47b7671c 100644 --- a/gfx/cairo/cairo/src/cairo-pattern.c +++ b/gfx/cairo/cairo/src/cairo-pattern.c @@ -1399,6 +1399,7 @@ _cairo_pattern_acquire_surface_for_gradient (const cairo_gradient_pattern_t *pat p2.x = _cairo_fixed_16_16_from_double (_cairo_fixed_to_double (linear->p2.x) * sf); p2.y = _cairo_fixed_16_16_from_double (_cairo_fixed_to_double (linear->p2.y) * sf); + /* cairo_matrix_scale does a pre-scale, we want a post-scale */ cairo_matrix_init_scale (&scale, sf, sf); cairo_matrix_multiply (&matrix, &matrix, &scale); } From ea666229c730117d431d0a0dc50b1359b5248cce Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 30 Sep 2014 13:51:37 +0200 Subject: [PATCH 60/93] Bug 1073727 - Make OverscrollHandoffState::mPanDistance non-negative during OS X APZ panning. r=botond --- gfx/layers/apz/src/AsyncPanZoomController.cpp | 3 ++- gfx/layers/apz/src/OverscrollHandoffState.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 239841641972..423e7dde3252 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -1578,8 +1578,9 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, bool // TODO: Handle pan events sent without pan begin / pan end events properly. if (mPanGestureState) { + ScreenPoint panDistance(fabs(panDisplacement.x), fabs(panDisplacement.y))); OverscrollHandoffState handoffState( - *mPanGestureState->GetOverscrollHandoffChain(), panDisplacement); + *mPanGestureState->GetOverscrollHandoffChain(), panDistance); CallDispatchScroll(aEvent.mPanStartPoint, aEvent.mPanStartPoint + aEvent.mPanDisplacement, handoffState); } diff --git a/gfx/layers/apz/src/OverscrollHandoffState.h b/gfx/layers/apz/src/OverscrollHandoffState.h index 2c3a81154f17..a390db29dca9 100644 --- a/gfx/layers/apz/src/OverscrollHandoffState.h +++ b/gfx/layers/apz/src/OverscrollHandoffState.h @@ -131,6 +131,7 @@ struct OverscrollHandoffState { // The total distance since touch-start of the pan that triggered the // handoff. This is const to indicate that it does not change over the // course of handoff. + // The x/y components of this are non-negative. const ScreenPoint mPanDistance; }; // Don't pollute other files with this macro for now. From 66bac03572a38d3e0138d54befcd4042319920e5 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 30 Sep 2014 13:51:54 +0200 Subject: [PATCH 61/93] Bug 1073570 - Reset the base CTM after native widget drawing. r=smichaud --- widget/cocoa/nsNativeThemeCocoa.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index 7949dce5c766..5eea32e1c478 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -2833,6 +2833,11 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, break; } + if (hidpi) { + // Reset the base CTM. + CGContextSetBaseCTM(cgContext, CGAffineTransformIdentity); + } + nativeDrawing.EndNativeDrawing(); return NS_OK; From 6bb9f1c44ac0c60bf55af33005a30227ba1a7329 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 30 Sep 2014 14:08:18 +0200 Subject: [PATCH 62/93] Bug 1073727 - Fix bustage. --- gfx/layers/apz/src/AsyncPanZoomController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 423e7dde3252..0d5ad542750b 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -1578,7 +1578,7 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, bool // TODO: Handle pan events sent without pan begin / pan end events properly. if (mPanGestureState) { - ScreenPoint panDistance(fabs(panDisplacement.x), fabs(panDisplacement.y))); + ScreenPoint panDistance(fabs(panDisplacement.x), fabs(panDisplacement.y)); OverscrollHandoffState handoffState( *mPanGestureState->GetOverscrollHandoffChain(), panDistance); CallDispatchScroll(aEvent.mPanStartPoint, aEvent.mPanStartPoint + aEvent.mPanDisplacement, From b91c15b7712cc50aee5fcec760d21c5d8b35b9e9 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 30 Sep 2014 13:20:48 +0100 Subject: [PATCH 63/93] Bug 1073577 - Fix new object cache interactions with moving GC r=terrence --- js/src/jsobj.cpp | 9 +++++++-- js/src/vm/Runtime.h | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 7a18b46e477f..e258ae4e3fce 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -1525,8 +1525,10 @@ js::NewObjectWithGivenProto(ExclusiveContext *cxArg, const js::Class *clasp, allocKind = GetBackgroundAllocKind(allocKind); NewObjectCache::EntryIndex entry = -1; + uint64_t gcNumber = 0; if (JSContext *cx = cxArg->maybeJSContext()) { - NewObjectCache &cache = cx->runtime()->newObjectCache; + JSRuntime *rt = cx->runtime(); + NewObjectCache &cache = rt->newObjectCache; if (protoArg.isObject() && newKind == GenericObject && !cx->compartment()->hasObjectMetadataCallback() && @@ -1547,6 +1549,7 @@ js::NewObjectWithGivenProto(ExclusiveContext *cxArg, const js::Class *clasp, } } } + gcNumber = rt->gc.gcNumber(); } Rooted proto(cxArg, protoArg); @@ -1567,7 +1570,9 @@ js::NewObjectWithGivenProto(ExclusiveContext *cxArg, const js::Class *clasp, if (!obj) return nullptr; - if (entry != -1 && !obj->hasDynamicSlots()) { + if (entry != -1 && !obj->hasDynamicSlots() && + cxArg->asJSContext()->runtime()->gc.gcNumber() == gcNumber) + { cxArg->asJSContext()->runtime()->newObjectCache.fillProto(entry, clasp, proto, allocKind, obj); } diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index 62670ac4b681..c2ea7b78c0a8 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -315,18 +315,23 @@ class NewObjectCache void invalidateEntriesForShape(JSContext *cx, HandleShape shape, HandleObject proto); private: - bool lookup(const Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry) { + EntryIndex makeIndex(const Class *clasp, gc::Cell *key, gc::AllocKind kind) { uintptr_t hash = (uintptr_t(clasp) ^ uintptr_t(key)) + kind; - *pentry = hash % mozilla::ArrayLength(entries); + return hash % mozilla::ArrayLength(entries); + } + bool lookup(const Class *clasp, gc::Cell *key, gc::AllocKind kind, EntryIndex *pentry) { + *pentry = makeIndex(clasp, key, kind); Entry *entry = &entries[*pentry]; /* N.B. Lookups with the same clasp/key but different kinds map to different entries. */ return entry->clasp == clasp && entry->key == key; } - void fill(EntryIndex entry_, const Class *clasp, gc::Cell *key, gc::AllocKind kind, JSObject *obj) { + void fill(EntryIndex entry_, const Class *clasp, gc::Cell *key, gc::AllocKind kind, + JSObject *obj) { JS_ASSERT(unsigned(entry_) < mozilla::ArrayLength(entries)); + JS_ASSERT(entry_ == makeIndex(clasp, key, kind)); Entry *entry = &entries[entry_]; JS_ASSERT(!obj->hasDynamicSlots() && !obj->hasDynamicElements()); From c67315634abb649c96ee08e4984ac418d709ce41 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Tue, 30 Sep 2014 14:29:48 +0200 Subject: [PATCH 64/93] Bug 1065310 - nsHtml5TreeBuilder::contextName is used uninitialised. r=hsivonen. --HG-- extra : rebase_source : 3baca5d39f2898f20d218ec3073e2406ea277510 --- parser/html/nsHtml5TreeBuilderCppSupplement.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser/html/nsHtml5TreeBuilderCppSupplement.h b/parser/html/nsHtml5TreeBuilderCppSupplement.h index 0f90e1d1705a..da81b7bc7c73 100644 --- a/parser/html/nsHtml5TreeBuilderCppSupplement.h +++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h @@ -15,6 +15,8 @@ class nsPresContext; nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsHtml5OplessBuilder* aBuilder) : scriptingEnabled(false) , fragment(false) + , contextName(nullptr) + , contextNamespace(kNameSpaceID_None) , contextNode(nullptr) , formPointer(nullptr) , headPointer(nullptr) @@ -37,6 +39,8 @@ nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsAHtml5TreeOpSink* aOpSink, nsHtml5TreeOpStage* aStage) : scriptingEnabled(false) , fragment(false) + , contextName(nullptr) + , contextNamespace(kNameSpaceID_None) , contextNode(nullptr) , formPointer(nullptr) , headPointer(nullptr) From c27c3931ff36e43d37730a2e42d420bd23cdcc9f Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Tue, 30 Sep 2014 08:59:05 -0400 Subject: [PATCH 65/93] Bug 1074048: Allow MainThread access if the graph is shut down (for RunDuringShutdown) r=roc --- content/media/MediaStreamGraphImpl.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/content/media/MediaStreamGraphImpl.h b/content/media/MediaStreamGraphImpl.h index afc3161fc76b..690dc6ff8bfd 100644 --- a/content/media/MediaStreamGraphImpl.h +++ b/content/media/MediaStreamGraphImpl.h @@ -153,8 +153,16 @@ public: void AssertOnGraphThreadOrNotRunning() { // either we're on the right thread (and calling CurrentDriver() is safe), // or we're going to assert anyways, so don't cross-check CurrentDriver - MOZ_ASSERT(mDriver->OnThread() || - (mLifecycleState > LIFECYCLE_RUNNING && NS_IsMainThread())); +#ifdef DEBUG + // if all the safety checks fail, assert we own the monitor + if (!mDriver->OnThread()) { + if (!(mDetectedNotRunning && + mLifecycleState > LIFECYCLE_RUNNING && + NS_IsMainThread())) { + mMonitor.AssertCurrentThreadOwns(); + } + } +#endif } /* * This does the actual iteration: Message processing, MediaStream ordering, @@ -424,12 +432,7 @@ public: * Not safe to call off the MediaStreamGraph thread unless monitor is held! */ GraphDriver* CurrentDriver() { -#ifdef DEBUG - // #ifdef since we're not wrapping it all in MOZ_ASSERT() - if (!mDriver->OnThread()) { - mMonitor.AssertCurrentThreadOwns(); - } -#endif + AssertOnGraphThreadOrNotRunning(); return mDriver; } @@ -442,12 +445,7 @@ public: * monitor is held */ void SetCurrentDriver(GraphDriver* aDriver) { -#ifdef DEBUG - // #ifdef since we're not wrapping it all in MOZ_ASSERT() - if (!mDriver->OnThread()) { - mMonitor.AssertCurrentThreadOwns(); - } -#endif + AssertOnGraphThreadOrNotRunning(); mDriver = aDriver; } From f443b192ef66aa0981e4035f17ef7f95d5d286eb Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Tue, 30 Sep 2014 15:05:48 +0200 Subject: [PATCH 66/93] Bug 1074111 - TransactionBase::VerifyRequestParams should check transaction mode for delete and clear request; r=bent --- dom/indexedDB/ActorsParent.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index f0f31e51cd2c..7f08f4e9cb8e 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -6814,6 +6814,12 @@ TransactionBase::VerifyRequestParams(const RequestParams& aParams) const } case RequestParams::TObjectStoreDeleteParams: { + if (NS_WARN_IF(mMode != IDBTransaction::READ_WRITE && + mMode != IDBTransaction::VERSION_CHANGE)) { + ASSERT_UNLESS_FUZZING(); + return false; + } + const ObjectStoreDeleteParams& params = aParams.get_ObjectStoreDeleteParams(); const nsRefPtr objectStoreMetadata = @@ -6830,6 +6836,12 @@ TransactionBase::VerifyRequestParams(const RequestParams& aParams) const } case RequestParams::TObjectStoreClearParams: { + if (NS_WARN_IF(mMode != IDBTransaction::READ_WRITE && + mMode != IDBTransaction::VERSION_CHANGE)) { + ASSERT_UNLESS_FUZZING(); + return false; + } + const ObjectStoreClearParams& params = aParams.get_ObjectStoreClearParams(); const nsRefPtr objectStoreMetadata = From dcb7bd8028ebd4db8b9503d2e568c9af3e3586dc Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Tue, 30 Sep 2014 15:32:47 +0200 Subject: [PATCH 67/93] Bug 1064258 - Allow caching channels only store metadata, r=jduell --- netwerk/base/public/nsICachingChannel.idl | 10 +- netwerk/protocol/http/nsHttpChannel.cpp | 55 +++++++- netwerk/protocol/http/nsHttpChannel.h | 1 + netwerk/test/unit/test_bug1064258.js | 154 ++++++++++++++++++++++ netwerk/test/unit/xpcshell.ini | 1 + 5 files changed, 214 insertions(+), 7 deletions(-) create mode 100644 netwerk/test/unit/test_bug1064258.js diff --git a/netwerk/base/public/nsICachingChannel.idl b/netwerk/base/public/nsICachingChannel.idl index 9c1b0a65d6bd..c9cfd0c4906e 100644 --- a/netwerk/base/public/nsICachingChannel.idl +++ b/netwerk/base/public/nsICachingChannel.idl @@ -17,7 +17,7 @@ interface nsIFile; * 3) Support for uniquely identifying cached data in cases when the URL * is insufficient (e.g., HTTP form submission). */ -[scriptable, uuid(a77b664e-e707-4017-9c03-47bcedcb5b05)] +[scriptable, uuid(3d46b469-7405-416e-ba42-84899963b403)] interface nsICachingChannel : nsICacheInfoChannel { /** @@ -64,6 +64,14 @@ interface nsICachingChannel : nsICacheInfoChannel */ attribute nsISupports cacheKey; + /** + * Instructs the channel to only store the metadata of the entry, and not + * the content. When reading an existing entry, this automatically sets + * LOAD_ONLY_IF_MODIFIED flag. + * Must be called before asyncOpen(). + */ + attribute boolean cacheOnlyMetadata; + /************************************************************************** * Caching channel specific load flags: */ diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index ae2b9b58c907..6224a4ead92e 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -208,6 +208,7 @@ nsHttpChannel::nsHttpChannel() , mOfflineCacheLastModifiedTime(0) , mCachedContentIsValid(false) , mCachedContentIsPartial(false) + , mCacheOnlyMetadata(false) , mTransactionReplaced(false) , mAuthRetryPending(false) , mProxyAuthPending(false) @@ -2826,8 +2827,16 @@ nsHttpChannel::OnCacheEntryCheck(nsICacheEntry* entry, nsIApplicationCache* appC if (mCachedContentIsPartial) { rv = OpenCacheInputStream(entry, false, !!appCache); *aResult = ENTRY_NEEDS_REVALIDATION; + return rv; + } else if (size == 0 && mCacheOnlyMetadata) { + // Don't break cache entry load when the entry's data size + // is 0 and mCacheOnlyMetadata flag is set. In that case we + // want to proceed since the LOAD_ONLY_IF_MODIFIED flag is + // also set. + MOZ_ASSERT(mLoadFlags & LOAD_ONLY_IF_MODIFIED); + } else { + return rv; } - return rv; } } @@ -4003,14 +4012,24 @@ nsHttpChannel::InstallCacheListener(int64_t offset) nsCOMPtr out; rv = mCacheEntry->OpenOutputStream(offset, getter_AddRefs(out)); if (rv == NS_ERROR_NOT_AVAILABLE) { - LOG((" entry doomed, not writing it [channel=%p]", this)); - // Entry is already doomed. - // This may happen when expiration time is set to past and the entry - // has been removed by the background eviction logic. - return NS_OK; + LOG((" entry doomed, not writing it [channel=%p]", this)); + // Entry is already doomed. + // This may happen when expiration time is set to past and the entry + // has been removed by the background eviction logic. + return NS_OK; } if (NS_FAILED(rv)) return rv; + if (mCacheOnlyMetadata) { + LOG(("Not storing content, cacheOnlyMetadata set")); + // We must open and then close the output stream of the cache entry. + // This way we indicate the content has been written (despite with zero + // length) and the entry is now in the ready state with "having data". + + out->Close(); + return NS_OK; + } + // XXX disk cache does not support overlapped i/o yet #if 0 // Mark entry valid inorder to allow simultaneous reading... @@ -5716,6 +5735,30 @@ nsHttpChannel::SetCacheKey(nsISupports *key) return NS_OK; } +NS_IMETHODIMP +nsHttpChannel::GetCacheOnlyMetadata(bool *aOnlyMetadata) +{ + NS_ENSURE_ARG(aOnlyMetadata); + *aOnlyMetadata = mCacheOnlyMetadata; + return NS_OK; +} + +NS_IMETHODIMP +nsHttpChannel::SetCacheOnlyMetadata(bool aOnlyMetadata) +{ + LOG(("nsHttpChannel::SetCacheOnlyMetadata [this=%p only-metadata=%d]\n", + this, aOnlyMetadata)); + + ENSURE_CALLED_BEFORE_ASYNC_OPEN(); + + mCacheOnlyMetadata = aOnlyMetadata; + if (aOnlyMetadata) { + mLoadFlags |= LOAD_ONLY_IF_MODIFIED; + } + + return NS_OK; +} + //----------------------------------------------------------------------------- // nsHttpChannel::nsIResumableChannel //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h index fc12b3020703..06debfe44df8 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h @@ -385,6 +385,7 @@ private: // state flags uint32_t mCachedContentIsValid : 1; uint32_t mCachedContentIsPartial : 1; + uint32_t mCacheOnlyMetadata : 1; uint32_t mTransactionReplaced : 1; uint32_t mAuthRetryPending : 1; uint32_t mProxyAuthPending : 1; diff --git a/netwerk/test/unit/test_bug1064258.js b/netwerk/test/unit/test_bug1064258.js new file mode 100644 index 000000000000..9cccec5f661f --- /dev/null +++ b/netwerk/test/unit/test_bug1064258.js @@ -0,0 +1,154 @@ +/** + * Check how nsICachingChannel.cacheOnlyMetadata works. + * - all channels involved in this test are set cacheOnlyMetadata = true + * - do a previously uncached request for a long living content + * - check we have downloaded the content from the server (channel provides it) + * - check the entry has metadata, but zero-length content + * - load the same URL again, now cached + * - check the channel is giving no content (no call to OnDataAvailable) but succeeds + * - repeat again, but for a different URL that is not cached (immediately expires) + * - only difference is that we get a newer version of the content from the server during the second request + */ + +Cu.import("resource://testing-common/httpd.js"); + +XPCOMUtils.defineLazyGetter(this, "URL", function() { + return "http://localhost:" + httpServer.identity.primaryPort; +}); + +var httpServer = null; + +function make_channel(url, callback, ctx) { + var ios = Cc["@mozilla.org/network/io-service;1"]. + getService(Ci.nsIIOService); + return ios.newChannel(url, "", null); +} + +const responseBody1 = "response body 1"; +const responseBody2a = "response body 2a"; +const responseBody2b = "response body 2b"; + +function contentHandler1(metadata, response) +{ + response.setHeader("Content-Type", "text/plain"); + response.setHeader("Cache-control", "max-age=999999"); + response.bodyOutputStream.write(responseBody1, responseBody1.length); +} + +var content2passCount = 0; + +function contentHandler2(metadata, response) +{ + response.setHeader("Content-Type", "text/plain"); + response.setHeader("Cache-control", "no-cache"); + switch (content2passCount++) { + case 0: + response.setHeader("ETag", "testetag"); + response.bodyOutputStream.write(responseBody2a, responseBody2a.length); + break; + case 1: + do_check_true(metadata.hasHeader("If-None-Match")); + do_check_eq(metadata.getHeader("If-None-Match"), "testetag"); + response.bodyOutputStream.write(responseBody2b, responseBody2b.length); + break; + default: + throw "Unexpected request in the test"; + } +} + + +function run_test() +{ + httpServer = new HttpServer(); + httpServer.registerPathHandler("/content1", contentHandler1); + httpServer.registerPathHandler("/content2", contentHandler2); + httpServer.start(-1); + + run_test_content1a(); + do_test_pending(); +} + +function run_test_content1a() +{ + var chan = make_channel(URL + "/content1"); + caching = chan.QueryInterface(Ci.nsICachingChannel); + caching.cacheOnlyMetadata = true; + chan.asyncOpen(new ChannelListener(contentListener1a, null), null); +} + +function contentListener1a(request, buffer) +{ + do_check_eq(buffer, responseBody1); + + asyncOpenCacheEntry(URL + "/content1", "disk", 0, null, cacheCheck1) +} + +function cacheCheck1(status, entry) +{ + do_check_eq(status, 0); + do_check_eq(entry.dataSize, 0); + try { + do_check_neq(entry.getMetaDataElement("response-head"), null); + } + catch (ex) { + do_throw("Missing response head"); + } + + var chan = make_channel(URL + "/content1"); + caching = chan.QueryInterface(Ci.nsICachingChannel); + caching.cacheOnlyMetadata = true; + chan.asyncOpen(new ChannelListener(contentListener1b, null, CL_IGNORE_CL), null); +} + +function contentListener1b(request, buffer) +{ + request.QueryInterface(Ci.nsIHttpChannel); + do_check_eq(request.requestMethod, "GET"); + do_check_eq(request.responseStatus, 200); + do_check_eq(request.getResponseHeader("Cache-control"), "max-age=999999"); + + do_check_eq(buffer, ""); + run_test_content2a(); +} + +// Now same set of steps but this time for an immediately expiring content. + +function run_test_content2a() +{ + var chan = make_channel(URL + "/content2"); + caching = chan.QueryInterface(Ci.nsICachingChannel); + caching.cacheOnlyMetadata = true; + chan.asyncOpen(new ChannelListener(contentListener2a, null), null); +} + +function contentListener2a(request, buffer) +{ + do_check_eq(buffer, responseBody2a); + + asyncOpenCacheEntry(URL + "/content2", "disk", 0, null, cacheCheck2) +} + +function cacheCheck2(status, entry) +{ + do_check_eq(status, 0); + do_check_eq(entry.dataSize, 0); + try { + do_check_neq(entry.getMetaDataElement("response-head"), null); + do_check_true(entry.getMetaDataElement("response-head").match('Etag: testetag')); + } + catch (ex) { + do_throw("Missing response head"); + } + + var chan = make_channel(URL + "/content2"); + caching = chan.QueryInterface(Ci.nsICachingChannel); + caching.cacheOnlyMetadata = true; + chan.asyncOpen(new ChannelListener(contentListener2b, null), null); +} + +function contentListener2b(request, buffer) +{ + do_check_eq(buffer, responseBody2b); + + httpServer.stop(do_test_finished); +} diff --git a/netwerk/test/unit/xpcshell.ini b/netwerk/test/unit/xpcshell.ini index dfc2e5560dcc..0f4c5903afae 100644 --- a/netwerk/test/unit/xpcshell.ini +++ b/netwerk/test/unit/xpcshell.ini @@ -158,6 +158,7 @@ skip-if = os == "android" # Allocating 4GB might actually succeed on 64 bit machines skip-if = bits != 32 [test_bug935499.js] +[test_bug1064258.js] [test_udpsocket.js] [test_doomentry.js] [test_cacheflags.js] From b07d2488dba525765c821251f85df547113f7461 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Tue, 30 Sep 2014 10:07:05 -0400 Subject: [PATCH 68/93] Bug 1071241. Call ComputeRotation before TransformShadowTree. r=mwoodrow This is need so that the rotation transform is available at transform time. Without this rotation is delayed a frame. --- gfx/layers/ipc/CompositorParent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp index fa969feaf5dc..76894a2ca448 100644 --- a/gfx/layers/ipc/CompositorParent.cpp +++ b/gfx/layers/ipc/CompositorParent.cpp @@ -685,6 +685,8 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const nsIntRect* aRect) } } + mCompositionManager->ComputeRotation(); + TimeStamp time = mIsTesting ? mTestTime : mLastCompose; bool requestNextFrame = mCompositionManager->TransformShadowTree(time); if (requestNextFrame) { @@ -693,8 +695,6 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const nsIntRect* aRect) RenderTraceLayers(mLayerManager->GetRoot(), "0000"); - mCompositionManager->ComputeRotation(); - #ifdef MOZ_DUMP_PAINTING static bool gDumpCompositorTree = false; if (gDumpCompositorTree) { From b1016b8cfff19b592e781692b19dc485b13d2318 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Tue, 30 Sep 2014 06:45:00 -0400 Subject: [PATCH 69/93] Bug 995438 - Call SpecialPowers.pushPermissions() to ensure permission change is completed before continuing the rest of the tests. r=baku --- .../html/content/test/test_audio_wakelock.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/content/html/content/test/test_audio_wakelock.html b/content/html/content/test/test_audio_wakelock.html index 68c2f9662bf3..e81fa3d49aa6 100644 --- a/content/html/content/test/test_audio_wakelock.html +++ b/content/html/content/test/test_audio_wakelock.html @@ -39,7 +39,7 @@ function testAudioPlayPause() { audio.pause(); }); - navigator.mozPower.addWakeLockListener(function testAudioPlayListener(topic, state) { + function testAudioPlayListener(topic, state) { is(topic, "cpu", "Audio element locked the target == cpu"); var locked = state == "locked-foreground" || state == "locked-background"; @@ -58,8 +58,9 @@ function testAudioPlayPause() { navigator.mozPower.removeWakeLockListener(testAudioPlayListener); runTests(); } - }); + }; + navigator.mozPower.addWakeLockListener(testAudioPlayListener); audio.play(); } @@ -78,7 +79,7 @@ function testAudioPlay() { startDate = new Date(); }); - navigator.mozPower.addWakeLockListener(function testAudioPlayListener(topic, state) { + function testAudioPlayListener(topic, state) { is(topic, "cpu", "Audio element locked the target == cpu"); var locked = state == "locked-foreground" || state == "locked-background"; @@ -101,8 +102,9 @@ function testAudioPlay() { navigator.mozPower.removeWakeLockListener(testAudioPlayListener); runTests(); } - }); + }; + navigator.mozPower.addWakeLockListener(testAudioPlayListener); audio.play(); } @@ -117,8 +119,11 @@ function runTests() { test(); }; -SpecialPowers.addPermission("power", true, document); -SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests); +SpecialPowers.pushPermissions( + [{'type': 'power', 'allow': true, 'context': document}], + function() { + SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests); + }); SimpleTest.waitForExplicitFinish(); From d0b4ed6358bb6403a6325152d6ec91061beb4d07 Mon Sep 17 00:00:00 2001 From: ziyunfei <446240525@qq.com> Date: Fri, 26 Sep 2014 03:32:00 -0400 Subject: [PATCH 70/93] Bug 1073446 - Object.preventExtensions() should return its argument with no conversion when the argument is a primitive value. r=till --- js/src/builtin/Object.cpp | 12 +++++++---- js/src/jit-test/tests/asm.js/bug885976.js | 2 +- .../jit-test/tests/asm.js/testStackWalking.js | 2 +- .../tests/ecma_6/Object/preventExtensions.js | 21 +++++++++++++++++++ 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 js/src/tests/ecma_6/Object/preventExtensions.js diff --git a/js/src/builtin/Object.cpp b/js/src/builtin/Object.cpp index 66691951d04a..79ff568939bc 100644 --- a/js/src/builtin/Object.cpp +++ b/js/src/builtin/Object.cpp @@ -1034,15 +1034,19 @@ obj_isExtensible(JSContext *cx, unsigned argc, Value *vp) return true; } +// ES6 draft rev27 (2014/08/24) 19.1.2.15 Object.preventExtensions(O) static bool obj_preventExtensions(JSContext *cx, unsigned argc, Value *vp) { CallArgs args = CallArgsFromVp(argc, vp); - RootedObject obj(cx); - if (!GetFirstArgumentAsObject(cx, args, "Object.preventExtensions", &obj)) - return false; + args.rval().set(args.get(0)); - args.rval().setObject(*obj); + // step 1 + if (!args.get(0).isObject()) + return true; + + // steps 2-5 + RootedObject obj(cx, &args.get(0).toObject()); return JSObject::preventExtensions(cx, obj); } diff --git a/js/src/jit-test/tests/asm.js/bug885976.js b/js/src/jit-test/tests/asm.js/bug885976.js index e0997b40327e..303a8d07f256 100644 --- a/js/src/jit-test/tests/asm.js/bug885976.js +++ b/js/src/jit-test/tests/asm.js/bug885976.js @@ -8,5 +8,5 @@ function test(stdlib, foreign) { } return f; }; -f = test(this, {ff: Object.preventExtensions}); +f = test(this, {ff: Object.defineProperty}); f(); diff --git a/js/src/jit-test/tests/asm.js/testStackWalking.js b/js/src/jit-test/tests/asm.js/testStackWalking.js index bce11adbb117..dfda4d8c9240 100644 --- a/js/src/jit-test/tests/asm.js/testStackWalking.js +++ b/js/src/jit-test/tests/asm.js/testStackWalking.js @@ -65,7 +65,7 @@ assertEq(caught, true); var caught = false; try { - callFFI(null, {ffi:Object.preventExtensions})(); + callFFI(null, {ffi:Object.defineProperty})(); } catch (e) { caught = true; } diff --git a/js/src/tests/ecma_6/Object/preventExtensions.js b/js/src/tests/ecma_6/Object/preventExtensions.js new file mode 100644 index 000000000000..75c8ed3db597 --- /dev/null +++ b/js/src/tests/ecma_6/Object/preventExtensions.js @@ -0,0 +1,21 @@ +/* + * Any copyright is dedicated to the Public Domain. + * https://creativecommons.org/publicdomain/zero/1.0/ + */ + +var BUGNUMBER = 1073446; +var summary = "Object.preventExtensions() should return its argument with no conversion when the argument is a primitive value"; + +print(BUGNUMBER + ": " + summary); +assertEq(Object.preventExtensions(), undefined); +assertEq(Object.preventExtensions(undefined), undefined); +assertEq(Object.preventExtensions(null), null); +assertEq(Object.preventExtensions(1), 1); +assertEq(Object.preventExtensions("foo"), "foo"); +assertEq(Object.preventExtensions(true), true); +if (typeof Symbol === "function") { + assertEq(Object.preventExtensions(Symbol.for("foo")), Symbol.for("foo")); +} + +if (typeof reportCompare === "function") + reportCompare(true, true); From 0ee6fc3ed10272d0b95b28a7328319217d3702f7 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Tue, 30 Sep 2014 10:35:17 -0400 Subject: [PATCH 71/93] Bug 1074420: handle repeated short audio DataCallback()s r=roc --- content/media/AudioBufferUtils.h | 5 ++ content/media/GraphDriver.cpp | 80 ++++++++++++++++++-------------- 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/content/media/AudioBufferUtils.h b/content/media/AudioBufferUtils.h index eb6e6a4c36c2..389927d7ac24 100644 --- a/content/media/AudioBufferUtils.h +++ b/content/media/AudioBufferUtils.h @@ -121,6 +121,11 @@ public: aBuffer.WriteFrames(mBuffer, framesToWrite); mPosition -= FramesToSamples(CHANNELS, framesToWrite); + // If we didn't empty the spill buffer for some reason, shift the remaining data down + if (mPosition > 0) { + PodMove(mBuffer, mBuffer + FramesToSamples(CHANNELS, framesToWrite), + mPosition); + } return framesToWrite; } diff --git a/content/media/GraphDriver.cpp b/content/media/GraphDriver.cpp index 4b98c896480f..1c87f168bf91 100644 --- a/content/media/GraphDriver.cpp +++ b/content/media/GraphDriver.cpp @@ -805,53 +805,61 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aBuffer, long aFrames) if (!mIterationDurationMS) { mIterationDurationMS = durationMS; } else { - mIterationDurationMS += durationMS; - mIterationDurationMS /= 2; + mIterationDurationMS = (mIterationDurationMS*3) + durationMS; + mIterationDurationMS /= 4; } mBuffer.SetBuffer(aBuffer, aFrames); - + // fill part or all with leftover data from last iteration (since we + // align to Audio blocks) mScratchBuffer.Empty(mBuffer); + // if we totally filled the buffer (and mScratchBuffer isn't empty), + // we don't need to run an iteration and if we do so we may overflow. + if (mBuffer.Available()) { - mStateComputedTime = mNextStateComputedTime; + mStateComputedTime = mNextStateComputedTime; - // State computed time is decided by the audio callback's buffer length. We - // compute the iteration start and end from there, trying to keep the amount - // of buffering in the graph constant. - mNextStateComputedTime = - mGraphImpl->RoundUpToNextAudioBlock(mStateComputedTime + mBuffer.Available()); + // State computed time is decided by the audio callback's buffer length. We + // compute the iteration start and end from there, trying to keep the amount + // of buffering in the graph constant. + mNextStateComputedTime = + mGraphImpl->RoundUpToNextAudioBlock(mStateComputedTime + mBuffer.Available()); - mIterationStart = mIterationEnd; - // inGraph is the number of audio frames there is between the state time and - // the current time, i.e. the maximum theoretical length of the interval we - // could use as [mIterationStart; mIterationEnd]. - GraphTime inGraph = mStateComputedTime - mIterationStart; - // We want the interval [mIterationStart; mIterationEnd] to be before the - // interval [mStateComputedTime; mNextStateComputedTime]. We also want - // the distance between these intervals to be roughly equivalent each time, to - // ensure there is no clock drift between current time and state time. Since - // we can't act on the state time because we have to fill the audio buffer, we - // reclock the current time against the state time, here. - mIterationEnd = mIterationStart + 0.8 * inGraph; + mIterationStart = mIterationEnd; + // inGraph is the number of audio frames there is between the state time and + // the current time, i.e. the maximum theoretical length of the interval we + // could use as [mIterationStart; mIterationEnd]. + GraphTime inGraph = mStateComputedTime - mIterationStart; + // We want the interval [mIterationStart; mIterationEnd] to be before the + // interval [mStateComputedTime; mNextStateComputedTime]. We also want + // the distance between these intervals to be roughly equivalent each time, to + // ensure there is no clock drift between current time and state time. Since + // we can't act on the state time because we have to fill the audio buffer, we + // reclock the current time against the state time, here. + mIterationEnd = mIterationStart + 0.8 * inGraph; - STREAM_LOG(PR_LOG_DEBUG, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n", - (long)mIterationStart, (long)mIterationEnd, - (long)mStateComputedTime, (long)mNextStateComputedTime, - (long)aFrames, (uint32_t)durationMS, - (long)(mNextStateComputedTime - mStateComputedTime))); + STREAM_LOG(PR_LOG_DEBUG, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n", + (long)mIterationStart, (long)mIterationEnd, + (long)mStateComputedTime, (long)mNextStateComputedTime, + (long)aFrames, (uint32_t)durationMS, + (long)(mNextStateComputedTime - mStateComputedTime))); - mCurrentTimeStamp = TimeStamp::Now(); + mCurrentTimeStamp = TimeStamp::Now(); - if (mStateComputedTime < mIterationEnd) { - STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected")); - mIterationEnd = mStateComputedTime; + if (mStateComputedTime < mIterationEnd) { + STREAM_LOG(PR_LOG_WARNING, ("Media graph global underrun detected")); + mIterationEnd = mStateComputedTime; + } + + stillProcessing = mGraphImpl->OneIteration(mIterationStart, + mIterationEnd, + mStateComputedTime, + mNextStateComputedTime); + } else { + NS_WARNING("DataCallback buffer filled entirely from scratch buffer, skipping iteration."); + stillProcessing = true; } - stillProcessing = mGraphImpl->OneIteration(mIterationStart, - mIterationEnd, - mStateComputedTime, - mNextStateComputedTime); - mBuffer.BufferFilled(); if (mNextDriver && stillProcessing) { @@ -896,7 +904,7 @@ AudioCallbackDriver::MixerCallback(AudioDataValue* aMixedBuffer, uint32_t toWrite = mBuffer.Available(); if (!mBuffer.Available()) { - NS_WARNING("MediaStreamGraph SpillBuffer full, expect frame drop."); + NS_WARNING("DataCallback buffer full, expect frame drops."); } MOZ_ASSERT(mBuffer.Available() <= aFrames); From 673f3a21d474c810c314aa3dc4073aea026fef26 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Thu, 25 Sep 2014 14:01:10 -0400 Subject: [PATCH 72/93] Bug 1073086. Remove broken snapping code. r=mwoodrow We generate a Rect from integers and then round them to do the snapping. - Rect rect(r->x, r->y, r->width, r->height); - - rect.Round(); This accomplishes nothing. Just rip it out. --HG-- extra : rebase_source : 3194652ca83f2e66ae1cbd02573ab86c444bd2fb --- gfx/layers/RotatedBuffer.cpp | 2 +- gfx/thebes/gfxUtils.cpp | 51 +++++++----------------------------- gfx/thebes/gfxUtils.h | 5 ---- 3 files changed, 11 insertions(+), 47 deletions(-) diff --git a/gfx/layers/RotatedBuffer.cpp b/gfx/layers/RotatedBuffer.cpp index fbf23bf1a384..abe5c267b951 100644 --- a/gfx/layers/RotatedBuffer.cpp +++ b/gfx/layers/RotatedBuffer.cpp @@ -229,7 +229,7 @@ RotatedContentBuffer::DrawTo(PaintedLayer* aLayer, // Bug 599189 if there is a non-integer-translation transform in aTarget, // we might sample pixels outside GetEffectiveVisibleRegion(), which is wrong // and may cause gray lines. - gfxUtils::ClipToRegionSnapped(aTarget, aLayer->GetEffectiveVisibleRegion()); + gfxUtils::ClipToRegion(aTarget, aLayer->GetEffectiveVisibleRegion()); clipped = true; } diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index a1cb27d0b6ef..8670be50d351 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -665,50 +665,25 @@ ClipToRegionInternal(gfxContext* aContext, const nsIntRegion& aRegion, } static TemporaryRef -PathFromRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion, - bool aSnap) +PathFromRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion) { - Matrix mat = aTarget->GetTransform(); - const gfxFloat epsilon = 0.000001; -#define WITHIN_E(a,b) (fabs((a)-(b)) < epsilon) - // We're essentially duplicating the logic in UserToDevicePixelSnapped here. - bool shouldNotSnap = !aSnap || (WITHIN_E(mat._11,1.0) && - WITHIN_E(mat._22,1.0) && - WITHIN_E(mat._12,0.0) && - WITHIN_E(mat._21,0.0)); -#undef WITHIN_E - RefPtr pb = aTarget->CreatePathBuilder(); nsIntRegionRectIterator iter(aRegion); const nsIntRect* r; - if (shouldNotSnap) { - while ((r = iter.Next()) != nullptr) { - pb->MoveTo(Point(r->x, r->y)); - pb->LineTo(Point(r->XMost(), r->y)); - pb->LineTo(Point(r->XMost(), r->YMost())); - pb->LineTo(Point(r->x, r->YMost())); - pb->Close(); - } - } else { - while ((r = iter.Next()) != nullptr) { - Rect rect(r->x, r->y, r->width, r->height); - - rect.Round(); - pb->MoveTo(rect.TopLeft()); - pb->LineTo(rect.TopRight()); - pb->LineTo(rect.BottomRight()); - pb->LineTo(rect.BottomLeft()); - pb->Close(); - } + while ((r = iter.Next()) != nullptr) { + pb->MoveTo(Point(r->x, r->y)); + pb->LineTo(Point(r->XMost(), r->y)); + pb->LineTo(Point(r->XMost(), r->YMost())); + pb->LineTo(Point(r->x, r->YMost())); + pb->Close(); } RefPtr path = pb->Finish(); return path; } static void -ClipToRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion, - bool aSnap) +ClipToRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion) { if (!aRegion.IsComplex()) { nsIntRect rect = aRegion.GetBounds(); @@ -716,7 +691,7 @@ ClipToRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion, return; } - RefPtr path = PathFromRegionInternal(aTarget, aRegion, aSnap); + RefPtr path = PathFromRegionInternal(aTarget, aRegion); aTarget->PushClip(path); } @@ -729,7 +704,7 @@ gfxUtils::ClipToRegion(gfxContext* aContext, const nsIntRegion& aRegion) /*static*/ void gfxUtils::ClipToRegion(DrawTarget* aTarget, const nsIntRegion& aRegion) { - ClipToRegionInternal(aTarget, aRegion, false); + ClipToRegionInternal(aTarget, aRegion); } /*static*/ void @@ -738,12 +713,6 @@ gfxUtils::ClipToRegionSnapped(gfxContext* aContext, const nsIntRegion& aRegion) ClipToRegionInternal(aContext, aRegion, true); } -/*static*/ void -gfxUtils::ClipToRegionSnapped(DrawTarget* aTarget, const nsIntRegion& aRegion) -{ - ClipToRegionInternal(aTarget, aRegion, true); -} - /*static*/ gfxFloat gfxUtils::ClampToScaleFactor(gfxFloat aVal) { diff --git a/gfx/thebes/gfxUtils.h b/gfx/thebes/gfxUtils.h index 476ad40273e7..176435f2a8f4 100644 --- a/gfx/thebes/gfxUtils.h +++ b/gfx/thebes/gfxUtils.h @@ -99,11 +99,6 @@ public: */ static void ClipToRegionSnapped(gfxContext* aContext, const nsIntRegion& aRegion); - /** - * Clip aTarget to the region aRegion, snapping the rectangles. - */ - static void ClipToRegionSnapped(mozilla::gfx::DrawTarget* aTarget, const nsIntRegion& aRegion); - /** * Create a path consisting of rectangles in |aRegion|. */ From 3bbb8fd4bd07f517cdf78efd98d6cbd17fd282f7 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Tue, 30 Sep 2014 16:48:06 +0100 Subject: [PATCH 73/93] Backed out changeset 12a04a66d5c1 (bug 1051658) --- content/media/MediaDecoderStateMachine.cpp | 38 +++++++--------------- content/media/MediaDecoderStateMachine.h | 3 -- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/content/media/MediaDecoderStateMachine.cpp b/content/media/MediaDecoderStateMachine.cpp index fd837e1f52d3..e959a051a3a4 100644 --- a/content/media/MediaDecoderStateMachine.cpp +++ b/content/media/MediaDecoderStateMachine.cpp @@ -1154,9 +1154,9 @@ void MediaDecoderStateMachine::StartPlayback() SetPlayStartTime(TimeStamp::Now()); NS_ASSERTION(IsPlaying(), "Should report playing by end of StartPlayback()"); - nsresult rv = StartAudioThread(); - NS_ENSURE_SUCCESS_VOID(rv); - + if (NS_FAILED(StartAudioThread())) { + DECODER_WARN("Failed to create audio thread"); + } mDecoder->GetReentrantMonitor().NotifyAll(); mDecoder->UpdateStreamBlockingForStateMachinePlaying(); DispatchDecodeTasksIfNeeded(); @@ -1791,12 +1791,15 @@ MediaDecoderStateMachine::StartAudioThread() mStopAudioThread = false; if (HasAudio() && !mAudioSink) { mAudioCompleted = false; - mAudioSink = new AudioSink(this, mAudioStartTime, - mInfo.mAudio, mDecoder->GetAudioChannel()); - // OnAudioSinkError() will be called before Init() returns if an error - // occurs during initialization. + mAudioSink = new AudioSink(this, + mAudioStartTime, mInfo.mAudio, mDecoder->GetAudioChannel()); nsresult rv = mAudioSink->Init(); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(rv)) { + DECODER_WARN("Changed state to SHUTDOWN because audio sink initialization failed"); + SetState(DECODER_STATE_SHUTDOWN); + mScheduler->ScheduleAndShutdown(); + return rv; + } mAudioSink->SetVolume(mVolume); mAudioSink->SetPlaybackRate(mPlaybackRate); @@ -3121,25 +3124,6 @@ void MediaDecoderStateMachine::OnAudioSinkComplete() mDecoder->GetReentrantMonitor().NotifyAll(); } -void MediaDecoderStateMachine::OnAudioSinkError() -{ - AssertCurrentThreadInMonitor(); - // AudioSink not used with captured streams, so ignore errors in this case. - if (mAudioCaptured) { - return; - } - - mAudioCompleted = true; - - // Notify media decoder/element about this error. - RefPtr task( - NS_NewRunnableMethod(this, &MediaDecoderStateMachine::OnDecodeError)); - nsresult rv = mDecodeTaskQueue->Dispatch(task); - if (NS_FAILED(rv)) { - DECODER_WARN("Failed to dispatch OnDecodeError"); - } -} - } // namespace mozilla // avoid redefined macro in unified build diff --git a/content/media/MediaDecoderStateMachine.h b/content/media/MediaDecoderStateMachine.h index 42b91e005f52..cdf8be438a91 100644 --- a/content/media/MediaDecoderStateMachine.h +++ b/content/media/MediaDecoderStateMachine.h @@ -636,9 +636,6 @@ protected: // and the sink is shutting down. void OnAudioSinkComplete(); - // Called by the AudioSink to signal errors. - void OnAudioSinkError(); - // The decoder object that created this state machine. The state machine // holds a strong reference to the decoder to ensure that the decoder stays // alive once media element has started the decoder shutdown process, and has From 18024b59af66065a939b6d6dcc9daab325268a77 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Tue, 30 Sep 2014 16:48:29 +0100 Subject: [PATCH 74/93] Backed out changeset aaae54a77270 (bug 1051658) for timeouts in test_bug465498.html on OS X --- content/media/AudioSink.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/content/media/AudioSink.cpp b/content/media/AudioSink.cpp index 2bb20c61b9e2..9d85dadbcb2b 100644 --- a/content/media/AudioSink.cpp +++ b/content/media/AudioSink.cpp @@ -55,18 +55,10 @@ AudioSink::Init() nullptr, MEDIA_THREAD_STACK_SIZE); if (NS_FAILED(rv)) { - mStateMachine->OnAudioSinkError(); return rv; } - nsCOMPtr event = NS_NewRunnableMethod(this, &AudioSink::AudioLoop); - rv = mThread->Dispatch(event, NS_DISPATCH_NORMAL); - if (NS_FAILED(rv)) { - mStateMachine->OnAudioSinkError(); - return rv; - } - - return NS_OK; + return mThread->Dispatch(event, NS_DISPATCH_NORMAL); } int64_t @@ -146,8 +138,6 @@ AudioSink::AudioLoop() if (NS_FAILED(InitializeAudioStream())) { NS_WARNING("Initializing AudioStream failed."); - ReentrantMonitorAutoEnter mon(GetReentrantMonitor()); - mStateMachine->OnAudioSinkError(); return; } @@ -207,13 +197,10 @@ AudioSink::InitializeAudioStream() // circumstances, so we take care to drop the decoder monitor while // initializing. RefPtr audioStream(new AudioStream()); - nsresult rv = audioStream->Init(mInfo.mChannels, mInfo.mRate, - mChannel, AudioStream::HighLatency); - if (NS_FAILED(rv)) { - audioStream->Shutdown(); - return rv; - } - + audioStream->Init(mInfo.mChannels, mInfo.mRate, + mChannel, AudioStream::HighLatency); + // TODO: Check Init's return value and bail on error. Unfortunately this + // causes some tests to fail due to playback failing. ReentrantMonitorAutoEnter mon(GetReentrantMonitor()); mAudioStream = audioStream; UpdateStreamSettings(); From ee090394fb594483ae0a39b3f2c2d65a9bba5f23 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Mon, 29 Sep 2014 17:57:54 +0200 Subject: [PATCH 75/93] Bug 1060736: Disable all acceleration on HD 3000 for driver versions 2321 or lower. r=nical --- widget/windows/GfxInfo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index 4bbb2ce09045..95421de31c80 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -976,12 +976,12 @@ GfxInfo::GetGfxDriverInfo() DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions ); /** - * Disable D2D on Intel HD 3000 for graphics drivers <= 8.15.10.2321. - * See bug 1018278. + * Disable acceleration on Intel HD 3000 for graphics drivers <= 8.15.10.2321. + * See bug 1018278 and bug 1060736. */ APPEND_TO_DRIVER_BLOCKLIST( DRIVER_OS_ALL, (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*) GfxDriverInfo::GetDeviceFamily(IntelHD3000), - nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, + GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN_OR_EQUAL, V(8,15,10,2321), "8.15.10.2342" ); /* Disable D2D on Win7 on Intel HD Graphics on driver <= 8.15.10.2302 From 20ab143e76e83da377243ee459211b144cc54605 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Tue, 30 Sep 2014 17:51:09 +0200 Subject: [PATCH 76/93] Bug 1074272: Use exception mode 0 for our D3D11 devices. r=jrmuizel --- gfx/thebes/gfxWindowsPlatform.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 18d7129dd795..06ea34b91fc5 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -1537,6 +1537,8 @@ gfxWindowsPlatform::InitD3D11Devices() return; } + mD3D11Device->SetExceptionMode(0); + #ifdef USE_D2D1_1 if (Factory::SupportsD2D1()) { hr = d3d11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr, @@ -1549,6 +1551,8 @@ gfxWindowsPlatform::InitD3D11Devices() return; } + mD3D11ContentDevice->SetExceptionMode(0); + Factory::SetDirect3D11Device(mD3D11ContentDevice); } #endif From 6c1e283ef715c36adfa4abbf4ce66edd960adc75 Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Tue, 30 Sep 2014 12:05:53 -0400 Subject: [PATCH 77/93] Bug 1071771, disable dictionary list when it cannot be accessed from another process. This makes the context menu work again after using it on a misspelled word, r=mconley --- browser/base/content/nsContextMenu.js | 3 ++- toolkit/modules/InlineSpellChecker.jsm | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index fcc4e50eb8f9..548f4372ae00 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -384,7 +384,8 @@ nsContextMenu.prototype = { if (canSpell) { var dictMenu = document.getElementById("spell-dictionaries-menu"); var dictSep = document.getElementById("spell-language-separator"); - InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep); + let count = InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep); + this.showItem(dictSep, count > 0); this.showItem("spell-add-dictionaries-main", false); } else if (this.onEditableArea) { diff --git a/toolkit/modules/InlineSpellChecker.jsm b/toolkit/modules/InlineSpellChecker.jsm index 917ea0561589..8c63133148b3 100644 --- a/toolkit/modules/InlineSpellChecker.jsm +++ b/toolkit/modules/InlineSpellChecker.jsm @@ -159,6 +159,11 @@ InlineSpellChecker.prototype = { if (! this.mInlineSpellChecker || ! this.enabled) return 0; var spellchecker = this.mInlineSpellChecker.spellChecker; + + // Cannot access the dictionary list from another process so just return 0. + if (Components.utils.isCrossProcessWrapper(spellchecker)) + return 0; + var o1 = {}, o2 = {}; spellchecker.GetDictionaryList(o1, o2); var list = o1.value; From 71e745a13cec79b495c16bf59f237c8091c963ec Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Sep 2014 18:07:18 +0200 Subject: [PATCH 78/93] Bug 1068725: Add the FBirds SIMD demo to the test suite; r=luke --- js/src/jit-test/tests/asm.js/simd-fbirds.js | 210 ++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 js/src/jit-test/tests/asm.js/simd-fbirds.js diff --git a/js/src/jit-test/tests/asm.js/simd-fbirds.js b/js/src/jit-test/tests/asm.js/simd-fbirds.js new file mode 100644 index 000000000000..deb76a2bda30 --- /dev/null +++ b/js/src/jit-test/tests/asm.js/simd-fbirds.js @@ -0,0 +1,210 @@ +/* -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level : 2 ; js-curly-indent-offset: 0 -*- */ +/* vim: set ts=4 et sw=4 tw=80: */ + +// Author: Peter Jensen + +load(libdir + "asm.js"); +if (!isSimdAvailable() || typeof SIMD === 'undefined') { + print("won't run tests as simd extensions aren't activated yet"); + quit(0); +} + +const NUM_BIRDS = 30; +const NUM_UPDATES = 20; +const ACCEL_DATA_STEPS = 30; + +var buffer = new ArrayBuffer(0x200000); +var bufferF32 = new Float32Array(buffer); + +var actualBirds = 0; + +function init() { + actualBirds = 0; + // Make it a power of two, for quick modulo wrapping. + var accelDataValues = [10.0, 9.5, 9.0, 8.0, 7.0, 6.0, 5.5, 5.0, 5.0, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0, 10.0]; + accelDataValues = accelDataValues.map(function(v) { return 50*v; }); + var accelDataValuesLength = accelDataValues.length; + assertEq(accelDataValuesLength, 16); // Hard coded in the asm.js module + for (i = 0; i < accelDataValuesLength; i++) + bufferF32[i + NUM_BIRDS * 2] = accelDataValues[i]; +} + +function addBird(pos, vel) { + bufferF32[actualBirds] = pos; + bufferF32[actualBirds + NUM_BIRDS] = vel; + actualBirds++; + return actualBirds - 1; +} + +function getActualBirds() { + return actualBirds; +} + +var code = ` + "use asm"; + var toF = global.Math.fround; + var f32 = new global.Float32Array(buffer); + const maxBirds = 100000; + const maxBirdsx4 = 400000; + const maxBirdsx4Plus4 = 400004; + const maxBirdsx4Plus8 = 400008; + const maxBirdsx4Plus12 = 400012; + const maxBirdsx8 = 800000; + const accelMask = 0x3c; + const mk2 = 0x000ffffc; + + const getMaxPos = 1000.0; + const getAccelDataSteps = imp.accelDataSteps | 0; + var getActualBirds = imp.getActualBirds; + + var i4 = global.SIMD.int32x4; + var f4 = global.SIMD.float32x4; + var i4add = i4.add; + var i4and = i4.and; + var f4select = f4.select; + var f4add = f4.add; + var f4sub = f4.sub; + var f4mul = f4.mul; + var f4greaterThan = f4.greaterThan; + var f4splat = f4.splat; + + const zerox4 = f4(0.0,0.0,0.0,0.0); + + function declareHeapSize() { + f32[0x0007ffff] = toF(0.0); + } + + function update(timeDelta) { + timeDelta = toF(timeDelta); + // var steps = Math.ceil(timeDelta/accelData.interval); + var steps = 0; + var subTimeDelta = toF(0.0); + var actualBirds = 0; + var maxPos = toF(0.0); + var maxPosx4 = f4(0.0,0.0,0.0,0.0); + var subTimeDeltax4 = f4(0.0,0.0,0.0,0.0); + var subTimeDeltaSquaredx4 = f4(0.0,0.0,0.0,0.0); + var point5x4 = f4(0.5, 0.5, 0.5, 0.5); + var i = 0; + var len = 0; + var accelIndex = 0; + var newPosx4 = f4(0.0,0.0,0.0,0.0); + var newVelx4 = f4(0.0,0.0,0.0,0.0); + var accel = toF(0.0); + var accelx4 = f4(0.0,0.0,0.0,0.0); + var a = 0; + var posDeltax4 = f4(0.0,0.0,0.0,0.0); + var cmpx4 = i4(0,0,0,0); + var newVelTruex4 = f4(0.0,0.0,0.0,0.0); + + steps = getAccelDataSteps | 0; + subTimeDelta = toF(toF(timeDelta / toF(steps | 0)) / toF(1000.0)); + actualBirds = getActualBirds() | 0; + maxPos = toF(+getMaxPos); + maxPosx4 = f4splat(maxPos); + subTimeDeltax4 = f4splat(subTimeDelta); + subTimeDeltaSquaredx4 = f4mul(subTimeDeltax4, subTimeDeltax4); + + len = ((actualBirds + 3) >> 2) << 4; + + for (i = 0; (i | 0) < (len | 0); i = (i + 16) | 0) { + accelIndex = 0; + // Work around unimplemented Float32x4Array + newPosx4 = f4(toF(f32[(i & mk2) >> 2]), + toF(f32[(i & mk2) + 4 >> 2]), + toF(f32[(i & mk2) + 8 >> 2]), + toF(f32[(i & mk2) + 12 >> 2])); + newVelx4 = f4(toF(f32[(i & mk2) + maxBirdsx4 >> 2]), + toF(f32[(i & mk2) + maxBirdsx4Plus4 >> 2]), + toF(f32[(i & mk2) + maxBirdsx4Plus8 >> 2]), + toF(f32[(i & mk2) + maxBirdsx4Plus12 >> 2])); + for (a = 0; (a | 0) < (steps | 0); a = (a + 1) | 0) { + accel = toF(f32[(accelIndex & accelMask) + maxBirdsx8 >> 2]); + accelx4 = f4splat(accel); + accelIndex = (accelIndex + 4) | 0; + posDeltax4 = f4mul(point5x4, f4mul(accelx4, subTimeDeltaSquaredx4)); + posDeltax4 = f4add(posDeltax4, f4mul(newVelx4, subTimeDeltax4)); + newPosx4 = f4add(newPosx4, posDeltax4); + newVelx4 = f4add(newVelx4, f4mul(accelx4, subTimeDeltax4)); + cmpx4 = f4greaterThan(newPosx4, maxPosx4); + + if (cmpx4.signMask) { + // Work around unimplemented 'neg' operation, using 0 - x. + newVelTruex4 = f4sub(zerox4, newVelx4); + newVelx4 = f4select(cmpx4, newVelTruex4, newVelx4); + } + } + // Work around unimplemented Float32x4Array + f32[(i & mk2) >> 2] = newPosx4.x; + f32[(i & mk2) + 4 >> 2] = newPosx4.y; + f32[(i & mk2) + 8 >> 2] = newPosx4.z; + f32[(i & mk2) + 12 >> 2] = newPosx4.w; + f32[(i & mk2) + maxBirdsx4 >> 2] = newVelx4.x; + f32[(i & mk2) + maxBirdsx4Plus4 >> 2] = newVelx4.y; + f32[(i & mk2) + maxBirdsx4Plus8 >> 2] = newVelx4.z; + f32[(i & mk2) + maxBirdsx4Plus12 >> 2] = newVelx4.w; + } + } + + return update; +` + +var ffi = { + getActualBirds, + accelDataSteps: ACCEL_DATA_STEPS +}; + +var fbirds = asmLink(asmCompile('global', 'imp', 'buffer', code), this, ffi, buffer); + +init(); +for (var i = 0; i < NUM_BIRDS; i++) { + addBird(i / 10, Math.exp(2, NUM_BIRDS - i)); +} + +var b = dateNow(); +for (var j = 0; j < NUM_UPDATES; j++) { + fbirds(16); +} +print(dateNow() - b); + +assertEq(bufferF32[0], 0); +assertEq(bufferF32[1], 0.10000000149011612); +assertEq(bufferF32[2], 0.20000000298023224); +assertEq(bufferF32[3], 0.30000001192092896); +assertEq(bufferF32[4], 0.4000000059604645); +assertEq(bufferF32[5], 0.5); +assertEq(bufferF32[6], 0.6000000238418579); +assertEq(bufferF32[7], 0.699999988079071); +assertEq(bufferF32[8], 0.800000011920929); +assertEq(bufferF32[9], 0.8999999761581421); +assertEq(bufferF32[10], 1); +assertEq(bufferF32[11], 1.100000023841858); +assertEq(bufferF32[12], 1.2000000476837158); +assertEq(bufferF32[13], 1.2999999523162842); +assertEq(bufferF32[14], 1.399999976158142); +assertEq(bufferF32[15], 1.5); +assertEq(bufferF32[16], 1.600000023841858); +assertEq(bufferF32[17], 1.7000000476837158); +assertEq(bufferF32[18], 1.7999999523162842); +assertEq(bufferF32[19], 1.899999976158142); +assertEq(bufferF32[20], 2); +assertEq(bufferF32[21], 2.0999999046325684); +assertEq(bufferF32[22], 2.200000047683716); +assertEq(bufferF32[23], 2.299999952316284); +assertEq(bufferF32[24], 2.4000000953674316); +assertEq(bufferF32[25], 2.5); +assertEq(bufferF32[26], 2.5999999046325684); +assertEq(bufferF32[27], 2.700000047683716); +assertEq(bufferF32[28], 2.799999952316284); +assertEq(bufferF32[29], 2.9000000953674316); + + +// Code used to generate the assertEq list above. +function generateAssertList() { + var buf = ''; + for (var k = 0; k < NUM_BIRDS; k++) { + buf += 'assertEq(bufferF32['+ k + '], ' + bufferF32[k] + ');\n'; + } + print(buf); +} +//generateAssertList(); From e381d1456da7626ee710e73a081964ec7a47fddd Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 30 Sep 2014 18:30:23 +0200 Subject: [PATCH 79/93] Bug 1072877 - Ensure OOP transactions can't use memory backed tile locks. r=bjacob --- gfx/layers/TiledLayerBuffer.h | 5 ++- gfx/layers/composite/TiledContentHost.cpp | 36 +++++++++++++++++-- gfx/layers/composite/TiledContentHost.h | 8 ++--- .../ipc/CompositableTransactionParent.cpp | 5 ++- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/gfx/layers/TiledLayerBuffer.h b/gfx/layers/TiledLayerBuffer.h index 9efb984a3db5..3f8617314223 100644 --- a/gfx/layers/TiledLayerBuffer.h +++ b/gfx/layers/TiledLayerBuffer.h @@ -222,8 +222,11 @@ public: * ReadLock state, so that the locks can be adopted when recreating a * ClientTiledLayerBuffer locally. This lock will be retained until the buffer * has completed uploading. + * + * Returns false if a deserialization error happened, in which case we will + * have to kill the child process. */ - virtual void UseTiledLayerBuffer(ISurfaceAllocator* aAllocator, + virtual bool UseTiledLayerBuffer(ISurfaceAllocator* aAllocator, const SurfaceDescriptorTiles& aTiledDescriptor) = 0; /** diff --git a/gfx/layers/composite/TiledContentHost.cpp b/gfx/layers/composite/TiledContentHost.cpp index 1222f1ae0f4d..5ff9e5b8049f 100644 --- a/gfx/layers/composite/TiledContentHost.cpp +++ b/gfx/layers/composite/TiledContentHost.cpp @@ -30,7 +30,7 @@ class Layer; TiledLayerBufferComposite::TiledLayerBufferComposite() : mFrameResolution(1.0) , mHasDoubleBufferedTiles(false) - , mUninitialized(true) + , mIsValid(false) {} /* static */ void @@ -43,7 +43,7 @@ TiledLayerBufferComposite::TiledLayerBufferComposite(ISurfaceAllocator* aAllocat const SurfaceDescriptorTiles& aDescriptor, const nsIntRegion& aOldPaintedRegion) { - mUninitialized = false; + mIsValid = true; mHasDoubleBufferedTiles = false; mValidRegion = aDescriptor.validRegion(); mPaintedRegion = aDescriptor.paintedRegion(); @@ -57,6 +57,8 @@ TiledLayerBufferComposite::TiledLayerBufferComposite(ISurfaceAllocator* aAllocat oldPaintedRegion.And(oldPaintedRegion, mValidRegion); mPaintedRegion.Or(mPaintedRegion, oldPaintedRegion); + bool isSameProcess = aAllocator->IsSameProcess(); + const InfallibleTArray& tiles = aDescriptor.tiles(); for(size_t i = 0; i < tiles.Length(); i++) { RefPtr texture; @@ -74,6 +76,17 @@ TiledLayerBufferComposite::TiledLayerBufferComposite(ISurfaceAllocator* aAllocat if (ipcLock.type() == TileLock::TShmemSection) { sharedLock = gfxShmSharedReadLock::Open(aAllocator, ipcLock.get_ShmemSection()); } else { + if (!isSameProcess) { + // Trying to use a memory based lock instead of a shmem based one in + // the cross-process case is a bad security violation. + NS_ERROR("A client process may be trying to peek at the host's address space!"); + // This tells the TiledContentHost that deserialization failed so that + // it can propagate the error. + mIsValid = false; + + mRetainedTiles.Clear(); + return; + } sharedLock = reinterpret_cast(ipcLock.get_uintptr_t()); if (sharedLock) { // The corresponding AddRef is in TiledClient::GetTileDescriptor @@ -287,7 +300,7 @@ TiledContentHost::Detach(Layer* aLayer, CompositableHost::Detach(aLayer,aFlags); } -void +bool TiledContentHost::UseTiledLayerBuffer(ISurfaceAllocator* aAllocator, const SurfaceDescriptorTiles& aTiledDescriptor) { @@ -310,6 +323,14 @@ TiledContentHost::UseTiledLayerBuffer(ISurfaceAllocator* aAllocator, mLowPrecisionTiledBuffer = TiledLayerBufferComposite(aAllocator, aTiledDescriptor, mLowPrecisionTiledBuffer.GetPaintedRegion()); + if (!mLowPrecisionTiledBuffer.IsValid()) { + // Something bad happened. Stop here, return false (kills the child process), + // and do as little work as possible on the received data as it appears + // to be corrupted. + mPendingLowPrecisionUpload = false; + mPendingUpload = false; + return false; + } } else { if (mPendingUpload) { mTiledBuffer.ReadUnlock(); @@ -322,7 +343,16 @@ TiledContentHost::UseTiledLayerBuffer(ISurfaceAllocator* aAllocator, } mTiledBuffer = TiledLayerBufferComposite(aAllocator, aTiledDescriptor, mTiledBuffer.GetPaintedRegion()); + if (!mTiledBuffer.IsValid()) { + // Something bad happened. Stop here, return false (kills the child process), + // and do as little work as possible on the received data as it appears + // to be corrupted. + mPendingLowPrecisionUpload = false; + mPendingUpload = false; + return false; + } } + return true; } void diff --git a/gfx/layers/composite/TiledContentHost.h b/gfx/layers/composite/TiledContentHost.h index 273e0ada7dcd..d3f117ac10a9 100644 --- a/gfx/layers/composite/TiledContentHost.h +++ b/gfx/layers/composite/TiledContentHost.h @@ -137,7 +137,7 @@ public: bool HasDoubleBufferedTiles() { return mHasDoubleBufferedTiles; } - bool IsValid() const { return !mUninitialized; } + bool IsValid() const { return mIsValid; } #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17 virtual void SetReleaseFence(const android::sp& aReleaseFence); @@ -162,7 +162,7 @@ protected: private: CSSToParentLayerScale mFrameResolution; bool mHasDoubleBufferedTiles; - bool mUninitialized; + bool mIsValid; }; /** @@ -215,8 +215,8 @@ public: return mLowPrecisionTiledBuffer.GetValidRegion(); } - void UseTiledLayerBuffer(ISurfaceAllocator* aAllocator, - const SurfaceDescriptorTiles& aTiledDescriptor); + virtual bool UseTiledLayerBuffer(ISurfaceAllocator* aAllocator, + const SurfaceDescriptorTiles& aTiledDescriptor) MOZ_OVERRIDE; void Composite(EffectChain& aEffectChain, float aOpacity, diff --git a/gfx/layers/ipc/CompositableTransactionParent.cpp b/gfx/layers/ipc/CompositableTransactionParent.cpp index c5f21413eb63..99be5058b66d 100644 --- a/gfx/layers/ipc/CompositableTransactionParent.cpp +++ b/gfx/layers/ipc/CompositableTransactionParent.cpp @@ -148,7 +148,10 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation NS_ASSERTION(tileComposer, "compositable is not a tile composer"); const SurfaceDescriptorTiles& tileDesc = op.tileLayerDescriptor(); - tileComposer->UseTiledLayerBuffer(this, tileDesc); + bool success = tileComposer->UseTiledLayerBuffer(this, tileDesc); + if (!success) { + return false; + } break; } case CompositableOperation::TOpRemoveTexture: { From 3a5312793bc1f0d1c62fec57254938a5ee8c6c88 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Tue, 30 Sep 2014 09:54:25 -0700 Subject: [PATCH 80/93] Bug 1067664, part 1 - Allow different leak thresholds for different types of processes. r=jmaher --- build/automationutils.py | 24 +++++++++++++++++++++--- layout/tools/reftest/remotereftest.py | 3 +++ layout/tools/reftest/runreftest.py | 14 ++++++++------ testing/mochitest/mochitest_options.py | 17 +++++++++++------ testing/mochitest/runtests.py | 2 +- testing/mochitest/runtestsb2g.py | 2 +- 6 files changed, 45 insertions(+), 17 deletions(-) diff --git a/build/automationutils.py b/build/automationutils.py index aa8f985d5919..76c17eb15ec8 100644 --- a/build/automationutils.py +++ b/build/automationutils.py @@ -311,7 +311,7 @@ def processSingleLeakFile(leakLogFileName, processType, leakThreshold): log.info("%s | leakcheck | %s %d bytes leaked (%s)" % (prefix, processString, totalBytesLeaked, leakedObjectSummary)) -def processLeakLog(leakLogFile, leakThreshold = 0): +def processLeakLog(leakLogFile, leakThresholds): """Process the leak log, including separate leak logs created by child processes. @@ -326,14 +326,28 @@ def processLeakLog(leakLogFile, leakThreshold = 0): optional. All other file names are treated as being for default processes. + + leakThresholds should be a dict mapping process types to leak thresholds, + in bytes. If a process type is not present in the dict the threshold + will be 0. """ if not os.path.exists(leakLogFile): log.info("WARNING | leakcheck | refcount logging is off, so leaks can't be detected!") return - if leakThreshold != 0: - log.info("TEST-INFO | leakcheck | threshold set at %d bytes" % leakThreshold) + # This list is based on kGeckoProcessTypeString. ipdlunittest processes likely + # are not going to produce leak logs we will ever see. + knownProcessTypes = ["default", "plugin", "tab", "geckomediaplugin"] + + for processType in knownProcessTypes: + log.info("TEST-INFO | leakcheck | %s process: leak threshold set at %d bytes" + % (processType, leakThresholds.get(processType, 0))) + + for processType in leakThresholds: + if not processType in knownProcessTypes: + log.info("TEST-UNEXPECTED-FAIL | leakcheck | Unknown process type %s in leakThresholds" + % processType) (leakLogFileDir, leakFileBase) = os.path.split(leakLogFile) if leakFileBase[-4:] == ".log": @@ -350,6 +364,10 @@ def processLeakLog(leakLogFile, leakThreshold = 0): processType = m.group(1) else: processType = "default" + if not processType in knownProcessTypes: + log.info("TEST-UNEXPECTED-FAIL | leakcheck | Leak log with unknown process type %s" + % processType) + leakThreshold = leakThresholds.get(processType, 0) processSingleLeakFile(thisFile, processType, leakThreshold) def replaceBackSlashes(input): diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index 64651d37a633..8327ef064999 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -162,6 +162,9 @@ class RemoteOptions(ReftestOptions): if not options.httpdPath: options.httpdPath = os.path.join(options.utilityPath, "components") + # Android does not run leak tests, but set some reasonable defaults to avoid errors. + options.leakThresholds = {} + # TODO: Copied from main, but I think these are no longer used in a post xulrunner world #options.xrePath = options.remoteTestRoot + self.automation._product + '/xulrunner' #options.utilityPath = options.testRoot + self.automation._product + '/bin' diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py index 875348570fcb..c36b218d5c84 100644 --- a/layout/tools/reftest/runreftest.py +++ b/layout/tools/reftest/runreftest.py @@ -344,7 +344,7 @@ class RefTest(object): # give the JS harness 30 seconds to deal # with its own timeouts timeout=options.timeout + 30.0) - processLeakLog(self.leakLogFile, options.leakThreshold) + processLeakLog(self.leakLogFile, options.leakThresholds) self.automation.log.info("\nREFTEST INFO | runreftest.py | Running tests: end.") finally: self.cleanup(profileDir) @@ -394,12 +394,12 @@ class ReftestOptions(OptionParser): default = 5 * 60, # 5 minutes per bug 479518 help = "reftest will timeout in specified number of seconds. [default %default s].") self.add_option("--leak-threshold", - action = "store", type = "int", dest = "leakThreshold", + action = "store", type = "int", dest = "defaultLeakThreshold", default = 0, - help = "fail if the number of bytes leaked through " - "refcounted objects (or bytes in classes with " - "MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) is greater " - "than the given number") + help = "fail if the number of bytes leaked in default " + "processes through refcounted objects (or bytes " + "in classes with MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) " + "is greater than the given number") self.add_option("--utility-path", action = "store", type = "string", dest = "utilityPath", default = self.automation.DIST_BIN, @@ -511,6 +511,8 @@ class ReftestOptions(OptionParser): if options.debugger is not None: self.error("cannot specify a debugger with parallel tests") + options.leakThresholds = {"default": options.defaultLeakThreshold} + return options def main(): diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index cd2f9147afff..4b259c442bee 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -223,12 +223,12 @@ class MochitestOptions(optparse.OptionParser): [["--leak-threshold"], { "action": "store", "type": "int", - "dest": "leakThreshold", + "dest": "defaultLeakThreshold", "metavar": "THRESHOLD", - "help": "fail if the number of bytes leaked through " - "refcounted objects (or bytes in classes with " - "MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) is greater " - "than the given number", + "help": "fail if the number of bytes leaked in default " + "processes through refcounted objects (or bytes " + "in classes with MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) " + "is greater than the given number", "default": 0, }], [["--fatal-assertions"], @@ -610,6 +610,11 @@ class MochitestOptions(optparse.OptionParser): if not os.path.isfile(f): self.error('Missing binary %s required for --use-test-media-devices') + options.leakThresholds = { + "default": options.defaultLeakThreshold, + "tab": 10000, # See dependencies of bug 1051230. + } + return options @@ -767,7 +772,7 @@ class B2GOptions(MochitestOptions): defaults["testPath"] = "" defaults["extensionsToExclude"] = ["specialpowers"] # See dependencies of bug 1038943. - defaults["leakThreshold"] = 5180 + defaults["defaultLeakThreshold"] = 5180 self.set_defaults(**defaults) def verifyRemoteOptions(self, options): diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index f9bd5fb5c33f..c85ad35d0a16 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -1842,7 +1842,7 @@ class Mochitest(MochitestUtilsMixin): self.stopVMwareRecording(); self.stopServers() - processLeakLog(self.leak_report_file, options.leakThreshold) + processLeakLog(self.leak_report_file, options.leakThresholds) if self.nsprLogs: with zipfile.ZipFile("%s/nsprlog.zip" % browserEnv["MOZ_UPLOAD_DIR"], "w", zipfile.ZIP_DEFLATED) as logzip: diff --git a/testing/mochitest/runtestsb2g.py b/testing/mochitest/runtestsb2g.py index b9010e6d7b15..5d32e09d7b66 100644 --- a/testing/mochitest/runtestsb2g.py +++ b/testing/mochitest/runtestsb2g.py @@ -202,7 +202,7 @@ class B2GMochitest(MochitestUtilsMixin): self.app_ctx.dm.getFile(self.leak_report_file, local_leak_file.name) self.app_ctx.dm.removeFile(self.leak_report_file) - processLeakLog(local_leak_file.name, options.leakThreshold) + processLeakLog(local_leak_file.name, options.leakThresholds) except KeyboardInterrupt: self.log.info("runtests.py | Received keyboard interrupt.\n"); status = -1 From f699010d294dced58ecb190cddca524cf1b57c81 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Tue, 30 Sep 2014 09:54:25 -0700 Subject: [PATCH 81/93] Bug 1067664, part 2 - Stop ignoring tab process leaks. r=jmaher --- build/automationutils.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/build/automationutils.py b/build/automationutils.py index 76c17eb15ec8..dd9027ce5493 100644 --- a/build/automationutils.py +++ b/build/automationutils.py @@ -286,14 +286,9 @@ def processSingleLeakFile(leakLogFileName, processType, leakThreshold): # totalBytesLeaked was seen and is non-zero. if totalBytesLeaked > leakThreshold: - if processType == "tab": - # For now, ignore tab process leaks. See bug 1051230. - log.info("WARNING | leakcheck | ignoring leaks in tab process") - prefix = "WARNING" - else: - logAsWarning = True - # Fail the run if we're over the threshold (which defaults to 0) - prefix = "TEST-UNEXPECTED-FAIL" + logAsWarning = True + # Fail the run if we're over the threshold (which defaults to 0) + prefix = "TEST-UNEXPECTED-FAIL" else: prefix = "WARNING" # Create a comma delimited string of the first N leaked objects found, From bb45bd3e0a992202f51ecaa4a2c3ad7506682660 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 30 Sep 2014 12:57:52 -0400 Subject: [PATCH 82/93] Bug 864327 - Support FM RDS in WebAPI, r=ehsan,pzhang,khuey --- content/base/src/nsGkAtomList.h | 7 + dom/fmradio/FMRadio.cpp | 119 +++++++++ dom/fmradio/FMRadio.h | 28 ++ dom/fmradio/FMRadioCommon.h | 8 +- dom/fmradio/FMRadioService.cpp | 415 ++++++++++++++++++++++++++++++ dom/fmradio/FMRadioService.h | 49 ++++ dom/fmradio/ipc/FMRadioChild.cpp | 163 ++++++++++++ dom/fmradio/ipc/FMRadioChild.h | 39 +++ dom/fmradio/ipc/FMRadioParent.cpp | 51 ++++ dom/fmradio/ipc/FMRadioParent.h | 3 + dom/fmradio/ipc/PFMRadio.ipdl | 39 +++ dom/webidl/FMRadio.webidl | 78 ++++++ 12 files changed, 998 insertions(+), 1 deletion(-) diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index 91be00fa25fd..3ee09b4b8c77 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -796,6 +796,7 @@ GK_ATOM(onMozMousePixelScroll, "onMozMousePixelScroll") GK_ATOM(onMozScrolledAreaChanged, "onMozScrolledAreaChanged") GK_ATOM(onmoznetworkupload, "onmoznetworkupload") GK_ATOM(onmoznetworkdownload, "onmoznetworkdownload") +GK_ATOM(onnewrdsgroup, "onnewrdsgroup") GK_ATOM(onnoupdate, "onnoupdate") GK_ATOM(onobsolete, "onobsolete") GK_ATOM(ononline, "ononline") @@ -812,11 +813,16 @@ GK_ATOM(onpairingconfirmationreq, "onpairingconfirmationreq") GK_ATOM(onpairingconsentreq, "onpairingconsentreq") GK_ATOM(onpaste, "onpaste") GK_ATOM(onpendingchange, "onpendingchange") +GK_ATOM(onpichange, "onpichange") GK_ATOM(onpopuphidden, "onpopuphidden") GK_ATOM(onpopuphiding, "onpopuphiding") GK_ATOM(onpopupshowing, "onpopupshowing") GK_ATOM(onpopupshown, "onpopupshown") +GK_ATOM(onpschange, "onpschange") +GK_ATOM(onptychange, "onptychange") GK_ATOM(onradiostatechange, "onradiostatechange") +GK_ATOM(onrdsdisabled, "onrdsdisabled") +GK_ATOM(onrdsenabled, "onrdsenabled") GK_ATOM(onreaderror, "onreaderror") GK_ATOM(onreadsuccess, "onreadsuccess") GK_ATOM(onready, "onready") @@ -831,6 +837,7 @@ GK_ATOM(onrequestmediaplaystatus, "onrequestmediaplaystatus") GK_ATOM(onreset, "onreset") GK_ATOM(onresuming, "onresuming") GK_ATOM(onresize, "onresize") +GK_ATOM(onrtchange, "onrtchange") GK_ATOM(onscostatuschanged, "onscostatuschanged") GK_ATOM(onscroll, "onscroll") GK_ATOM(onselect, "onselect") diff --git a/dom/fmradio/FMRadio.cpp b/dom/fmradio/FMRadio.cpp index ada434208ba9..54b62a9ca69c 100644 --- a/dom/fmradio/FMRadio.cpp +++ b/dom/fmradio/FMRadio.cpp @@ -13,6 +13,7 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/PFMRadioChild.h" #include "mozilla/dom/FMRadioService.h" +#include "mozilla/dom/TypedArray.h" #include "DOMRequest.h" #include "nsDOMClassInfo.h" #include "nsIDocShell.h" @@ -105,6 +106,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(FMRadioRequest, DOMRequest) FMRadio::FMRadio() : mHeadphoneState(SWITCH_STATE_OFF) + , mRdsGroupMask(0) , mAudioChannelAgentEnabled(false) , mHasInternalAntenna(false) , mIsShutdown(false) @@ -220,6 +222,28 @@ FMRadio::Notify(const FMRadioEventType& aType) DispatchTrustedEvent(NS_LITERAL_STRING("disabled")); } break; + case RDSEnabledChanged: + if (RdsEnabled()) { + DispatchTrustedEvent(NS_LITERAL_STRING("rdsenabled")); + } else { + DispatchTrustedEvent(NS_LITERAL_STRING("rdsdisabled")); + } + break; + case PIChanged: + DispatchTrustedEvent(NS_LITERAL_STRING("pichange")); + break; + case PSChanged: + DispatchTrustedEvent(NS_LITERAL_STRING("pschange")); + break; + case RadiotextChanged: + DispatchTrustedEvent(NS_LITERAL_STRING("rtchange")); + break; + case PTYChanged: + DispatchTrustedEvent(NS_LITERAL_STRING("ptychange")); + break; + case NewRDSGroup: + DispatchTrustedEvent(NS_LITERAL_STRING("newrdsgroup")); + break; default: MOZ_CRASH(); } @@ -232,6 +256,12 @@ FMRadio::Enabled() return IFMRadioService::Singleton()->IsEnabled(); } +bool +FMRadio::RdsEnabled() +{ + return IFMRadioService::Singleton()->IsRDSEnabled(); +} + bool FMRadio::AntennaAvailable() const { @@ -265,6 +295,69 @@ FMRadio::ChannelWidth() const return IFMRadioService::Singleton()->GetChannelWidth(); } +uint32_t +FMRadio::RdsGroupMask() const +{ + return mRdsGroupMask; +} + +void +FMRadio::SetRdsGroupMask(uint32_t aRdsGroupMask) +{ + mRdsGroupMask = aRdsGroupMask; + IFMRadioService::Singleton()->SetRDSGroupMask(aRdsGroupMask); +} + +Nullable +FMRadio::GetPi() const +{ + return IFMRadioService::Singleton()->GetPi(); +} + +Nullable +FMRadio::GetPty() const +{ + return IFMRadioService::Singleton()->GetPty(); +} + +void +FMRadio::GetPs(DOMString& aPsname) const +{ + if (!IFMRadioService::Singleton()->GetPs(aPsname)) { + aPsname.SetNull(); + } +} + +void +FMRadio::GetRt(DOMString& aRadiotext) const +{ + if (!IFMRadioService::Singleton()->GetRt(aRadiotext)) { + aRadiotext.SetNull(); + } +} + +void +FMRadio::GetRdsgroup(JSContext* cx, JS::MutableHandle retval) +{ + uint64_t group; + if (!IFMRadioService::Singleton()->GetRdsgroup(group)) { + return; + } + + JSObject *rdsgroup = Uint16Array::Create(cx, this, 4); + uint16_t *data = JS_GetUint16ArrayData(rdsgroup); + data[3] = group & 0xFFFF; + group >>= 16; + data[2] = group & 0xFFFF; + group >>= 16; + data[1] = group & 0xFFFF; + group >>= 16; + data[0] = group & 0xFFFF; + + JS::ExposeObjectToActiveJS(rdsgroup); + retval.set(rdsgroup); +} + already_AddRefed FMRadio::Enable(double aFrequency) { @@ -350,6 +443,32 @@ FMRadio::CancelSeek() return r.forget(); } +already_AddRefed +FMRadio::EnableRDS() +{ + nsCOMPtr win = GetOwner(); + if (!win) { + return nullptr; + } + + nsRefPtr r = new FMRadioRequest(win, this); + IFMRadioService::Singleton()->EnableRDS(r); + return r.forget(); +} + +already_AddRefed +FMRadio::DisableRDS() +{ + nsCOMPtr win = GetOwner(); + if (!win) { + return nullptr; + } + + nsRefPtr r = new FMRadioRequest(win, this); + FMRadioService::Singleton()->DisableRDS(r); + return r.forget(); +} + NS_IMETHODIMP FMRadio::HandleEvent(nsIDOMEvent* aEvent) { diff --git a/dom/fmradio/FMRadio.h b/dom/fmradio/FMRadio.h index f6daf0c7cc80..140f05314400 100644 --- a/dom/fmradio/FMRadio.h +++ b/dom/fmradio/FMRadio.h @@ -55,6 +55,8 @@ public: static bool Enabled(); + bool RdsEnabled(); + bool AntennaAvailable() const; Nullable GetFrequency() const; @@ -65,6 +67,20 @@ public: double ChannelWidth() const; + uint32_t RdsGroupMask() const; + + void SetRdsGroupMask(uint32_t aRdsGroupMask); + + Nullable GetPi() const; + + Nullable GetPty() const; + + void GetPs(DOMString& aPsname) const; + + void GetRt(DOMString& aRadiotext) const; + + void GetRdsgroup(JSContext* cx, JS::MutableHandle retval); + already_AddRefed Enable(double aFrequency); already_AddRefed Disable(); @@ -77,10 +93,21 @@ public: already_AddRefed CancelSeek(); + already_AddRefed EnableRDS(); + + already_AddRefed DisableRDS(); + IMPL_EVENT_HANDLER(enabled); IMPL_EVENT_HANDLER(disabled); + IMPL_EVENT_HANDLER(rdsenabled); + IMPL_EVENT_HANDLER(rdsdisabled); IMPL_EVENT_HANDLER(antennaavailablechange); IMPL_EVENT_HANDLER(frequencychange); + IMPL_EVENT_HANDLER(pichange); + IMPL_EVENT_HANDLER(ptychange); + IMPL_EVENT_HANDLER(pschange); + IMPL_EVENT_HANDLER(rtchange); + IMPL_EVENT_HANDLER(newrdsgroup); // nsIDOMEventListener NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent); @@ -92,6 +119,7 @@ private: void EnableAudioChannelAgent(); hal::SwitchState mHeadphoneState; + uint32_t mRdsGroupMask; bool mAudioChannelAgentEnabled; bool mHasInternalAntenna; bool mIsShutdown; diff --git a/dom/fmradio/FMRadioCommon.h b/dom/fmradio/FMRadioCommon.h index 42fc690adb7d..b8d8325f7418 100644 --- a/dom/fmradio/FMRadioCommon.h +++ b/dom/fmradio/FMRadioCommon.h @@ -30,7 +30,13 @@ BEGIN_FMRADIO_NAMESPACE enum FMRadioEventType { FrequencyChanged, - EnabledChanged + EnabledChanged, + RDSEnabledChanged, + PIChanged, + PSChanged, + PTYChanged, + RadiotextChanged, + NewRDSGroup }; typedef mozilla::Observer FMRadioEventObserver; diff --git a/dom/fmradio/FMRadioService.cpp b/dom/fmradio/FMRadioService.cpp index e80a278ce951..3a198624df82 100644 --- a/dom/fmradio/FMRadioService.cpp +++ b/dom/fmradio/FMRadioService.cpp @@ -26,6 +26,8 @@ #define MOZSETTINGS_CHANGED_ID "mozsettings-changed" #define SETTING_KEY_AIRPLANEMODE_ENABLED "airplaneMode.enabled" +#define DOM_PARSED_RDS_GROUPS ((0x2 << 30) | (0x3 << 4) | (0x3 << 0)) + using namespace mozilla::hal; using mozilla::Preferences; @@ -49,9 +51,26 @@ FMRadioService::FMRadioService() , mState(Disabled) , mHasReadAirplaneModeSetting(false) , mAirplaneModeEnabled(false) + , mRDSEnabled(false) , mPendingRequest(nullptr) , mObserverList(FMRadioEventObserverList()) + , mRDSGroupMask(0) + , mLastPI(0) + , mPI(0) + , mPTY(0) + , mPISet(false) + , mPTYSet(false) + , mRDSLock("FMRadioService::mRDSLock") + , mPSNameState(0) + , mRadiotextAB(false) + , mRDSGroupSet(false) + , mPSNameSet(false) + , mRadiotextSet(false) { + memset(mPSName, 0, sizeof(mPSName)); + memset(mRadiotext, 0, sizeof(mRadiotext)); + memset(mTempPSName, 0, sizeof(mTempPSName)); + memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); // Read power state and frequency from Hal. mEnabled = IsFMRadioOn(); @@ -110,10 +129,12 @@ FMRadioService::FMRadioService() } RegisterFMRadioObserver(this); + RegisterFMRadioRDSObserver(this); } FMRadioService::~FMRadioService() { + UnregisterFMRadioRDSObserver(this); UnregisterFMRadioObserver(this); } @@ -277,6 +298,21 @@ private: FMRadioSeekDirection mDirection; }; +class NotifyRunnable MOZ_FINAL : public nsRunnable +{ +public: + NotifyRunnable(FMRadioEventType aType) : mType(aType) { } + + NS_IMETHOD Run() + { + FMRadioService::Singleton()->NotifyFMRadioEvent(mType); + return NS_OK; + } + +private: + FMRadioEventType mType; +}; + void FMRadioService::TransitionState(const FMRadioResponseType& aResponse, FMRadioState aState) @@ -374,6 +410,13 @@ FMRadioService::IsEnabled() const return IsFMRadioOn(); } +bool +FMRadioService::IsRDSEnabled() const +{ + MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); + return mRDSEnabled; +} + double FMRadioService::GetFrequency() const { @@ -407,6 +450,54 @@ FMRadioService::GetChannelWidth() const return mChannelWidthInKHz / 1000.0; } +Nullable +FMRadioService::GetPi() const +{ + MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); + if (!mPISet) { + return Nullable(); + } + return Nullable(mPI); +} + +Nullable +FMRadioService::GetPty() const +{ + MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); + if (!mPTYSet) { + return Nullable(); + } + return Nullable(mPTY); +} + +bool +FMRadioService::GetPs(nsString& aPSName) +{ + MutexAutoLock lock(mRDSLock); + if (mPSNameSet) { + aPSName = nsString(mPSName); + } + return mPSNameSet; +} + +bool +FMRadioService::GetRt(nsString& aRadiotext) +{ + MutexAutoLock lock(mRDSLock); + if (mRadiotextSet) { + aRadiotext = nsString(mRadiotext); + } + return mRadiotextSet; +} + +bool +FMRadioService::GetRdsgroup(uint64_t& aRDSGroup) +{ + MutexAutoLock lock(mRDSLock); + aRDSGroup = mRDSGroup; + return mRDSGroupSet; +} + void FMRadioService::Enable(double aFrequencyInMHz, FMRadioReplyRunnable* aReplyRunnable) @@ -679,6 +770,47 @@ FMRadioService::CancelSeek(FMRadioReplyRunnable* aReplyRunnable) NS_DispatchToMainThread(aReplyRunnable); } +void +FMRadioService::SetRDSGroupMask(uint32_t aRDSGroupMask) +{ + mRDSGroupMask = aRDSGroupMask; + if (IsFMRadioOn()) { + hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS); + } +} + +void +FMRadioService::EnableRDS(FMRadioReplyRunnable* aReplyRunnable) +{ + MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); + MOZ_ASSERT(aReplyRunnable); + + mRDSEnabled = true; + if (IsFMRadioOn()) { + hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS); + } + + aReplyRunnable->SetReply(SuccessResponse()); + NS_DispatchToMainThread(aReplyRunnable); + NS_DispatchToMainThread(new NotifyRunnable(RDSEnabledChanged)); +} + +void +FMRadioService::DisableRDS(FMRadioReplyRunnable* aReplyRunnable) +{ + MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); + MOZ_ASSERT(aReplyRunnable); + + mRDSEnabled = false; + if (IsFMRadioOn()) { + hal::DisableRDS(); + } + + aReplyRunnable->SetReply(SuccessResponse()); + NS_DispatchToMainThread(aReplyRunnable); + NS_DispatchToMainThread(new NotifyRunnable(RDSEnabledChanged)); +} + NS_IMETHODIMP FMRadioService::Observe(nsISupports* aSubject, const char* aTopic, @@ -760,10 +892,18 @@ FMRadioService::Notify(const FMRadioOperationInformation& aInfo) // The frequency was changed from '0' to some meaningful number, so we // should send the `FrequencyChanged` event manually. NotifyFMRadioEvent(FrequencyChanged); + + if (mRDSEnabled) { + hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS); + } break; case FM_RADIO_OPERATION_DISABLE: MOZ_ASSERT(mState == Disabling); + mPISet = false; + mPTYSet = false; + memset(mPSName, 0, sizeof(mPSName)); + memset(mRadiotext, 0, sizeof(mRadiotext)); TransitionState(SuccessResponse(), Disabled); UpdatePowerState(); break; @@ -785,6 +925,274 @@ FMRadioService::Notify(const FMRadioOperationInformation& aInfo) } } +/* This is defined by the RDS standard */ +static const uint16_t sRDSToUnicodeMap[256] = { + // The lower half differs from ASCII in 0x1F, 0x24, 0x5E, 0x7E + // Most control characters are replaced with 0x20 (space) + // 0x0- + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0009, 0x000A, 0x000B, 0x0020, 0x00D0, 0x0020, 0x0020, + + // 0x1- + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x001B, 0x0020, 0x0020, 0x0020, 0x00AD, + + // 0x2- + 0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + + // 0x3- + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + + // 0x4- + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, + 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, + + // 0x5- + 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, + 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x2015, 0x005F, + + // 0x6- + 0x2551, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + + // 0x7- + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x00AF, 0x007F, + + // 0x8- + 0x00E1, 0x00E0, 0x00E9, 0x00E8, 0x00ED, 0x00EC, 0x00F3, 0x00F2, + 0x00FA, 0x00F9, 0x00D1, 0x00C7, 0x015E, 0x00DF, 0x00A1, 0x0132, + + // 0x9- + 0x00E2, 0x00E4, 0x00EA, 0x00EB, 0x00EE, 0x00EF, 0x00F4, 0x00F6, + 0x00FB, 0x00FC, 0x00F1, 0x00E7, 0x015F, 0x011F, 0x0131, 0x0133, + + // 0xA- + 0x00AA, 0x03B1, 0x00A9, 0x2030, 0x011E, 0x011B, 0x0148, 0x0151, + 0x03C0, 0x20AC, 0x00A3, 0x0024, 0x2190, 0x2191, 0x2192, 0x2193, + + // 0xB- + 0x00BA, 0x00B9, 0x00B2, 0x00B3, 0x00B1, 0x0130, 0x0144, 0x0171, + 0x03BC, 0x00BF, 0x00F7, 0x00B0, 0x00BC, 0x00BD, 0x00BE, 0x00A7, + + // 0xC- + 0x00C1, 0x00C0, 0x00C9, 0x00C8, 0x00CD, 0x00CC, 0x00D3, 0x00D2, + 0x00DA, 0x00D9, 0x0158, 0x010C, 0x0160, 0x017D, 0x00D0, 0x013F, + + // 0xD- + 0x00C2, 0x00C4, 0x00CA, 0x00CB, 0x00CE, 0x00CF, 0x00D4, 0x00D6, + 0x00DB, 0x00DC, 0x0159, 0x010D, 0x0161, 0x017E, 0x0111, 0x0140, + + // 0xE- + 0x00C3, 0x00C5, 0x00C6, 0x0152, 0x0177, 0x00DD, 0x00D5, 0x00D8, + 0x00DE, 0x014A, 0x0154, 0x0106, 0x015A, 0x0179, 0x0166, 0x00F0, + + // 0xF- + 0x00E3, 0x00E5, 0x00E6, 0x0153, 0x0175, 0x00FD, 0x00F5, 0x00F8, + 0x00FE, 0x014B, 0x0155, 0x0107, 0x015B, 0x017A, 0x0167, 0x0020, +}; + +void +FMRadioService::Notify(const FMRadioRDSGroup& aRDSGroup) +{ + uint16_t blocks[4]; + blocks[0] = aRDSGroup.blockA(); + blocks[1] = aRDSGroup.blockB(); + blocks[2] = aRDSGroup.blockC(); + blocks[3] = aRDSGroup.blockD(); + + /* Bit 11 in block B determines whether this is a type B group. */ + uint16_t lastPI = blocks[1] & (1 << 11) ? blocks[2] : mLastPI; + + /* Update PI if it's not set or if we get two PI with the new value. */ + if ((mPI != blocks[0] && lastPI == blocks[0]) || !mPISet) { + mPI = blocks[0]; + if (!mPISet) { + mPSNameState = 0; + mRadiotextState = 0; + memset(mTempPSName, 0, sizeof(mTempPSName)); + memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); + } + mPISet = true; + NS_DispatchToMainThread(new NotifyRunnable(PIChanged)); + } + mLastPI = blocks[0]; + + /* PTY is also updated using the same logic as PI */ + uint16_t pty = (blocks[1] >> 5) & 0x1F; + if ((mPTY != pty && pty == mLastPTY) || !mPTYSet) { + mPTY = pty; + mPTYSet = true; + NS_DispatchToMainThread(new NotifyRunnable(PTYChanged)); + } + mLastPTY = pty; + + uint16_t grouptype = blocks[1] >> 11; + switch (grouptype) { + case 0: // 0a + case 1: // 0b + { + uint16_t segmentAddr = (blocks[1] & 0x3); + // mPSNameState is a bitmask that lets us ensure all segments + // are received before updating the PS name. + if (!segmentAddr) { + mPSNameState = 1; + } else { + mPSNameState |= 1 << segmentAddr; + } + + uint16_t offset = segmentAddr << 1; + mTempPSName[offset] = sRDSToUnicodeMap[blocks[3] >> 8]; + mTempPSName[offset + 1] = sRDSToUnicodeMap[blocks[3] & 0xFF]; + + if (mPSNameState != 0xF) { + break; + } + + mPSNameState = 0; + if (memcmp(mTempPSName, mPSName, sizeof(mTempPSName))) { + MutexAutoLock lock(mRDSLock); + mPSNameSet = true; + memcpy(mPSName, mTempPSName, sizeof(mTempPSName)); + NS_DispatchToMainThread(new NotifyRunnable(PSChanged)); + } + break; + } + case 4: // 2a Radiotext + { + uint16_t segmentAddr = (blocks[1] & 0xF); + bool textAB = blocks[1] & (1 << 5); + if (textAB != mRadiotextAB) { + mRadiotextState = 0; + memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); + mRadiotextAB = textAB; + MutexAutoLock lock(mRDSLock); + memset(mRadiotext, 0, sizeof(mRadiotext)); + NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); + } + + // mRadiotextState is a bitmask that lets us ensure all segments + // are received before updating the radiotext. + if (!segmentAddr) { + mRadiotextState = 1; + } else { + mRadiotextState |= 1 << segmentAddr; + } + + uint8_t segment[4]; + segment[0] = blocks[2] >> 8; + segment[1] = blocks[2] & 0xFF; + segment[2] = blocks[3] >> 8; + segment[3] = blocks[3] & 0xFF; + + uint16_t offset = segmentAddr << 2; + bool done = false; + for (int i = 0; i < 4; i++) { + if (segment[i] == '\r') { + mTempRadiotext[offset++] = 0; + done = true; + } else { + mTempRadiotext[offset++] = sRDSToUnicodeMap[segment[i]]; + } + } + if (offset == 64) { + done = true; + } + + if (!done || + (mRadiotextState + 1) != (1 << ((blocks[1] & 0xF) + 1)) || + !memcmp(mTempRadiotext, mRadiotext, sizeof(mTempRadiotext))) { + break; + } + + MutexAutoLock lock(mRDSLock); + mRadiotextSet = true; + memcpy(mRadiotext, mTempRadiotext, sizeof(mTempRadiotext)); + NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); + break; + } + case 5: // 2b Radiotext + { + uint16_t segmentAddr = (blocks[1] & 0xF); + bool textAB = blocks[1] & (1 << 5); + if (textAB != mRadiotextAB) { + mRadiotextState = 0; + memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); + mRadiotextAB = textAB; + MutexAutoLock lock(mRDSLock); + memset(mRadiotext, 0, sizeof(mRadiotext)); + NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); + } + + if (!segmentAddr) { + mRadiotextState = 1; + } else { + mRadiotextState |= 1 << segmentAddr; + } + uint8_t segment[2]; + segment[0] = blocks[3] >> 8; + segment[1] = blocks[3] & 0xFF; + + uint16_t offset = segmentAddr << 1; + bool done = false; + for (int i = 0; i < 2; i++) { + if (segment[i] == '\r') { + mTempRadiotext[offset++] = 0; + done = true; + } else { + mTempRadiotext[offset++] = sRDSToUnicodeMap[segment[i]]; + } + } + if (offset == 32) { + done = true; + } + + if (!done || + (mRadiotextState + 1) != (1 << ((blocks[1] & 0xF) + 1)) || + !memcmp(mTempRadiotext, mRadiotext, sizeof(mTempRadiotext))) { + break; + } + + MutexAutoLock lock(mRDSLock); + mRadiotextSet = true; + memcpy(mRadiotext, mTempRadiotext, sizeof(mTempRadiotext)); + NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); + break; + } + case 31: // 15b Fast Tuning and Switching + { + uint16_t secondPty = (blocks[3] >> 5) & 0x1F; + if (pty == mPTY || pty != secondPty) { + break; + } + mPTY = pty; + NS_DispatchToMainThread(new NotifyRunnable(PTYChanged)); + break; + } + } + + // Only notify users of raw RDS groups that they're interested in. + // We always receive DOM_PARSED_RDS_GROUPS when RDS is enabled. + if (!(mRDSGroupMask & (1 << grouptype))) { + return; + } + + uint64_t newgroup = blocks[0]; + newgroup <<= 16; + newgroup |= blocks[1]; + newgroup <<= 16; + newgroup |= blocks[2]; + newgroup <<= 16; + newgroup |= blocks[3]; + + MutexAutoLock lock(mRDSLock); + mRDSGroup = newgroup; + mRDSGroupSet = true; + NS_DispatchToMainThread(new NotifyRunnable(NewRDSGroup)); +} + void FMRadioService::UpdatePowerState() { @@ -802,6 +1210,13 @@ FMRadioService::UpdateFrequency() if (mPendingFrequencyInKHz != frequency) { mPendingFrequencyInKHz = frequency; NotifyFMRadioEvent(FrequencyChanged); + mPISet = false; + mPTYSet = false; + memset(mPSName, 0, sizeof(mPSName)); + memset(mRadiotext, 0, sizeof(mRadiotext)); + mRDSGroupSet = false; + mPSNameSet = false; + mRadiotextSet = false; } } diff --git a/dom/fmradio/FMRadioService.h b/dom/fmradio/FMRadioService.h index eb9666545d2e..836ef2601003 100644 --- a/dom/fmradio/FMRadioService.h +++ b/dom/fmradio/FMRadioService.h @@ -7,9 +7,11 @@ #ifndef mozilla_dom_fmradioservice_h__ #define mozilla_dom_fmradioservice_h__ +#include "mozilla/dom/Nullable.h" #include "mozilla/dom/PFMRadioRequest.h" #include "FMRadioCommon.h" #include "mozilla/Hal.h" +#include "mozilla/Mutex.h" #include "mozilla/StaticPtr.h" #include "mozilla/Services.h" #include "nsThreadUtils.h" @@ -95,10 +97,16 @@ protected: public: virtual bool IsEnabled() const = 0; + virtual bool IsRDSEnabled() const = 0; virtual double GetFrequency() const = 0; virtual double GetFrequencyUpperBound() const = 0; virtual double GetFrequencyLowerBound() const = 0; virtual double GetChannelWidth() const = 0; + virtual Nullable GetPi() const = 0; + virtual Nullable GetPty() const = 0; + virtual bool GetPs(nsString& aPsname) = 0; + virtual bool GetRt(nsString& aRadiotext) = 0; + virtual bool GetRdsgroup(uint64_t& aRDSGroup) = 0; virtual void Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) = 0; virtual void Disable(FMRadioReplyRunnable* aReplyRunnable) = 0; @@ -106,6 +114,9 @@ public: virtual void Seek(mozilla::hal::FMRadioSeekDirection aDirection, FMRadioReplyRunnable* aReplyRunnable) = 0; virtual void CancelSeek(FMRadioReplyRunnable* aReplyRunnable) = 0; + virtual void SetRDSGroupMask(uint32_t aRDSGroupMask) = 0; + virtual void EnableRDS(FMRadioReplyRunnable* aReplyRunnable) = 0; + virtual void DisableRDS(FMRadioReplyRunnable* aReplyRunnable) = 0; /** * Register handler to receive the FM Radio events, including: @@ -138,11 +149,13 @@ enum FMRadioState class FMRadioService MOZ_FINAL : public IFMRadioService , public hal::FMRadioObserver + , public hal::FMRadioRDSObserver , public nsIObserver { friend class ReadAirplaneModeSettingTask; friend class EnableRunnable; friend class DisableRunnable; + friend class NotifyRunnable; public: static FMRadioService* Singleton(); @@ -151,10 +164,16 @@ public: NS_DECL_ISUPPORTS virtual bool IsEnabled() const MOZ_OVERRIDE; + virtual bool IsRDSEnabled() const MOZ_OVERRIDE; virtual double GetFrequency() const MOZ_OVERRIDE; virtual double GetFrequencyUpperBound() const MOZ_OVERRIDE; virtual double GetFrequencyLowerBound() const MOZ_OVERRIDE; virtual double GetChannelWidth() const MOZ_OVERRIDE; + virtual Nullable GetPi() const MOZ_OVERRIDE; + virtual Nullable GetPty() const MOZ_OVERRIDE; + virtual bool GetPs(nsString& aPsname) MOZ_OVERRIDE; + virtual bool GetRt(nsString& aRadiotext) MOZ_OVERRIDE; + virtual bool GetRdsgroup(uint64_t& aRDSGroup) MOZ_OVERRIDE; virtual void Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; @@ -164,6 +183,9 @@ public: virtual void Seek(mozilla::hal::FMRadioSeekDirection aDirection, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void CancelSeek(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; + virtual void SetRDSGroupMask(uint32_t aRDSGroupMask) MOZ_OVERRIDE; + virtual void EnableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; + virtual void DisableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void AddObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; virtual void RemoveObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; @@ -172,6 +194,8 @@ public: /* FMRadioObserver */ void Notify(const hal::FMRadioOperationInformation& aInfo) MOZ_OVERRIDE; + /* FMRadioRDSObserver */ + void Notify(const hal::FMRadioRDSGroup& aRDSGroup) MOZ_OVERRIDE; NS_DECL_NSIOBSERVER @@ -197,6 +221,7 @@ private: bool mHasReadAirplaneModeSetting; bool mAirplaneModeEnabled; + bool mRDSEnabled; uint32_t mUpperBoundInKHz; uint32_t mLowerBoundInKHz; @@ -209,6 +234,30 @@ private: FMRadioEventObserverList mObserverList; static StaticRefPtr sFMRadioService; + + uint32_t mRDSGroupMask; + + uint16_t mLastPI; + uint16_t mLastPTY; + Atomic mPI; + Atomic mPTY; + Atomic mPISet; + Atomic mPTYSet; + + /* Protects mPSName, mRadiotext, and mRDSGroup */ + Mutex mRDSLock; + char16_t mPSName[9]; + char16_t mRadiotext[65]; + uint64_t mRDSGroup; + + uint8_t mPSNameState; + uint16_t mRadiotextState; + uint16_t mTempPSName[8]; + uint16_t mTempRadiotext[64]; + bool mRadiotextAB; + bool mRDSGroupSet; + bool mPSNameSet; + bool mRadiotextSet; }; END_FMRADIO_NAMESPACE diff --git a/dom/fmradio/ipc/FMRadioChild.cpp b/dom/fmradio/ipc/FMRadioChild.cpp index 0433bfce199a..f74fda4e1832 100644 --- a/dom/fmradio/ipc/FMRadioChild.cpp +++ b/dom/fmradio/ipc/FMRadioChild.cpp @@ -16,7 +16,13 @@ StaticAutoPtr FMRadioChild::sFMRadioChild; FMRadioChild::FMRadioChild() : mEnabled(false) + , mRDSEnabled(false) + , mRDSGroupSet(false) + , mPSNameSet(false) + , mRadiotextSet(false) , mFrequency(0) + , mRDSGroup(0) + , mRDSGroupMask(0) , mObserverList(FMRadioEventObserverList()) { MOZ_COUNT_CTOR(FMRadioChild); @@ -44,6 +50,12 @@ FMRadioChild::IsEnabled() const return mEnabled; } +bool +FMRadioChild::IsRDSEnabled() const +{ + return mRDSEnabled; +} + double FMRadioChild::GetFrequency() const { @@ -69,6 +81,43 @@ FMRadioChild::GetChannelWidth() const return mChannelWidth; } +Nullable +FMRadioChild::GetPi() const +{ + return mPI; +} + +Nullable +FMRadioChild::GetPty() const +{ + return mPTY; +} + +bool +FMRadioChild::GetPs(nsString& aPSName) +{ + if (mPSNameSet) { + aPSName = mPSName; + } + return mPSNameSet; +} + +bool +FMRadioChild::GetRt(nsString& aRadiotext) +{ + if (mRadiotextSet) { + aRadiotext = mRadiotext; + } + return mRadiotextSet; +} + +bool +FMRadioChild::GetRdsgroup(uint64_t& aRDSGroup) +{ + aRDSGroup = mRDSGroup; + return mRDSGroupSet; +} + void FMRadioChild::Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) { @@ -101,6 +150,25 @@ FMRadioChild::CancelSeek(FMRadioReplyRunnable* aReplyRunnable) SendRequest(aReplyRunnable, CancelSeekRequestArgs()); } +void +FMRadioChild::SetRDSGroupMask(uint32_t aRDSGroupMask) +{ + mRDSGroupMask = aRDSGroupMask; + SendSetRDSGroupMask(aRDSGroupMask); +} + +void +FMRadioChild::EnableRDS(FMRadioReplyRunnable* aReplyRunnable) +{ + SendRequest(aReplyRunnable, EnableRDSArgs()); +} + +void +FMRadioChild::DisableRDS(FMRadioReplyRunnable* aReplyRunnable) +{ + SendRequest(aReplyRunnable, DisableRDSArgs()); +} + inline void FMRadioChild::NotifyFMRadioEvent(FMRadioEventType aType) { @@ -132,6 +200,26 @@ FMRadioChild::RecvNotifyFrequencyChanged(const double& aFrequency) { mFrequency = aFrequency; NotifyFMRadioEvent(FrequencyChanged); + + if (!mPI.IsNull()) { + mPI.SetNull(); + NotifyFMRadioEvent(PIChanged); + } + if (!mPTY.IsNull()) { + mPTY.SetNull(); + NotifyFMRadioEvent(PTYChanged); + } + if (mPSNameSet) { + mPSNameSet = false; + mPSName.Truncate(); + NotifyFMRadioEvent(PSChanged); + } + if (mRadiotextSet) { + mRadiotextSet = false; + mRadiotext.Truncate(); + NotifyFMRadioEvent(RadiotextChanged); + } + mRDSGroupSet = false; return true; } @@ -141,10 +229,85 @@ FMRadioChild::RecvNotifyEnabledChanged(const bool& aEnabled, { mEnabled = aEnabled; mFrequency = aFrequency; + if (!mEnabled) { + mPI.SetNull(); + mPTY.SetNull(); + mPSName.Truncate(); + mRadiotext.Truncate(); + mRDSGroupSet = false; + mPSNameSet = false; + mRadiotextSet = false; + } NotifyFMRadioEvent(EnabledChanged); return true; } +bool +FMRadioChild::RecvNotifyRDSEnabledChanged(const bool& aEnabled) +{ + mRDSEnabled = aEnabled; + NotifyFMRadioEvent(RDSEnabledChanged); + return true; +} + +bool +FMRadioChild::RecvNotifyPIChanged(const bool& aValid, + const uint16_t& aCode) +{ + if (aValid) { + mPI.SetValue(aCode); + } else { + mPI.SetNull(); + } + NotifyFMRadioEvent(PIChanged); + return true; +} + +bool +FMRadioChild::RecvNotifyPTYChanged(const bool& aValid, + const uint8_t& aPTY) +{ + if (aValid) { + mPTY.SetValue(aPTY); + } else { + mPTY.SetNull(); + } + NotifyFMRadioEvent(PTYChanged); + return true; +} + +bool +FMRadioChild::RecvNotifyPSChanged(const nsString& aPSName) +{ + mPSNameSet = true; + mPSName = aPSName; + NotifyFMRadioEvent(PSChanged); + return true; +} + +bool +FMRadioChild::RecvNotifyRadiotextChanged(const nsString& aRadiotext) +{ + mRadiotextSet = true; + mRadiotext = aRadiotext; + NotifyFMRadioEvent(RadiotextChanged); + return true; +} + +bool +FMRadioChild::RecvNotifyNewRDSGroup(const uint64_t& aGroup) +{ + uint16_t grouptype = (aGroup >> 43) & 0x1F; + if (!(mRDSGroupMask & (1 << grouptype))) { + return true; + } + + mRDSGroupSet = true; + mRDSGroup = aGroup; + NotifyFMRadioEvent(NewRDSGroup); + return true; +} + bool FMRadioChild::Recv__delete__() { diff --git a/dom/fmradio/ipc/FMRadioChild.h b/dom/fmradio/ipc/FMRadioChild.h index ff9f6162f04d..1f39f1d8c24c 100644 --- a/dom/fmradio/ipc/FMRadioChild.h +++ b/dom/fmradio/ipc/FMRadioChild.h @@ -34,10 +34,16 @@ public: /* IFMRadioService */ virtual bool IsEnabled() const MOZ_OVERRIDE; + virtual bool IsRDSEnabled() const MOZ_OVERRIDE; virtual double GetFrequency() const MOZ_OVERRIDE; virtual double GetFrequencyUpperBound() const MOZ_OVERRIDE; virtual double GetFrequencyLowerBound() const MOZ_OVERRIDE; virtual double GetChannelWidth() const MOZ_OVERRIDE; + virtual Nullable GetPi() const MOZ_OVERRIDE; + virtual Nullable GetPty() const MOZ_OVERRIDE; + virtual bool GetPs(nsString& aPSName) MOZ_OVERRIDE; + virtual bool GetRt(nsString& aRadiotext) MOZ_OVERRIDE; + virtual bool GetRdsgroup(uint64_t& aRDSGroup) MOZ_OVERRIDE; virtual void Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; @@ -47,6 +53,9 @@ public: virtual void Seek(mozilla::hal::FMRadioSeekDirection aDirection, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void CancelSeek(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; + virtual void SetRDSGroupMask(uint32_t aRDSGroupMask) MOZ_OVERRIDE; + virtual void EnableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; + virtual void DisableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void AddObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; virtual void RemoveObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; @@ -64,6 +73,26 @@ public: RecvNotifyEnabledChanged(const bool& aEnabled, const double& aFrequency) MOZ_OVERRIDE; + virtual bool + RecvNotifyRDSEnabledChanged(const bool& aEnabled) MOZ_OVERRIDE; + + virtual bool + RecvNotifyPIChanged(const bool& aValid, + const uint16_t& aCode) MOZ_OVERRIDE; + + virtual bool + RecvNotifyPTYChanged(const bool& aValid, + const uint8_t& aPTY) MOZ_OVERRIDE; + + virtual bool + RecvNotifyPSChanged(const nsString& aPSName) MOZ_OVERRIDE; + + virtual bool + RecvNotifyRadiotextChanged(const nsString& aRadiotext) MOZ_OVERRIDE; + + virtual bool + RecvNotifyNewRDSGroup(const uint64_t& aGroup) MOZ_OVERRIDE; + virtual PFMRadioRequestChild* AllocPFMRadioRequestChild(const FMRadioRequestArgs& aArgs) MOZ_OVERRIDE; @@ -78,10 +107,20 @@ private: inline void NotifyFMRadioEvent(FMRadioEventType aType); bool mEnabled; + bool mRDSEnabled; + bool mRDSGroupSet; + bool mPSNameSet; + bool mRadiotextSet; double mFrequency; double mUpperBound; double mLowerBound; double mChannelWidth; + Nullable mPI; + Nullable mPTY; + nsAutoString mPSName; + nsAutoString mRadiotext; + uint64_t mRDSGroup; + uint32_t mRDSGroupMask; FMRadioEventObserverList mObserverList; diff --git a/dom/fmradio/ipc/FMRadioParent.cpp b/dom/fmradio/ipc/FMRadioParent.cpp index b8af6680f030..50db2cd83b4a 100644 --- a/dom/fmradio/ipc/FMRadioParent.cpp +++ b/dom/fmradio/ipc/FMRadioParent.cpp @@ -6,6 +6,7 @@ #include "FMRadioParent.h" #include "mozilla/unused.h" #include "mozilla/dom/ContentParent.h" +#include "mozilla/DebugOnly.h" #include "FMRadioRequestParent.h" #include "FMRadioService.h" @@ -69,6 +70,12 @@ FMRadioParent::AllocPFMRadioRequestParent(const FMRadioRequestArgs& aArgs) case FMRadioRequestArgs::TCancelSeekRequestArgs: IFMRadioService::Singleton()->CancelSeek(requestParent); break; + case FMRadioRequestArgs::TEnableRDSArgs: + IFMRadioService::Singleton()->EnableRDS(requestParent); + break; + case FMRadioRequestArgs::TDisableRDSArgs: + IFMRadioService::Singleton()->DisableRDS(requestParent); + break; default: MOZ_CRASH(); } @@ -98,6 +105,43 @@ FMRadioParent::Notify(const FMRadioEventType& aType) IFMRadioService::Singleton()->IsEnabled(), IFMRadioService::Singleton()->GetFrequency()); break; + case RDSEnabledChanged: + unused << SendNotifyRDSEnabledChanged( + IFMRadioService::Singleton()->IsRDSEnabled()); + break; + case PIChanged: { + Nullable pi = + IFMRadioService::Singleton()->GetPi(); + unused << SendNotifyPIChanged(!pi.IsNull(), + pi.IsNull() ? 0 : pi.Value()); + break; + } + case PTYChanged: { + Nullable pty = IFMRadioService::Singleton()->GetPty(); + unused << SendNotifyPTYChanged(!pty.IsNull(), + pty.IsNull() ? 0 : pty.Value()); + break; + } + case PSChanged: { + nsAutoString psname; + IFMRadioService::Singleton()->GetPs(psname); + unused << SendNotifyPSChanged(psname); + break; + } + case RadiotextChanged: { + nsAutoString radiotext; + IFMRadioService::Singleton()->GetRt(radiotext); + unused << SendNotifyRadiotextChanged(radiotext); + break; + } + case NewRDSGroup: { + uint64_t group; + DebugOnly rdsgroupset = + IFMRadioService::Singleton()->GetRdsgroup(group); + MOZ_ASSERT(rdsgroupset); + unused << SendNotifyNewRDSGroup(group); + break; + } default: NS_RUNTIMEABORT("not reached"); break; @@ -111,5 +155,12 @@ FMRadioParent::RecvEnableAudio(const bool& aAudioEnabled) return true; } +bool +FMRadioParent::RecvSetRDSGroupMask(const uint32_t& aRDSGroupMask) +{ + IFMRadioService::Singleton()->SetRDSGroupMask(aRDSGroupMask); + return true; +} + END_FMRADIO_NAMESPACE diff --git a/dom/fmradio/ipc/FMRadioParent.h b/dom/fmradio/ipc/FMRadioParent.h index 96cc5a484ee6..024b240d75ef 100644 --- a/dom/fmradio/ipc/FMRadioParent.h +++ b/dom/fmradio/ipc/FMRadioParent.h @@ -39,6 +39,9 @@ public: virtual bool RecvEnableAudio(const bool& aAudioEnabled) MOZ_OVERRIDE; + + virtual bool + RecvSetRDSGroupMask(const uint32_t& aRDSGroupMask) MOZ_OVERRIDE; }; END_FMRADIO_NAMESPACE diff --git a/dom/fmradio/ipc/PFMRadio.ipdl b/dom/fmradio/ipc/PFMRadio.ipdl index be863e1a5e15..f4929cfe70b9 100644 --- a/dom/fmradio/ipc/PFMRadio.ipdl +++ b/dom/fmradio/ipc/PFMRadio.ipdl @@ -34,6 +34,14 @@ struct CancelSeekRequestArgs { }; +struct EnableRDSArgs +{ +}; + +struct DisableRDSArgs +{ +}; + union FMRadioRequestArgs { EnableRequestArgs; @@ -41,6 +49,8 @@ union FMRadioRequestArgs SetFrequencyRequestArgs; SeekRequestArgs; CancelSeekRequestArgs; + EnableRDSArgs; + DisableRDSArgs; }; struct StatusInfo @@ -66,6 +76,30 @@ child: * Sent when the power state of FM radio HW is changed. */ NotifyEnabledChanged(bool enabled, double frequency); + /** + * Sent when RDS is enabled or disabled. + */ + NotifyRDSEnabledChanged(bool enabled); + /** + * Sent when we have a new PI code. + */ + NotifyPIChanged(bool valid, uint16_t code); + /** + * Sent when we have a new PTY + */ + NotifyPTYChanged(bool valid, uint8_t pty); + /** + * Sent when we have a new PS name. + */ + NotifyPSChanged(nsString psname); + /** + * Sent when we have new radiotext. + */ + NotifyRadiotextChanged(nsString radiotext); + /** + * Sent when a full RDS group is received. + */ + NotifyNewRDSGroup(uint64_t data); __delete__(); @@ -91,6 +125,11 @@ parent: * Enable/Disable audio */ EnableAudio(bool audioEnabled); + + /** + * Set RDS group mask + */ + SetRDSGroupMask(uint32_t groupMask); }; } // namespace dom diff --git a/dom/webidl/FMRadio.webidl b/dom/webidl/FMRadio.webidl index cb1c3e8051ff..57db07691ae1 100644 --- a/dom/webidl/FMRadio.webidl +++ b/dom/webidl/FMRadio.webidl @@ -6,6 +6,9 @@ interface FMRadio : EventTarget { /* Indicates if the FM radio is enabled. */ readonly attribute boolean enabled; + /* Indicates if RDS reception is enabled */ + readonly attribute boolean rdsEnabled; + /* Indicates if the antenna is plugged and available. */ readonly attribute boolean antennaAvailable; @@ -31,12 +34,58 @@ interface FMRadio : EventTarget { */ readonly attribute double channelWidth; + /** + * This is a mask consisting of bits corresponding to + * (1 << groupcode) that can be specified to receive + * raw RDS groups of specific group types. Note that + * groupcode corresponds to the upper 5 bits in block B. + */ + attribute unsigned long rdsGroupMask; + + /** + * The Program Identification (PI) code. + * Available if RDS is enabled on both the station and on this device. + * The value is null otherwise. + */ + readonly attribute unsigned short? pi; + + /** + * The Program Type (PTY) code. + * Available if RDS is enabled on both the station and on this device. + * The value is null otherwise. + */ + readonly attribute octet? pty; + + /** + * The Program Service (PS) name. + * Available if RDS is enabled on the station and on this device + */ + readonly attribute DOMString? ps; + + /** + * The radiotext, as provided by group 2A/2B. + * Available if RDS is enabled on the station and on this device + */ + readonly attribute DOMString? rt; + + /** + * The last RDS group received. + * Available if RDS is enabled on the station and on this device + */ + readonly attribute Uint16Array? rdsgroup; + /* Fired when the FM radio is enabled. */ attribute EventHandler onenabled; /* Fired when the FM radio is disabled. */ attribute EventHandler ondisabled; + /* Fired when the RDS is enabled. */ + attribute EventHandler onrdsenabled; + + /* Fired when the RDS is disabled. */ + attribute EventHandler onrdsdisabled; + /** * Fired when the antenna becomes available or unavailable, i.e., fired when * the antennaAvailable attribute changes. @@ -46,6 +95,21 @@ interface FMRadio : EventTarget { /* Fired when the FM radio's frequency is changed. */ attribute EventHandler onfrequencychange; + /* Fired when the PI code changes */ + attribute EventHandler onpichange; + + /* Fired when the PTY changes */ + attribute EventHandler onptychange; + + /* Fired when the PS name changes */ + attribute EventHandler onpschange; + + /* Fired when the radiotext changes */ + attribute EventHandler onrtchange; + + /* Fired when we get a new RDS group */ + attribute EventHandler onnewrdsgroup; + /** * Power the FM radio off. The disabled event will be fired if this request * completes successfully. @@ -94,5 +158,19 @@ interface FMRadio : EventTarget { * error will be fired. */ DOMRequest cancelSeek(); + + /** + * Enable RDS reception. + * + * If the radio is off, RDS will be enabled when the radio is turned on. + */ + DOMRequest enableRDS(); + + /** + * Disable RDS reception. + * + * If the radio is off, RDS will not be enabled when the radio is turned on. + */ + DOMRequest disableRDS(); }; From f5f620a8d255568e4e6157428bfb8d36fc884fbf Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 30 Sep 2014 18:07:49 +0100 Subject: [PATCH 83/93] Bug 1074974 - Make HelpersD2D.h's CreateStrokeStyleForOptions more robust. r=Bas --- gfx/2d/HelpersD2D.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gfx/2d/HelpersD2D.h b/gfx/2d/HelpersD2D.h index ae014c2cc563..4b5b98008a4b 100644 --- a/gfx/2d/HelpersD2D.h +++ b/gfx/2d/HelpersD2D.h @@ -467,7 +467,10 @@ CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions) HRESULT hr; - if (aStrokeOptions.mDashPattern) { + // We need to check mDashLength in addition to mDashPattern here since if + // mDashPattern is set but mDashLength is zero then the stroke will fail to + // paint. + if (aStrokeOptions.mDashLength > 0 && aStrokeOptions.mDashPattern) { typedef std::vector FloatVector; // D2D "helpfully" multiplies the dash pattern by the line width. // That's not what cairo does, or is what 's dash wants. From dc2daaef9e6370a3f7282352eca3f497ce9b1469 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 30 Sep 2014 18:08:13 +0100 Subject: [PATCH 84/93] Bug 1074475 - Fix a bug in GetStrokeDashData. r=longsonr --- content/svg/content/src/SVGContentUtils.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/content/svg/content/src/SVGContentUtils.cpp b/content/svg/content/src/SVGContentUtils.cpp index 65fe81c094a4..9c4e8471f82f 100644 --- a/content/svg/content/src/SVGContentUtils.cpp +++ b/content/svg/content/src/SVGContentUtils.cpp @@ -122,10 +122,21 @@ GetStrokeDashData(SVGContentUtils::AutoStrokeOptions* aStrokeOptions, } } - // Now that aStrokeOptions.mDashPattern is fully initialized we can safely - // set mDashLength: + // Now that aStrokeOptions.mDashPattern is fully initialized (we didn't + // return early above) we can safely set mDashLength: aStrokeOptions->mDashLength = dashArrayLength; + if ((dashArrayLength % 2) == 1) { + // If we have a dash pattern with an odd number of lengths the pattern + // repeats a second time, per the SVG spec., and as implemented by Moz2D. + // When deciding whether to return eNoStroke or eContinuousStroke below we + // need to take into account that in the repeat pattern the dashes become + // gaps, and the gaps become dashes. + Float origTotalLengthOfDashes = totalLengthOfDashes; + totalLengthOfDashes += totalLengthOfGaps; + totalLengthOfGaps += origTotalLengthOfDashes; + } + if (totalLengthOfDashes <= 0 || totalLengthOfGaps <= 0) { if (totalLengthOfGaps > 0 && totalLengthOfDashes <= 0) { return eNoStroke; From 12ea29267858305c27994df4d068e8893bc5793d Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 30 Sep 2014 18:08:13 +0100 Subject: [PATCH 85/93] Bug 1074294, part 1 - Convert SVGAutoRenderState to act on a Moz2D DrawTarget. r=longsonr --- layout/svg/SVGTextFrame.cpp | 5 +++-- layout/svg/nsSVGClipPathFrame.cpp | 3 ++- layout/svg/nsSVGForeignObjectFrame.cpp | 2 +- layout/svg/nsSVGOuterSVGFrame.cpp | 3 ++- layout/svg/nsSVGPathGeometryFrame.cpp | 2 +- layout/svg/nsSVGUtils.cpp | 22 +++++++++++----------- layout/svg/nsSVGUtils.h | 13 ++++++++----- 7 files changed, 28 insertions(+), 22 deletions(-) diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index bb0fe219777f..45c6b743920c 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -2709,7 +2709,7 @@ public: bool aShouldPaintSVGGlyphs) : DrawPathCallbacks(aShouldPaintSVGGlyphs), gfx(aContext->ThebesContext()), - mRenderMode(SVGAutoRenderState::GetRenderMode(aContext)), + mRenderMode(SVGAutoRenderState::GetRenderMode(aContext->GetDrawTarget())), mFrame(aFrame), mCanvasTM(aCanvasTM) { @@ -5117,7 +5117,8 @@ SVGTextFrame::ShouldRenderAsPath(nsRenderingContext* aContext, bool& aShouldPaintSVGGlyphs) { // Rendering to a clip path. - if (SVGAutoRenderState::GetRenderMode(aContext) != SVGAutoRenderState::NORMAL) { + if (SVGAutoRenderState::GetRenderMode(aContext->GetDrawTarget()) != + SVGAutoRenderState::NORMAL) { aShouldPaintSVGGlyphs = false; return true; } diff --git a/layout/svg/nsSVGClipPathFrame.cpp b/layout/svg/nsSVGClipPathFrame.cpp index 0aabee2a8d9d..f718cc2b7417 100644 --- a/layout/svg/nsSVGClipPathFrame.cpp +++ b/layout/svg/nsSVGClipPathFrame.cpp @@ -94,7 +94,8 @@ nsSVGClipPathFrame::ApplyClipOrPaintClipMask(nsRenderingContext* aContext, // Seems like this is a non-trivial clipPath, so we need to use a clip mask. // Notify our children that they're painting into a clip mask: - SVGAutoRenderState mode(aContext, SVGAutoRenderState::CLIP_MASK); + SVGAutoRenderState mode(aContext->GetDrawTarget(), + SVGAutoRenderState::CLIP_MASK); // Check if this clipPath is itself clipped by another clipPath: nsSVGClipPathFrame *clipPathFrame = diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index 363cce7488aa..18298f1ef039 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -266,7 +266,7 @@ nsSVGForeignObjectFrame::PaintSVG(nsRenderingContext *aContext, gfx->Multiply(canvasTMForChildren); uint32_t flags = nsLayoutUtils::PAINT_IN_TRANSFORM; - if (SVGAutoRenderState::IsPaintingToWindow(aContext)) { + if (SVGAutoRenderState::IsPaintingToWindow(aContext->GetDrawTarget())) { flags |= nsLayoutUtils::PAINT_TO_WINDOW; } nsresult rv = nsLayoutUtils::PaintFrame(aContext, kid, nsRegion(kidDirtyRect), diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index afcb32a03404..0db12b0e3ac2 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -590,7 +590,8 @@ nsDisplayOuterSVG::Paint(nsDisplayListBuilder* aBuilder, // Create an SVGAutoRenderState so we can call SetPaintingToWindow on // it, but do so without changing the render mode: - SVGAutoRenderState state(aContext, SVGAutoRenderState::GetRenderMode(aContext)); + SVGAutoRenderState state(aContext->GetDrawTarget(), + SVGAutoRenderState::GetRenderMode(aContext->GetDrawTarget())); if (aBuilder->IsPaintingToWindow()) { state.SetPaintingToWindow(true); diff --git a/layout/svg/nsSVGPathGeometryFrame.cpp b/layout/svg/nsSVGPathGeometryFrame.cpp index 418cae1e0590..2c4c9f049ac7 100644 --- a/layout/svg/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/nsSVGPathGeometryFrame.cpp @@ -620,7 +620,7 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext, return; } - uint16_t renderMode = SVGAutoRenderState::GetRenderMode(aContext); + uint16_t renderMode = SVGAutoRenderState::GetRenderMode(aContext->GetDrawTarget()); FillRule fillRule = nsSVGUtils::ToFillRule(renderMode == SVGAutoRenderState::CLIP_MASK ? StyleSVG()->mClipRule : StyleSVG()->mFillRule); diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 307036e953e9..2c69412a8eee 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -83,28 +83,28 @@ NS_SVGNewGetBBoxEnabled() // we only take the address of this: static mozilla::gfx::UserDataKey sSVGAutoRenderStateKey; -SVGAutoRenderState::SVGAutoRenderState(nsRenderingContext *aContext, +SVGAutoRenderState::SVGAutoRenderState(DrawTarget* aDrawTarget, RenderMode aMode MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL) - : mContext(aContext) + : mDrawTarget(aDrawTarget) , mOriginalRenderState(nullptr) , mMode(aMode) , mPaintingToWindow(false) { MOZ_GUARD_OBJECT_NOTIFIER_INIT; mOriginalRenderState = - aContext->GetDrawTarget()->RemoveUserData(&sSVGAutoRenderStateKey); + aDrawTarget->RemoveUserData(&sSVGAutoRenderStateKey); // We always remove ourselves from aContext before it dies, so // passing nullptr as the destroy function is okay. - aContext->GetDrawTarget()->AddUserData(&sSVGAutoRenderStateKey, this, nullptr); + aDrawTarget->AddUserData(&sSVGAutoRenderStateKey, this, nullptr); } SVGAutoRenderState::~SVGAutoRenderState() { - mContext->GetDrawTarget()->RemoveUserData(&sSVGAutoRenderStateKey); + mDrawTarget->RemoveUserData(&sSVGAutoRenderStateKey); if (mOriginalRenderState) { - mContext->GetDrawTarget()->AddUserData(&sSVGAutoRenderStateKey, - mOriginalRenderState, nullptr); + mDrawTarget->AddUserData(&sSVGAutoRenderStateKey, + mOriginalRenderState, nullptr); } } @@ -115,9 +115,9 @@ SVGAutoRenderState::SetPaintingToWindow(bool aPaintingToWindow) } /* static */ SVGAutoRenderState::RenderMode -SVGAutoRenderState::GetRenderMode(nsRenderingContext *aContext) +SVGAutoRenderState::GetRenderMode(DrawTarget* aDrawTarget) { - void *state = aContext->GetDrawTarget()->GetUserData(&sSVGAutoRenderStateKey); + void *state = aDrawTarget->GetUserData(&sSVGAutoRenderStateKey); if (state) { return static_cast(state)->mMode; } @@ -125,9 +125,9 @@ SVGAutoRenderState::GetRenderMode(nsRenderingContext *aContext) } /* static */ bool -SVGAutoRenderState::IsPaintingToWindow(nsRenderingContext *aContext) +SVGAutoRenderState::IsPaintingToWindow(DrawTarget* aDrawTarget) { - void *state = aContext->GetDrawTarget()->GetUserData(&sSVGAutoRenderStateKey); + void *state = aDrawTarget->GetUserData(&sSVGAutoRenderStateKey); if (state) { return static_cast(state)->mPaintingToWindow; } diff --git a/layout/svg/nsSVGUtils.h b/layout/svg/nsSVGUtils.h index 96122d55543a..5e858798dc6d 100644 --- a/layout/svg/nsSVGUtils.h +++ b/layout/svg/nsSVGUtils.h @@ -61,6 +61,7 @@ class Element; class UserSpaceMetrics; } // namespace dom namespace gfx { +class DrawTarget; class GeneralPattern; class SourceSurface; } @@ -145,6 +146,8 @@ private: class MOZ_STACK_CLASS SVGAutoRenderState { + typedef mozilla::gfx::DrawTarget DrawTarget; + public: enum RenderMode { /** @@ -160,18 +163,18 @@ public: CLIP_MASK }; - SVGAutoRenderState(nsRenderingContext *aContext, RenderMode aMode + SVGAutoRenderState(DrawTarget* aDrawTarget, RenderMode aMode MOZ_GUARD_OBJECT_NOTIFIER_PARAM); ~SVGAutoRenderState(); void SetPaintingToWindow(bool aPaintingToWindow); - static RenderMode GetRenderMode(nsRenderingContext *aContext); - static bool IsPaintingToWindow(nsRenderingContext *aContext); + static RenderMode GetRenderMode(DrawTarget* aDrawTarget); + static bool IsPaintingToWindow(DrawTarget* aDrawTarget); private: - nsRenderingContext *mContext; - void *mOriginalRenderState; + DrawTarget* mDrawTarget; + void* mOriginalRenderState; RenderMode mMode; bool mPaintingToWindow; MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER From 2a246892c90a6aaacec5cbd04bc9ca95e046841e Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 30 Sep 2014 18:08:13 +0100 Subject: [PATCH 86/93] Bug 1074294, part 2 - Convert nsSVGPathGeometryFrame::Render() to render directly using the Moz2D DrawTarget. r=longsonr --- content/svg/content/src/SVGContentUtils.cpp | 6 +- content/svg/content/src/SVGContentUtils.h | 7 ++ layout/reftests/svg/reftest.list | 2 +- layout/svg/nsSVGPathGeometryFrame.cpp | 122 +++++++++++--------- layout/svg/nsSVGPathGeometryFrame.h | 10 +- 5 files changed, 86 insertions(+), 61 deletions(-) diff --git a/content/svg/content/src/SVGContentUtils.cpp b/content/svg/content/src/SVGContentUtils.cpp index 9c4e8471f82f..665e8e1fac89 100644 --- a/content/svg/content/src/SVGContentUtils.cpp +++ b/content/svg/content/src/SVGContentUtils.cpp @@ -183,9 +183,9 @@ SVGContentUtils::GetStrokeOptions(AutoStrokeOptions* aStrokeOptions, aStrokeOptions->mLineWidth = 0; return; } - if (dashState == eContinuousStroke) { - // Prevent our caller from wasting time looking at the dash array: - aStrokeOptions->mDashLength = 0; + if (dashState == eContinuousStroke && aStrokeOptions->mDashPattern) { + // Prevent our caller from wasting time looking at a pattern without gaps: + aStrokeOptions->DiscardDashPattern(); } aStrokeOptions->mLineWidth = diff --git a/content/svg/content/src/SVGContentUtils.h b/content/svg/content/src/SVGContentUtils.h index 178dc747beb8..ab6e4aadf40a 100644 --- a/content/svg/content/src/SVGContentUtils.h +++ b/content/svg/content/src/SVGContentUtils.h @@ -116,6 +116,13 @@ public: mDashPattern = nonConstArray; return nonConstArray; } + void DiscardDashPattern() { + if (mDashPattern && mDashPattern != mSmallArray) { + delete [] mDashPattern; + } + mDashLength = 0; + mDashPattern = nullptr; + } private: // Most dasharrays will fit in this and save us allocating Float mSmallArray[16]; diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index b6bd66587821..63ec6716b86f 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -326,7 +326,7 @@ fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,3) == text-layout-06.svg text-layou HTTP(..) == text-scale-02.svg text-scale-02-ref.svg HTTP(..) == text-scale-03.svg text-scale-03-ref.svg == text-stroke-scaling-01.svg text-stroke-scaling-01-ref.svg -fails-if(OSX==10.8) == stroke-dasharray-01.svg stroke-dasharray-01-ref.svg # bug 896487 +== stroke-dasharray-01.svg stroke-dasharray-01-ref.svg == stroke-dasharray-02.svg pass.svg == stroke-dasharray-and-pathLength-01.svg pass.svg == stroke-dasharray-and-text-01.svg stroke-dasharray-and-text-01-ref.svg diff --git a/layout/svg/nsSVGPathGeometryFrame.cpp b/layout/svg/nsSVGPathGeometryFrame.cpp index 2c4c9f049ac7..2eeb8812731a 100644 --- a/layout/svg/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/nsSVGPathGeometryFrame.cpp @@ -12,6 +12,7 @@ #include "gfxPlatform.h" #include "gfxSVGGlyphs.h" #include "mozilla/gfx/2D.h" +#include "mozilla/gfx/Helpers.h" #include "mozilla/RefPtr.h" #include "nsDisplayList.h" #include "nsGkAtoms.h" @@ -107,11 +108,9 @@ nsDisplaySVGPathGeometry::Paint(nsDisplayListBuilder* aBuilder, gfxPoint devPixelOffset = nsLayoutUtils::PointToGfxPoint(offset, appUnitsPerDevPixel); - aCtx->ThebesContext()->Save(); gfxMatrix tm = nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(mFrame) * gfxMatrix::Translation(devPixelOffset); static_cast(mFrame)->PaintSVG(aCtx, tm); - aCtx->ThebesContext()->Restore(); } //---------------------------------------------------------------------- @@ -219,9 +218,18 @@ nsSVGPathGeometryFrame::PaintSVG(nsRenderingContext *aContext, if (!StyleVisibility()->IsVisible()) return NS_OK; + gfxContext* gfx = aContext->ThebesContext(); + + // Matrix to the geometry's user space: + gfxMatrix newMatrix = + gfx->CurrentMatrix().PreMultiply(aTransform).NudgeToIntegers(); + if (newMatrix.IsSingular()) { + return NS_OK; + } + uint32_t paintOrder = StyleSVG()->mPaintOrder; if (paintOrder == NS_STYLE_PAINT_ORDER_NORMAL) { - Render(aContext, eRenderFill | eRenderStroke, aTransform); + Render(gfx, eRenderFill | eRenderStroke, newMatrix); PaintMarkers(aContext, aTransform); } else { while (paintOrder) { @@ -229,10 +237,10 @@ nsSVGPathGeometryFrame::PaintSVG(nsRenderingContext *aContext, paintOrder & ((1 << NS_STYLE_PAINT_ORDER_BITWIDTH) - 1); switch (component) { case NS_STYLE_PAINT_ORDER_FILL: - Render(aContext, eRenderFill, aTransform); + Render(gfx, eRenderFill, newMatrix); break; case NS_STYLE_PAINT_ORDER_STROKE: - Render(aContext, eRenderStroke, aTransform); + Render(gfx, eRenderStroke, newMatrix); break; case NS_STYLE_PAINT_ORDER_MARKERS: PaintMarkers(aContext, aTransform); @@ -608,25 +616,24 @@ nsSVGPathGeometryFrame::MarkerProperties::GetMarkerEndFrame() } void -nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext, +nsSVGPathGeometryFrame::Render(gfxContext* aContext, uint32_t aRenderComponents, - const gfxMatrix& aTransform) + const gfxMatrix& aNewTransform) { - gfxContext *gfx = aContext->ThebesContext(); + MOZ_ASSERT(!aNewTransform.IsSingular()); - gfxMatrix newMatrix = - gfx->CurrentMatrix().PreMultiply(aTransform).NudgeToIntegers(); - if (newMatrix.IsSingular()) { - return; - } + DrawTarget* drawTarget = aContext->GetDrawTarget(); + + uint16_t renderMode = SVGAutoRenderState::GetRenderMode(drawTarget); + MOZ_ASSERT(renderMode == SVGAutoRenderState::NORMAL || + renderMode == SVGAutoRenderState::CLIP_MASK, + "Unknown render mode"); - uint16_t renderMode = SVGAutoRenderState::GetRenderMode(aContext->GetDrawTarget()); FillRule fillRule = - nsSVGUtils::ToFillRule(renderMode == SVGAutoRenderState::CLIP_MASK ? - StyleSVG()->mClipRule : StyleSVG()->mFillRule); + nsSVGUtils::ToFillRule(renderMode == SVGAutoRenderState::NORMAL ? + StyleSVG()->mFillRule : StyleSVG()->mClipRule); - RefPtr builder = - aContext->GetDrawTarget()->CreatePathBuilder(fillRule); + RefPtr builder = drawTarget->CreatePathBuilder(fillRule); if (!builder) { return; } @@ -637,62 +644,65 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext, return; } - switch (StyleSVG()->mShapeRendering) { - case NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED: - case NS_STYLE_SHAPE_RENDERING_CRISPEDGES: - gfx->SetAntialiasMode(AntialiasMode::NONE); - break; - default: - gfx->SetAntialiasMode(AntialiasMode::SUBPIXEL); - break; - } + AntialiasMode aaMode = + (StyleSVG()->mShapeRendering == NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED || + StyleSVG()->mShapeRendering == NS_STYLE_SHAPE_RENDERING_CRISPEDGES) ? + AntialiasMode::NONE : AntialiasMode::SUBPIXEL; + + // We wait as late as possible before setting the transform so that we don't + // set it unnecessarily if we return early (it's an expensive operation for + // some backends). + gfxContextMatrixAutoSaveRestore autoRestoreTransform(aContext); + aContext->SetMatrix(aNewTransform); if (renderMode == SVGAutoRenderState::CLIP_MASK) { - FillRule oldFillRule = gfx->CurrentFillRule(); - gfxContextMatrixAutoSaveRestore autoSaveRestore(gfx); - - gfx->SetMatrix(newMatrix); - gfx->SetFillRule(fillRule); - gfx->SetColor(gfxRGBA(1.0f, 1.0f, 1.0f, 1.0f)); - gfx->SetPath(path); - gfx->Fill(); - - gfx->SetFillRule(oldFillRule); - gfx->NewPath(); + drawTarget->Fill(path, ColorPattern(Color(1.0f, 1.0f, 1.0f, 1.0f)), + DrawOptions(1.0f, CompositionOp::OP_OVER, aaMode)); return; } - NS_ABORT_IF_FALSE(renderMode == SVGAutoRenderState::NORMAL, - "Unknown render mode"); - - gfxContextAutoSaveRestore autoSaveRestore(gfx); - gfx->SetMatrix(newMatrix); - gfxTextContextPaint *contextPaint = - (gfxTextContextPaint*)aContext->GetDrawTarget()->GetUserData(&gfxTextContextPaint::sUserDataKey); + (gfxTextContextPaint*)drawTarget-> + GetUserData(&gfxTextContextPaint::sUserDataKey); - if ((aRenderComponents & eRenderFill)) { + if (aRenderComponents & eRenderFill) { GeneralPattern fillPattern; - nsSVGUtils::MakeFillPatternFor(this, gfx, &fillPattern, contextPaint); + nsSVGUtils::MakeFillPatternFor(this, aContext, &fillPattern, contextPaint); if (fillPattern.GetPattern()) { - gfx->SetPath(path); - gfx->SetFillRule(fillRule); - gfx->Fill(fillPattern); + drawTarget->Fill(path, fillPattern, + DrawOptions(1.0f, CompositionOp::OP_OVER, aaMode)); } } if ((aRenderComponents & eRenderStroke) && nsSVGUtils::HasStroke(this, contextPaint)) { + // Account for vector-effect:non-scaling-stroke: + gfxMatrix strokeTransform = nsSVGUtils::GetStrokeTransform(this); + if (!strokeTransform.IsIdentity()) { + // We need to transform the path back into the appropriate ancestor + // coordinate system, and paint it it that coordinate system, in order + // for non-scaled stroke to paint correctly. + aContext->Multiply(strokeTransform); + Matrix moz2DstrokeTransform = ToMatrix(strokeTransform); // inverse of Thebes + moz2DstrokeTransform.Invert(); + builder = path->TransformedCopyToBuilder(moz2DstrokeTransform, fillRule); + path = builder->Finish(); + } GeneralPattern strokePattern; - nsSVGUtils::MakeStrokePatternFor(this, gfx, &strokePattern, contextPaint); + nsSVGUtils::MakeStrokePatternFor(this, aContext, &strokePattern, contextPaint); if (strokePattern.GetPattern()) { - gfx->SetPath(path); - nsSVGUtils::SetupCairoStrokeGeometry(this, gfx, contextPaint); - gfx->Stroke(strokePattern); + SVGContentUtils::AutoStrokeOptions strokeOptions; + SVGContentUtils::GetStrokeOptions(&strokeOptions, + static_cast(mContent), + StyleContext(), contextPaint); + // GetStrokeOptions may set the line width to zero as an optimization + if (strokeOptions.mLineWidth <= 0) { + return; + } + drawTarget->Stroke(path, strokePattern, strokeOptions, + DrawOptions(1.0f, CompositionOp::OP_OVER, aaMode)); } } - - gfx->NewPath(); } void diff --git a/layout/svg/nsSVGPathGeometryFrame.h b/layout/svg/nsSVGPathGeometryFrame.h index fe7359f80734..15add722a2cb 100644 --- a/layout/svg/nsSVGPathGeometryFrame.h +++ b/layout/svg/nsSVGPathGeometryFrame.h @@ -15,6 +15,12 @@ #include "nsQueryFrame.h" #include "nsSVGUtils.h" +namespace mozilla { +namespace gfx { +class DrawTarget; +} +} + class gfxContext; class nsDisplaySVGPathGeometry; class nsIAtom; @@ -34,6 +40,8 @@ typedef nsFrame nsSVGPathGeometryFrameBase; class nsSVGPathGeometryFrame : public nsSVGPathGeometryFrameBase, public nsISVGChildFrame { + typedef mozilla::gfx::DrawTarget DrawTarget; + friend nsIFrame* NS_NewSVGPathGeometryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); @@ -113,7 +121,7 @@ protected: virtual uint16_t GetHitTestFlags(); private: enum { eRenderFill = 1, eRenderStroke = 2 }; - void Render(nsRenderingContext *aContext, uint32_t aRenderComponents, + void Render(gfxContext* aContext, uint32_t aRenderComponents, const gfxMatrix& aTransform); /** From 48f776380329f5b7d54f907915945353c89fa4a5 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 30 Sep 2014 18:08:14 +0100 Subject: [PATCH 87/93] Bug 1074594 - Stop inverting the transform in nsSVGUtils::GetStrokeTransform, give it a more performant signature, and a better name. r=longsonr --- layout/svg/nsSVGGradientFrame.cpp | 9 +++-- layout/svg/nsSVGPathGeometryFrame.cpp | 23 ++++++------- layout/svg/nsSVGPatternFrame.cpp | 12 ++++--- layout/svg/nsSVGUtils.cpp | 48 ++++++++++++++------------- layout/svg/nsSVGUtils.h | 15 ++++++--- 5 files changed, 57 insertions(+), 50 deletions(-) diff --git a/layout/svg/nsSVGGradientFrame.cpp b/layout/svg/nsSVGGradientFrame.cpp index 912c7308d350..e27e4cbfc544 100644 --- a/layout/svg/nsSVGGradientFrame.cpp +++ b/layout/svg/nsSVGGradientFrame.cpp @@ -263,13 +263,12 @@ nsSVGGradientFrame::GetPaintServerPattern(nsIFrame* aSource, return nullptr; } - // revert the vector effect transform so that the gradient appears unchanged + // revert any vector effect transform so that the gradient appears unchanged if (aFillOrStroke == &nsStyleSVG::mStroke) { - gfxMatrix nonScalingStrokeTM = nsSVGUtils::GetStrokeTransform(aSource); - if (!nonScalingStrokeTM.Invert()) { - return nullptr; + gfxMatrix userToOuterSVG; + if (nsSVGUtils::GetNonScalingStrokeTransform(aSource, &userToOuterSVG)) { + patternMatrix *= userToOuterSVG; } - patternMatrix *= nonScalingStrokeTM; } if (!patternMatrix.Invert()) { diff --git a/layout/svg/nsSVGPathGeometryFrame.cpp b/layout/svg/nsSVGPathGeometryFrame.cpp index 2eeb8812731a..6a0cc5692be7 100644 --- a/layout/svg/nsSVGPathGeometryFrame.cpp +++ b/layout/svg/nsSVGPathGeometryFrame.cpp @@ -302,18 +302,15 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const gfxPoint& aPoint) Point point = ToPoint(aPoint); SVGContentUtils::AutoStrokeOptions stroke; SVGContentUtils::GetStrokeOptions(&stroke, content, StyleContext(), nullptr); - Matrix nonScalingStrokeMatrix = ToMatrix(nsSVGUtils::GetStrokeTransform(this)); - if (!nonScalingStrokeMatrix.IsIdentity()) { + gfxMatrix userToOuterSVG; + if (nsSVGUtils::GetNonScalingStrokeTransform(this, &userToOuterSVG)) { // We need to transform the path back into the appropriate ancestor // coordinate system in order for non-scaled stroke to be correct. // Naturally we also need to transform the point into the same // coordinate system in order to hit-test against the path. - if (!nonScalingStrokeMatrix.Invert()) { - return nullptr; - } - point = nonScalingStrokeMatrix * point; + point = ToMatrix(userToOuterSVG) * point; RefPtr builder = - path->TransformedCopyToBuilder(nonScalingStrokeMatrix, fillRule); + path->TransformedCopyToBuilder(ToMatrix(userToOuterSVG), fillRule); path = builder->Finish(); } isHit = path->StrokeContainsPoint(stroke, point, Matrix()); @@ -677,15 +674,15 @@ nsSVGPathGeometryFrame::Render(gfxContext* aContext, if ((aRenderComponents & eRenderStroke) && nsSVGUtils::HasStroke(this, contextPaint)) { // Account for vector-effect:non-scaling-stroke: - gfxMatrix strokeTransform = nsSVGUtils::GetStrokeTransform(this); - if (!strokeTransform.IsIdentity()) { + gfxMatrix userToOuterSVG; + if (nsSVGUtils::GetNonScalingStrokeTransform(this, &userToOuterSVG)) { // We need to transform the path back into the appropriate ancestor // coordinate system, and paint it it that coordinate system, in order // for non-scaled stroke to paint correctly. - aContext->Multiply(strokeTransform); - Matrix moz2DstrokeTransform = ToMatrix(strokeTransform); // inverse of Thebes - moz2DstrokeTransform.Invert(); - builder = path->TransformedCopyToBuilder(moz2DstrokeTransform, fillRule); + gfxMatrix outerSVGToUser = userToOuterSVG; + outerSVGToUser.Invert(); + aContext->Multiply(outerSVGToUser); + builder = path->TransformedCopyToBuilder(ToMatrix(userToOuterSVG), fillRule); path = builder->Finish(); } GeneralPattern strokePattern; diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp index 12ed1faf2cd9..b95a9e75802f 100644 --- a/layout/svg/nsSVGPatternFrame.cpp +++ b/layout/svg/nsSVGPatternFrame.cpp @@ -325,12 +325,14 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, // revert the vector effect transform so that the pattern appears unchanged if (aFillOrStroke == &nsStyleSVG::mStroke) { - Matrix strokeTransform = ToMatrix(nsSVGUtils::GetStrokeTransform(aSource)); - if (!strokeTransform.Invert()) { - NS_WARNING("Should we get here if the stroke transform is singular?"); - return nullptr; + gfxMatrix userToOuterSVG; + if (nsSVGUtils::GetNonScalingStrokeTransform(aSource, &userToOuterSVG)) { + patternTransform *= ToMatrix(userToOuterSVG); + if (patternTransform.IsSingular()) { + NS_WARNING("Singular matrix painting non-scaling-stroke"); + return nullptr; + } } - patternTransform *= strokeTransform; } // Get the transformation matrix that we will hand to the renderer's pattern diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 2c69412a8eee..6cc0d9c81cd5 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -1119,31 +1119,26 @@ nsSVGUtils::GetFirstNonAAncestorFrame(nsIFrame* aStartFrame) return nullptr; } -gfxMatrix -nsSVGUtils::GetStrokeTransform(nsIFrame *aFrame) +bool +nsSVGUtils::GetNonScalingStrokeTransform(nsIFrame *aFrame, + gfxMatrix* aUserToOuterSVG) { if (aFrame->GetContent()->IsNodeOfType(nsINode::eTEXT)) { aFrame = aFrame->GetParent(); } - if (aFrame->StyleSVGReset()->mVectorEffect == - NS_STYLE_VECTOR_EFFECT_NON_SCALING_STROKE) { - - nsIContent *content = aFrame->GetContent(); - NS_ABORT_IF_FALSE(content->IsSVG(), "bad cast"); - - // a non-scaling stroke is in the screen co-ordinate - // space rather so we need to invert the transform - // to the screen co-ordinate space to get there. - // See http://www.w3.org/TR/SVGTiny12/painting.html#NonScalingStroke - gfx::Matrix transform = SVGContentUtils::GetCTM( - static_cast(content), true); - if (!transform.IsSingular()) { - transform.Invert(); - return ThebesMatrix(transform); - } + if (aFrame->StyleSVGReset()->mVectorEffect != + NS_STYLE_VECTOR_EFFECT_NON_SCALING_STROKE) { + return false; } - return gfxMatrix(); + + nsIContent *content = aFrame->GetContent(); + NS_ABORT_IF_FALSE(content->IsSVG(), "bad cast"); + + *aUserToOuterSVG = ThebesMatrix(SVGContentUtils::GetCTM( + static_cast(content), true)); + + return !aUserToOuterSVG->IsIdentity(); } // The logic here comes from _cairo_stroke_style_max_distance_from_path @@ -1156,7 +1151,13 @@ PathExtentsToMaxStrokeExtents(const gfxRect& aPathExtents, double style_expansion = aStyleExpansionFactor * nsSVGUtils::GetStrokeWidth(aFrame); - gfxMatrix matrix = aMatrix * nsSVGUtils::GetStrokeTransform(aFrame); + gfxMatrix matrix = aMatrix; + + gfxMatrix outerSVGToUser; + if (nsSVGUtils::GetNonScalingStrokeTransform(aFrame, &outerSVGToUser)) { + outerSVGToUser.Invert(); + matrix *= outerSVGToUser; + } double dx = style_expansion * (fabs(matrix._11) + fabs(matrix._21)); double dy = style_expansion * (fabs(matrix._22) + fabs(matrix._12)); @@ -1496,9 +1497,10 @@ nsSVGUtils::SetupCairoStrokeGeometry(nsIFrame* aFrame, aContext->SetLineWidth(width); // Apply any stroke-specific transform - gfxMatrix strokeTransform = GetStrokeTransform(aFrame); - if (!strokeTransform.IsIdentity()) { - aContext->Multiply(strokeTransform); + gfxMatrix outerSVGToUser; + if (GetNonScalingStrokeTransform(aFrame, &outerSVGToUser) && + outerSVGToUser.Invert()) { + aContext->Multiply(outerSVGToUser); } const nsStyleSVG* style = aFrame->StyleSVG(); diff --git a/layout/svg/nsSVGUtils.h b/layout/svg/nsSVGUtils.h index 5e858798dc6d..08dab1a558b8 100644 --- a/layout/svg/nsSVGUtils.h +++ b/layout/svg/nsSVGUtils.h @@ -467,11 +467,18 @@ public: static bool OuterSVGIsCallingReflowSVG(nsIFrame *aFrame); static bool AnyOuterSVGIsCallingReflowSVG(nsIFrame *aFrame); - /* - * Get any additional transforms that apply only to stroking - * e.g. non-scaling-stroke + /** + * See https://svgwg.org/svg2-draft/painting.html#NonScalingStroke + * + * If the computed value of the 'vector-effect' property on aFrame is + * 'non-scaling-stroke', then this function will set aUserToOuterSVG to the + * transform from aFrame's SVG user space to the initial coordinate system + * established by the viewport of aFrame's outer-'s (the coordinate + * system in which the stroke is fixed). If aUserToOuterSVG is set to a + * non-identity matrix this function returns true, else it returns false. */ - static gfxMatrix GetStrokeTransform(nsIFrame *aFrame); + static bool GetNonScalingStrokeTransform(nsIFrame *aFrame, + gfxMatrix* aUserToOuterSVG); /** * Compute the maximum possible device space stroke extents of a path given From f8de38380910965a21d7e98379029d8391c63775 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 30 Sep 2014 18:08:14 +0100 Subject: [PATCH 88/93] Bug 1074807 - Remove nsSVGUtils::TransformOuterSVGPointToChildFrame. r=longsonr --- layout/svg/nsSVGUtils.cpp | 19 ------------------- layout/svg/nsSVGUtils.h | 9 --------- 2 files changed, 28 deletions(-) diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp index 6cc0d9c81cd5..1bc40d0a08a9 100644 --- a/layout/svg/nsSVGUtils.cpp +++ b/layout/svg/nsSVGUtils.cpp @@ -774,25 +774,6 @@ nsSVGUtils::GetCoveredRegion(const nsFrameList &aFrames) return rect; } -nsPoint -nsSVGUtils::TransformOuterSVGPointToChildFrame(nsPoint aPoint, - const gfxMatrix& aFrameToCanvasTM, - nsPresContext* aPresContext) -{ - NS_ABORT_IF_FALSE(!aFrameToCanvasTM.IsSingular(), - "Callers must not pass a singular matrix"); - gfxMatrix canvasDevToFrameUserSpace = aFrameToCanvasTM; - canvasDevToFrameUserSpace.Invert(); - gfxPoint cssPxPt = - gfxPoint(aPoint.x, aPoint.y) / aPresContext->AppUnitsPerCSSPixel(); - gfxPoint userPt = canvasDevToFrameUserSpace.Transform(cssPxPt); - gfxPoint appPt = (userPt * aPresContext->AppUnitsPerCSSPixel()).Round(); - userPt.x = clamped(appPt.x, gfxFloat(nscoord_MIN), gfxFloat(nscoord_MAX)); - userPt.y = clamped(appPt.y, gfxFloat(nscoord_MIN), gfxFloat(nscoord_MAX)); - // now guaranteed to be safe: - return nsPoint(nscoord(userPt.x), nscoord(userPt.y)); -} - nsRect nsSVGUtils::TransformFrameRectToOuterSVG(const nsRect& aRect, const gfxMatrix& aMatrix, diff --git a/layout/svg/nsSVGUtils.h b/layout/svg/nsSVGUtils.h index 08dab1a558b8..8e7bf533ffbf 100644 --- a/layout/svg/nsSVGUtils.h +++ b/layout/svg/nsSVGUtils.h @@ -342,15 +342,6 @@ public: static nsRect GetCoveredRegion(const nsFrameList &aFrames); - // Converts aPoint from an app unit point in outer- content rect space - // to an app unit point in a frame's SVG userspace. - // This is a temporary helper we should no longer need after bug 614732 is - // fixed. - static nsPoint - TransformOuterSVGPointToChildFrame(nsPoint aPoint, - const gfxMatrix& aFrameToCanvasTM, - nsPresContext* aPresContext); - static nsRect TransformFrameRectToOuterSVG(const nsRect& aRect, const gfxMatrix& aMatrix, From 0fb55f23f751eee58db5baa119decb6d1e340867 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 30 Sep 2014 18:08:14 +0100 Subject: [PATCH 89/93] Bug 1074820 - Refactor nsSVGPatternFrame, part 1. r=longsonr --- layout/svg/nsSVGPatternFrame.cpp | 40 ++++++++++++++------------------ layout/svg/nsSVGPatternFrame.h | 12 +++++++++- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp index b95a9e75802f..bce097f44483 100644 --- a/layout/svg/nsSVGPatternFrame.cpp +++ b/layout/svg/nsSVGPatternFrame.cpp @@ -251,11 +251,11 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, * Return */ - // Get the first child of the pattern data we will render - nsIFrame* firstKid = GetPatternFirstChild(); - if (!firstKid) { + nsSVGPatternFrame* patternWithChildren = GetPatternWithChildren(); + if (!patternWithChildren) { return nullptr; // Either no kids or a bad reference } + nsIFrame* firstKid = patternWithChildren->mFrames.FirstChild(); const nsSVGViewBox& viewBox = GetViewBox(); @@ -303,13 +303,10 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, return nullptr; } - // Get the pattern we are going to render - nsSVGPatternFrame *patternFrame = - static_cast(firstKid->GetParent()); - if (patternFrame->mCTM) { - *patternFrame->mCTM = ctm; + if (patternWithChildren->mCTM) { + *patternWithChildren->mCTM = ctm; } else { - patternFrame->mCTM = new gfxMatrix(ctm); + patternWithChildren->mCTM = new gfxMatrix(ctm); } // Get the bounding box of the pattern. This will be used to determine @@ -368,7 +365,7 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, gfxMatrix(surfaceSize.width / patternWidth, 0.0f, 0.0f, surfaceSize.height / patternHeight, 0.0f, 0.0f); - patternFrame->mCTM->PreMultiply(tempTM); + patternWithChildren->mCTM->PreMultiply(tempTM); // and rescale pattern to compensate patternMatrix->PreScale(patternWidth / surfaceSize.width, @@ -401,13 +398,13 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, if (aSource->IsFrameOfType(nsIFrame::eSVGGeometry)) { // Set the geometrical parent of the pattern we are rendering - patternFrame->mSource = static_cast(aSource); + patternWithChildren->mSource = static_cast(aSource); } // Delay checking NS_FRAME_DRAWING_AS_PAINTSERVER bit until here so we can // give back a clear surface if there's a loop - if (!(patternFrame->GetStateBits() & NS_FRAME_DRAWING_AS_PAINTSERVER)) { - patternFrame->AddStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER); + if (!(patternWithChildren->GetStateBits() & NS_FRAME_DRAWING_AS_PAINTSERVER)) { + patternWithChildren->AddStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER); for (nsIFrame* kid = firstKid; kid; kid = kid->GetNextSibling()) { // The CTM of each frame referencing us can be different @@ -415,17 +412,17 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, if (SVGFrame) { SVGFrame->NotifySVGChanged(nsISVGChildFrame::TRANSFORM_CHANGED); } - gfxMatrix tm = *(patternFrame->mCTM); + gfxMatrix tm = *(patternWithChildren->mCTM); if (kid->GetContent()->IsSVG()) { tm = static_cast(kid->GetContent())-> PrependLocalTransformsTo(tm, nsSVGElement::eUserSpaceToParent); } nsSVGUtils::PaintFrameWithEffects(kid, context, tm); } - patternFrame->RemoveStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER); + patternWithChildren->RemoveStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER); } - patternFrame->mSource = nullptr; + patternWithChildren->mSource = nullptr; if (aGraphicOpacity != 1.0f) { gfx->PopGroupToSource(); @@ -441,13 +438,12 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, // How do we handle the insertion of a new frame? // We really don't want to rerender this every time, // do we? -nsIFrame* -nsSVGPatternFrame::GetPatternFirstChild() +nsSVGPatternFrame* +nsSVGPatternFrame::GetPatternWithChildren() { // Do we have any children ourselves? - nsIFrame* kid = mFrames.FirstChild(); - if (kid) - return kid; + if (!mFrames.IsEmpty()) + return this; // No, see if we chain to someone who does AutoPatternReferencer patternRef(this); @@ -456,7 +452,7 @@ nsSVGPatternFrame::GetPatternFirstChild() if (!next) return nullptr; - return next->GetPatternFirstChild(); + return next->GetPatternWithChildren(); } uint16_t diff --git a/layout/svg/nsSVGPatternFrame.h b/layout/svg/nsSVGPatternFrame.h index 37fab695055c..d1c6f49bab3e 100644 --- a/layout/svg/nsSVGPatternFrame.h +++ b/layout/svg/nsSVGPatternFrame.h @@ -120,7 +120,17 @@ protected: nsStyleSVGPaint nsStyleSVG::*aFillOrStroke, float aGraphicOpacity, const gfxRect *aOverrideBounds); - nsIFrame* GetPatternFirstChild(); + + /** + * A element may reference another element using + * xlink:href and, if it doesn't have any child content of its own, then it + * will "inherit" the children of the referenced pattern (which may itself be + * inheriting its children if it references another ). This + * function returns this nsSVGPatternFrame or the first pattern along the + * reference chain (if there is one) to have children. + */ + nsSVGPatternFrame* GetPatternWithChildren(); + gfxRect GetPatternRect(uint16_t aPatternUnits, const gfxRect &bbox, const Matrix &callerCTM, From bf59ba6a7dc5c06d52c6ddcb7578cd578e409325 Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 10:30:47 -0700 Subject: [PATCH 90/93] Bumping gaia.json for 2 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/7f097f40e32e Author: Douglas Sherk Desc: Merge pull request #24541 from DouglasSherk/1037354-dialer-number-id Bug 1037354 - Remove the obsolete references to the TelephonyCall.number and TelephonyCall.secondNumber fields. r=etienne ======== https://hg.mozilla.org/integration/gaia-central/rev/26e2dfc17cb6 Author: Doug Sherk Desc: Bug 1037354 - Remove the obsolete references to the TelephonyCall.number and TelephonyCall.secondNumber fields. r=etienne --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 16d96f581424..6a490a92a774 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "remote": "", "branch": "" }, - "revision": "5e44ca06895398245327073a42f80cd3fb77d101", + "revision": "7f097f40e32ecba580890ce1d3df2a493641bdec", "repo_path": "/integration/gaia-central" } From 03f4e6fbe6ea15f7067e6b5323d4d7cb9824a7fe Mon Sep 17 00:00:00 2001 From: B2G Bumper Bot Date: Tue, 30 Sep 2014 10:36:59 -0700 Subject: [PATCH 91/93] Bumping manifests a=b2g-bump --- b2g/config/dolphin/sources.xml | 2 +- b2g/config/emulator-ics/sources.xml | 2 +- b2g/config/emulator-jb/sources.xml | 2 +- b2g/config/emulator-kk/sources.xml | 2 +- b2g/config/emulator/sources.xml | 2 +- b2g/config/flame-kk/sources.xml | 2 +- b2g/config/flame/sources.xml | 2 +- b2g/config/hamachi/sources.xml | 2 +- b2g/config/helix/sources.xml | 2 +- b2g/config/nexus-4/sources.xml | 2 +- b2g/config/wasabi/sources.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 31b5b87d2e79..a21af1cec99c 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5e750d6a9ea8..d70d7c6567ec 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index bca374eb1551..0f99fa55915a 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index e7c5ebac7b1c..c693d206d18a 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5e750d6a9ea8..d70d7c6567ec 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index dc8578fa87c9..f5f8958fdc5d 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml index 21ddcb495c73..69938d06f06a 100644 --- a/b2g/config/flame/sources.xml +++ b/b2g/config/flame/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 1ea776a9b707..3e302af1a5a4 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 62896753c864..e924eac37818 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index a51a90ad967e..d27a3c72cb82 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 403a77363f6a..8a78e21f5d68 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + From 1ec7ec8a2f8a272cbe485c984fa1b2fc1efcfa6e Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 30 Sep 2014 13:39:43 -0400 Subject: [PATCH 92/93] Backed out changeset dfbae87208dd (Bug 864327) for red --- content/base/src/nsGkAtomList.h | 7 - dom/fmradio/FMRadio.cpp | 119 --------- dom/fmradio/FMRadio.h | 28 -- dom/fmradio/FMRadioCommon.h | 8 +- dom/fmradio/FMRadioService.cpp | 415 ------------------------------ dom/fmradio/FMRadioService.h | 49 ---- dom/fmradio/ipc/FMRadioChild.cpp | 163 ------------ dom/fmradio/ipc/FMRadioChild.h | 39 --- dom/fmradio/ipc/FMRadioParent.cpp | 51 ---- dom/fmradio/ipc/FMRadioParent.h | 3 - dom/fmradio/ipc/PFMRadio.ipdl | 39 --- dom/webidl/FMRadio.webidl | 78 ------ 12 files changed, 1 insertion(+), 998 deletions(-) diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index 3ee09b4b8c77..91be00fa25fd 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -796,7 +796,6 @@ GK_ATOM(onMozMousePixelScroll, "onMozMousePixelScroll") GK_ATOM(onMozScrolledAreaChanged, "onMozScrolledAreaChanged") GK_ATOM(onmoznetworkupload, "onmoznetworkupload") GK_ATOM(onmoznetworkdownload, "onmoznetworkdownload") -GK_ATOM(onnewrdsgroup, "onnewrdsgroup") GK_ATOM(onnoupdate, "onnoupdate") GK_ATOM(onobsolete, "onobsolete") GK_ATOM(ononline, "ononline") @@ -813,16 +812,11 @@ GK_ATOM(onpairingconfirmationreq, "onpairingconfirmationreq") GK_ATOM(onpairingconsentreq, "onpairingconsentreq") GK_ATOM(onpaste, "onpaste") GK_ATOM(onpendingchange, "onpendingchange") -GK_ATOM(onpichange, "onpichange") GK_ATOM(onpopuphidden, "onpopuphidden") GK_ATOM(onpopuphiding, "onpopuphiding") GK_ATOM(onpopupshowing, "onpopupshowing") GK_ATOM(onpopupshown, "onpopupshown") -GK_ATOM(onpschange, "onpschange") -GK_ATOM(onptychange, "onptychange") GK_ATOM(onradiostatechange, "onradiostatechange") -GK_ATOM(onrdsdisabled, "onrdsdisabled") -GK_ATOM(onrdsenabled, "onrdsenabled") GK_ATOM(onreaderror, "onreaderror") GK_ATOM(onreadsuccess, "onreadsuccess") GK_ATOM(onready, "onready") @@ -837,7 +831,6 @@ GK_ATOM(onrequestmediaplaystatus, "onrequestmediaplaystatus") GK_ATOM(onreset, "onreset") GK_ATOM(onresuming, "onresuming") GK_ATOM(onresize, "onresize") -GK_ATOM(onrtchange, "onrtchange") GK_ATOM(onscostatuschanged, "onscostatuschanged") GK_ATOM(onscroll, "onscroll") GK_ATOM(onselect, "onselect") diff --git a/dom/fmradio/FMRadio.cpp b/dom/fmradio/FMRadio.cpp index 54b62a9ca69c..ada434208ba9 100644 --- a/dom/fmradio/FMRadio.cpp +++ b/dom/fmradio/FMRadio.cpp @@ -13,7 +13,6 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/PFMRadioChild.h" #include "mozilla/dom/FMRadioService.h" -#include "mozilla/dom/TypedArray.h" #include "DOMRequest.h" #include "nsDOMClassInfo.h" #include "nsIDocShell.h" @@ -106,7 +105,6 @@ NS_IMPL_ISUPPORTS_INHERITED0(FMRadioRequest, DOMRequest) FMRadio::FMRadio() : mHeadphoneState(SWITCH_STATE_OFF) - , mRdsGroupMask(0) , mAudioChannelAgentEnabled(false) , mHasInternalAntenna(false) , mIsShutdown(false) @@ -222,28 +220,6 @@ FMRadio::Notify(const FMRadioEventType& aType) DispatchTrustedEvent(NS_LITERAL_STRING("disabled")); } break; - case RDSEnabledChanged: - if (RdsEnabled()) { - DispatchTrustedEvent(NS_LITERAL_STRING("rdsenabled")); - } else { - DispatchTrustedEvent(NS_LITERAL_STRING("rdsdisabled")); - } - break; - case PIChanged: - DispatchTrustedEvent(NS_LITERAL_STRING("pichange")); - break; - case PSChanged: - DispatchTrustedEvent(NS_LITERAL_STRING("pschange")); - break; - case RadiotextChanged: - DispatchTrustedEvent(NS_LITERAL_STRING("rtchange")); - break; - case PTYChanged: - DispatchTrustedEvent(NS_LITERAL_STRING("ptychange")); - break; - case NewRDSGroup: - DispatchTrustedEvent(NS_LITERAL_STRING("newrdsgroup")); - break; default: MOZ_CRASH(); } @@ -256,12 +232,6 @@ FMRadio::Enabled() return IFMRadioService::Singleton()->IsEnabled(); } -bool -FMRadio::RdsEnabled() -{ - return IFMRadioService::Singleton()->IsRDSEnabled(); -} - bool FMRadio::AntennaAvailable() const { @@ -295,69 +265,6 @@ FMRadio::ChannelWidth() const return IFMRadioService::Singleton()->GetChannelWidth(); } -uint32_t -FMRadio::RdsGroupMask() const -{ - return mRdsGroupMask; -} - -void -FMRadio::SetRdsGroupMask(uint32_t aRdsGroupMask) -{ - mRdsGroupMask = aRdsGroupMask; - IFMRadioService::Singleton()->SetRDSGroupMask(aRdsGroupMask); -} - -Nullable -FMRadio::GetPi() const -{ - return IFMRadioService::Singleton()->GetPi(); -} - -Nullable -FMRadio::GetPty() const -{ - return IFMRadioService::Singleton()->GetPty(); -} - -void -FMRadio::GetPs(DOMString& aPsname) const -{ - if (!IFMRadioService::Singleton()->GetPs(aPsname)) { - aPsname.SetNull(); - } -} - -void -FMRadio::GetRt(DOMString& aRadiotext) const -{ - if (!IFMRadioService::Singleton()->GetRt(aRadiotext)) { - aRadiotext.SetNull(); - } -} - -void -FMRadio::GetRdsgroup(JSContext* cx, JS::MutableHandle retval) -{ - uint64_t group; - if (!IFMRadioService::Singleton()->GetRdsgroup(group)) { - return; - } - - JSObject *rdsgroup = Uint16Array::Create(cx, this, 4); - uint16_t *data = JS_GetUint16ArrayData(rdsgroup); - data[3] = group & 0xFFFF; - group >>= 16; - data[2] = group & 0xFFFF; - group >>= 16; - data[1] = group & 0xFFFF; - group >>= 16; - data[0] = group & 0xFFFF; - - JS::ExposeObjectToActiveJS(rdsgroup); - retval.set(rdsgroup); -} - already_AddRefed FMRadio::Enable(double aFrequency) { @@ -443,32 +350,6 @@ FMRadio::CancelSeek() return r.forget(); } -already_AddRefed -FMRadio::EnableRDS() -{ - nsCOMPtr win = GetOwner(); - if (!win) { - return nullptr; - } - - nsRefPtr r = new FMRadioRequest(win, this); - IFMRadioService::Singleton()->EnableRDS(r); - return r.forget(); -} - -already_AddRefed -FMRadio::DisableRDS() -{ - nsCOMPtr win = GetOwner(); - if (!win) { - return nullptr; - } - - nsRefPtr r = new FMRadioRequest(win, this); - FMRadioService::Singleton()->DisableRDS(r); - return r.forget(); -} - NS_IMETHODIMP FMRadio::HandleEvent(nsIDOMEvent* aEvent) { diff --git a/dom/fmradio/FMRadio.h b/dom/fmradio/FMRadio.h index 140f05314400..f6daf0c7cc80 100644 --- a/dom/fmradio/FMRadio.h +++ b/dom/fmradio/FMRadio.h @@ -55,8 +55,6 @@ public: static bool Enabled(); - bool RdsEnabled(); - bool AntennaAvailable() const; Nullable GetFrequency() const; @@ -67,20 +65,6 @@ public: double ChannelWidth() const; - uint32_t RdsGroupMask() const; - - void SetRdsGroupMask(uint32_t aRdsGroupMask); - - Nullable GetPi() const; - - Nullable GetPty() const; - - void GetPs(DOMString& aPsname) const; - - void GetRt(DOMString& aRadiotext) const; - - void GetRdsgroup(JSContext* cx, JS::MutableHandle retval); - already_AddRefed Enable(double aFrequency); already_AddRefed Disable(); @@ -93,21 +77,10 @@ public: already_AddRefed CancelSeek(); - already_AddRefed EnableRDS(); - - already_AddRefed DisableRDS(); - IMPL_EVENT_HANDLER(enabled); IMPL_EVENT_HANDLER(disabled); - IMPL_EVENT_HANDLER(rdsenabled); - IMPL_EVENT_HANDLER(rdsdisabled); IMPL_EVENT_HANDLER(antennaavailablechange); IMPL_EVENT_HANDLER(frequencychange); - IMPL_EVENT_HANDLER(pichange); - IMPL_EVENT_HANDLER(ptychange); - IMPL_EVENT_HANDLER(pschange); - IMPL_EVENT_HANDLER(rtchange); - IMPL_EVENT_HANDLER(newrdsgroup); // nsIDOMEventListener NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent); @@ -119,7 +92,6 @@ private: void EnableAudioChannelAgent(); hal::SwitchState mHeadphoneState; - uint32_t mRdsGroupMask; bool mAudioChannelAgentEnabled; bool mHasInternalAntenna; bool mIsShutdown; diff --git a/dom/fmradio/FMRadioCommon.h b/dom/fmradio/FMRadioCommon.h index b8d8325f7418..42fc690adb7d 100644 --- a/dom/fmradio/FMRadioCommon.h +++ b/dom/fmradio/FMRadioCommon.h @@ -30,13 +30,7 @@ BEGIN_FMRADIO_NAMESPACE enum FMRadioEventType { FrequencyChanged, - EnabledChanged, - RDSEnabledChanged, - PIChanged, - PSChanged, - PTYChanged, - RadiotextChanged, - NewRDSGroup + EnabledChanged }; typedef mozilla::Observer FMRadioEventObserver; diff --git a/dom/fmradio/FMRadioService.cpp b/dom/fmradio/FMRadioService.cpp index 3a198624df82..e80a278ce951 100644 --- a/dom/fmradio/FMRadioService.cpp +++ b/dom/fmradio/FMRadioService.cpp @@ -26,8 +26,6 @@ #define MOZSETTINGS_CHANGED_ID "mozsettings-changed" #define SETTING_KEY_AIRPLANEMODE_ENABLED "airplaneMode.enabled" -#define DOM_PARSED_RDS_GROUPS ((0x2 << 30) | (0x3 << 4) | (0x3 << 0)) - using namespace mozilla::hal; using mozilla::Preferences; @@ -51,26 +49,9 @@ FMRadioService::FMRadioService() , mState(Disabled) , mHasReadAirplaneModeSetting(false) , mAirplaneModeEnabled(false) - , mRDSEnabled(false) , mPendingRequest(nullptr) , mObserverList(FMRadioEventObserverList()) - , mRDSGroupMask(0) - , mLastPI(0) - , mPI(0) - , mPTY(0) - , mPISet(false) - , mPTYSet(false) - , mRDSLock("FMRadioService::mRDSLock") - , mPSNameState(0) - , mRadiotextAB(false) - , mRDSGroupSet(false) - , mPSNameSet(false) - , mRadiotextSet(false) { - memset(mPSName, 0, sizeof(mPSName)); - memset(mRadiotext, 0, sizeof(mRadiotext)); - memset(mTempPSName, 0, sizeof(mTempPSName)); - memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); // Read power state and frequency from Hal. mEnabled = IsFMRadioOn(); @@ -129,12 +110,10 @@ FMRadioService::FMRadioService() } RegisterFMRadioObserver(this); - RegisterFMRadioRDSObserver(this); } FMRadioService::~FMRadioService() { - UnregisterFMRadioRDSObserver(this); UnregisterFMRadioObserver(this); } @@ -298,21 +277,6 @@ private: FMRadioSeekDirection mDirection; }; -class NotifyRunnable MOZ_FINAL : public nsRunnable -{ -public: - NotifyRunnable(FMRadioEventType aType) : mType(aType) { } - - NS_IMETHOD Run() - { - FMRadioService::Singleton()->NotifyFMRadioEvent(mType); - return NS_OK; - } - -private: - FMRadioEventType mType; -}; - void FMRadioService::TransitionState(const FMRadioResponseType& aResponse, FMRadioState aState) @@ -410,13 +374,6 @@ FMRadioService::IsEnabled() const return IsFMRadioOn(); } -bool -FMRadioService::IsRDSEnabled() const -{ - MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); - return mRDSEnabled; -} - double FMRadioService::GetFrequency() const { @@ -450,54 +407,6 @@ FMRadioService::GetChannelWidth() const return mChannelWidthInKHz / 1000.0; } -Nullable -FMRadioService::GetPi() const -{ - MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); - if (!mPISet) { - return Nullable(); - } - return Nullable(mPI); -} - -Nullable -FMRadioService::GetPty() const -{ - MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); - if (!mPTYSet) { - return Nullable(); - } - return Nullable(mPTY); -} - -bool -FMRadioService::GetPs(nsString& aPSName) -{ - MutexAutoLock lock(mRDSLock); - if (mPSNameSet) { - aPSName = nsString(mPSName); - } - return mPSNameSet; -} - -bool -FMRadioService::GetRt(nsString& aRadiotext) -{ - MutexAutoLock lock(mRDSLock); - if (mRadiotextSet) { - aRadiotext = nsString(mRadiotext); - } - return mRadiotextSet; -} - -bool -FMRadioService::GetRdsgroup(uint64_t& aRDSGroup) -{ - MutexAutoLock lock(mRDSLock); - aRDSGroup = mRDSGroup; - return mRDSGroupSet; -} - void FMRadioService::Enable(double aFrequencyInMHz, FMRadioReplyRunnable* aReplyRunnable) @@ -770,47 +679,6 @@ FMRadioService::CancelSeek(FMRadioReplyRunnable* aReplyRunnable) NS_DispatchToMainThread(aReplyRunnable); } -void -FMRadioService::SetRDSGroupMask(uint32_t aRDSGroupMask) -{ - mRDSGroupMask = aRDSGroupMask; - if (IsFMRadioOn()) { - hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS); - } -} - -void -FMRadioService::EnableRDS(FMRadioReplyRunnable* aReplyRunnable) -{ - MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); - MOZ_ASSERT(aReplyRunnable); - - mRDSEnabled = true; - if (IsFMRadioOn()) { - hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS); - } - - aReplyRunnable->SetReply(SuccessResponse()); - NS_DispatchToMainThread(aReplyRunnable); - NS_DispatchToMainThread(new NotifyRunnable(RDSEnabledChanged)); -} - -void -FMRadioService::DisableRDS(FMRadioReplyRunnable* aReplyRunnable) -{ - MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!"); - MOZ_ASSERT(aReplyRunnable); - - mRDSEnabled = false; - if (IsFMRadioOn()) { - hal::DisableRDS(); - } - - aReplyRunnable->SetReply(SuccessResponse()); - NS_DispatchToMainThread(aReplyRunnable); - NS_DispatchToMainThread(new NotifyRunnable(RDSEnabledChanged)); -} - NS_IMETHODIMP FMRadioService::Observe(nsISupports* aSubject, const char* aTopic, @@ -892,18 +760,10 @@ FMRadioService::Notify(const FMRadioOperationInformation& aInfo) // The frequency was changed from '0' to some meaningful number, so we // should send the `FrequencyChanged` event manually. NotifyFMRadioEvent(FrequencyChanged); - - if (mRDSEnabled) { - hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS); - } break; case FM_RADIO_OPERATION_DISABLE: MOZ_ASSERT(mState == Disabling); - mPISet = false; - mPTYSet = false; - memset(mPSName, 0, sizeof(mPSName)); - memset(mRadiotext, 0, sizeof(mRadiotext)); TransitionState(SuccessResponse(), Disabled); UpdatePowerState(); break; @@ -925,274 +785,6 @@ FMRadioService::Notify(const FMRadioOperationInformation& aInfo) } } -/* This is defined by the RDS standard */ -static const uint16_t sRDSToUnicodeMap[256] = { - // The lower half differs from ASCII in 0x1F, 0x24, 0x5E, 0x7E - // Most control characters are replaced with 0x20 (space) - // 0x0- - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0009, 0x000A, 0x000B, 0x0020, 0x00D0, 0x0020, 0x0020, - - // 0x1- - 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, - 0x0020, 0x0020, 0x0020, 0x001B, 0x0020, 0x0020, 0x0020, 0x00AD, - - // 0x2- - 0x0020, 0x0021, 0x0022, 0x0023, 0x00A4, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, - - // 0x3- - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, - - // 0x4- - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, - - // 0x5- - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x2015, 0x005F, - - // 0x6- - 0x2551, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, - - // 0x7- - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x00AF, 0x007F, - - // 0x8- - 0x00E1, 0x00E0, 0x00E9, 0x00E8, 0x00ED, 0x00EC, 0x00F3, 0x00F2, - 0x00FA, 0x00F9, 0x00D1, 0x00C7, 0x015E, 0x00DF, 0x00A1, 0x0132, - - // 0x9- - 0x00E2, 0x00E4, 0x00EA, 0x00EB, 0x00EE, 0x00EF, 0x00F4, 0x00F6, - 0x00FB, 0x00FC, 0x00F1, 0x00E7, 0x015F, 0x011F, 0x0131, 0x0133, - - // 0xA- - 0x00AA, 0x03B1, 0x00A9, 0x2030, 0x011E, 0x011B, 0x0148, 0x0151, - 0x03C0, 0x20AC, 0x00A3, 0x0024, 0x2190, 0x2191, 0x2192, 0x2193, - - // 0xB- - 0x00BA, 0x00B9, 0x00B2, 0x00B3, 0x00B1, 0x0130, 0x0144, 0x0171, - 0x03BC, 0x00BF, 0x00F7, 0x00B0, 0x00BC, 0x00BD, 0x00BE, 0x00A7, - - // 0xC- - 0x00C1, 0x00C0, 0x00C9, 0x00C8, 0x00CD, 0x00CC, 0x00D3, 0x00D2, - 0x00DA, 0x00D9, 0x0158, 0x010C, 0x0160, 0x017D, 0x00D0, 0x013F, - - // 0xD- - 0x00C2, 0x00C4, 0x00CA, 0x00CB, 0x00CE, 0x00CF, 0x00D4, 0x00D6, - 0x00DB, 0x00DC, 0x0159, 0x010D, 0x0161, 0x017E, 0x0111, 0x0140, - - // 0xE- - 0x00C3, 0x00C5, 0x00C6, 0x0152, 0x0177, 0x00DD, 0x00D5, 0x00D8, - 0x00DE, 0x014A, 0x0154, 0x0106, 0x015A, 0x0179, 0x0166, 0x00F0, - - // 0xF- - 0x00E3, 0x00E5, 0x00E6, 0x0153, 0x0175, 0x00FD, 0x00F5, 0x00F8, - 0x00FE, 0x014B, 0x0155, 0x0107, 0x015B, 0x017A, 0x0167, 0x0020, -}; - -void -FMRadioService::Notify(const FMRadioRDSGroup& aRDSGroup) -{ - uint16_t blocks[4]; - blocks[0] = aRDSGroup.blockA(); - blocks[1] = aRDSGroup.blockB(); - blocks[2] = aRDSGroup.blockC(); - blocks[3] = aRDSGroup.blockD(); - - /* Bit 11 in block B determines whether this is a type B group. */ - uint16_t lastPI = blocks[1] & (1 << 11) ? blocks[2] : mLastPI; - - /* Update PI if it's not set or if we get two PI with the new value. */ - if ((mPI != blocks[0] && lastPI == blocks[0]) || !mPISet) { - mPI = blocks[0]; - if (!mPISet) { - mPSNameState = 0; - mRadiotextState = 0; - memset(mTempPSName, 0, sizeof(mTempPSName)); - memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); - } - mPISet = true; - NS_DispatchToMainThread(new NotifyRunnable(PIChanged)); - } - mLastPI = blocks[0]; - - /* PTY is also updated using the same logic as PI */ - uint16_t pty = (blocks[1] >> 5) & 0x1F; - if ((mPTY != pty && pty == mLastPTY) || !mPTYSet) { - mPTY = pty; - mPTYSet = true; - NS_DispatchToMainThread(new NotifyRunnable(PTYChanged)); - } - mLastPTY = pty; - - uint16_t grouptype = blocks[1] >> 11; - switch (grouptype) { - case 0: // 0a - case 1: // 0b - { - uint16_t segmentAddr = (blocks[1] & 0x3); - // mPSNameState is a bitmask that lets us ensure all segments - // are received before updating the PS name. - if (!segmentAddr) { - mPSNameState = 1; - } else { - mPSNameState |= 1 << segmentAddr; - } - - uint16_t offset = segmentAddr << 1; - mTempPSName[offset] = sRDSToUnicodeMap[blocks[3] >> 8]; - mTempPSName[offset + 1] = sRDSToUnicodeMap[blocks[3] & 0xFF]; - - if (mPSNameState != 0xF) { - break; - } - - mPSNameState = 0; - if (memcmp(mTempPSName, mPSName, sizeof(mTempPSName))) { - MutexAutoLock lock(mRDSLock); - mPSNameSet = true; - memcpy(mPSName, mTempPSName, sizeof(mTempPSName)); - NS_DispatchToMainThread(new NotifyRunnable(PSChanged)); - } - break; - } - case 4: // 2a Radiotext - { - uint16_t segmentAddr = (blocks[1] & 0xF); - bool textAB = blocks[1] & (1 << 5); - if (textAB != mRadiotextAB) { - mRadiotextState = 0; - memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); - mRadiotextAB = textAB; - MutexAutoLock lock(mRDSLock); - memset(mRadiotext, 0, sizeof(mRadiotext)); - NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); - } - - // mRadiotextState is a bitmask that lets us ensure all segments - // are received before updating the radiotext. - if (!segmentAddr) { - mRadiotextState = 1; - } else { - mRadiotextState |= 1 << segmentAddr; - } - - uint8_t segment[4]; - segment[0] = blocks[2] >> 8; - segment[1] = blocks[2] & 0xFF; - segment[2] = blocks[3] >> 8; - segment[3] = blocks[3] & 0xFF; - - uint16_t offset = segmentAddr << 2; - bool done = false; - for (int i = 0; i < 4; i++) { - if (segment[i] == '\r') { - mTempRadiotext[offset++] = 0; - done = true; - } else { - mTempRadiotext[offset++] = sRDSToUnicodeMap[segment[i]]; - } - } - if (offset == 64) { - done = true; - } - - if (!done || - (mRadiotextState + 1) != (1 << ((blocks[1] & 0xF) + 1)) || - !memcmp(mTempRadiotext, mRadiotext, sizeof(mTempRadiotext))) { - break; - } - - MutexAutoLock lock(mRDSLock); - mRadiotextSet = true; - memcpy(mRadiotext, mTempRadiotext, sizeof(mTempRadiotext)); - NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); - break; - } - case 5: // 2b Radiotext - { - uint16_t segmentAddr = (blocks[1] & 0xF); - bool textAB = blocks[1] & (1 << 5); - if (textAB != mRadiotextAB) { - mRadiotextState = 0; - memset(mTempRadiotext, 0, sizeof(mTempRadiotext)); - mRadiotextAB = textAB; - MutexAutoLock lock(mRDSLock); - memset(mRadiotext, 0, sizeof(mRadiotext)); - NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); - } - - if (!segmentAddr) { - mRadiotextState = 1; - } else { - mRadiotextState |= 1 << segmentAddr; - } - uint8_t segment[2]; - segment[0] = blocks[3] >> 8; - segment[1] = blocks[3] & 0xFF; - - uint16_t offset = segmentAddr << 1; - bool done = false; - for (int i = 0; i < 2; i++) { - if (segment[i] == '\r') { - mTempRadiotext[offset++] = 0; - done = true; - } else { - mTempRadiotext[offset++] = sRDSToUnicodeMap[segment[i]]; - } - } - if (offset == 32) { - done = true; - } - - if (!done || - (mRadiotextState + 1) != (1 << ((blocks[1] & 0xF) + 1)) || - !memcmp(mTempRadiotext, mRadiotext, sizeof(mTempRadiotext))) { - break; - } - - MutexAutoLock lock(mRDSLock); - mRadiotextSet = true; - memcpy(mRadiotext, mTempRadiotext, sizeof(mTempRadiotext)); - NS_DispatchToMainThread(new NotifyRunnable(RadiotextChanged)); - break; - } - case 31: // 15b Fast Tuning and Switching - { - uint16_t secondPty = (blocks[3] >> 5) & 0x1F; - if (pty == mPTY || pty != secondPty) { - break; - } - mPTY = pty; - NS_DispatchToMainThread(new NotifyRunnable(PTYChanged)); - break; - } - } - - // Only notify users of raw RDS groups that they're interested in. - // We always receive DOM_PARSED_RDS_GROUPS when RDS is enabled. - if (!(mRDSGroupMask & (1 << grouptype))) { - return; - } - - uint64_t newgroup = blocks[0]; - newgroup <<= 16; - newgroup |= blocks[1]; - newgroup <<= 16; - newgroup |= blocks[2]; - newgroup <<= 16; - newgroup |= blocks[3]; - - MutexAutoLock lock(mRDSLock); - mRDSGroup = newgroup; - mRDSGroupSet = true; - NS_DispatchToMainThread(new NotifyRunnable(NewRDSGroup)); -} - void FMRadioService::UpdatePowerState() { @@ -1210,13 +802,6 @@ FMRadioService::UpdateFrequency() if (mPendingFrequencyInKHz != frequency) { mPendingFrequencyInKHz = frequency; NotifyFMRadioEvent(FrequencyChanged); - mPISet = false; - mPTYSet = false; - memset(mPSName, 0, sizeof(mPSName)); - memset(mRadiotext, 0, sizeof(mRadiotext)); - mRDSGroupSet = false; - mPSNameSet = false; - mRadiotextSet = false; } } diff --git a/dom/fmradio/FMRadioService.h b/dom/fmradio/FMRadioService.h index 836ef2601003..eb9666545d2e 100644 --- a/dom/fmradio/FMRadioService.h +++ b/dom/fmradio/FMRadioService.h @@ -7,11 +7,9 @@ #ifndef mozilla_dom_fmradioservice_h__ #define mozilla_dom_fmradioservice_h__ -#include "mozilla/dom/Nullable.h" #include "mozilla/dom/PFMRadioRequest.h" #include "FMRadioCommon.h" #include "mozilla/Hal.h" -#include "mozilla/Mutex.h" #include "mozilla/StaticPtr.h" #include "mozilla/Services.h" #include "nsThreadUtils.h" @@ -97,16 +95,10 @@ protected: public: virtual bool IsEnabled() const = 0; - virtual bool IsRDSEnabled() const = 0; virtual double GetFrequency() const = 0; virtual double GetFrequencyUpperBound() const = 0; virtual double GetFrequencyLowerBound() const = 0; virtual double GetChannelWidth() const = 0; - virtual Nullable GetPi() const = 0; - virtual Nullable GetPty() const = 0; - virtual bool GetPs(nsString& aPsname) = 0; - virtual bool GetRt(nsString& aRadiotext) = 0; - virtual bool GetRdsgroup(uint64_t& aRDSGroup) = 0; virtual void Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) = 0; virtual void Disable(FMRadioReplyRunnable* aReplyRunnable) = 0; @@ -114,9 +106,6 @@ public: virtual void Seek(mozilla::hal::FMRadioSeekDirection aDirection, FMRadioReplyRunnable* aReplyRunnable) = 0; virtual void CancelSeek(FMRadioReplyRunnable* aReplyRunnable) = 0; - virtual void SetRDSGroupMask(uint32_t aRDSGroupMask) = 0; - virtual void EnableRDS(FMRadioReplyRunnable* aReplyRunnable) = 0; - virtual void DisableRDS(FMRadioReplyRunnable* aReplyRunnable) = 0; /** * Register handler to receive the FM Radio events, including: @@ -149,13 +138,11 @@ enum FMRadioState class FMRadioService MOZ_FINAL : public IFMRadioService , public hal::FMRadioObserver - , public hal::FMRadioRDSObserver , public nsIObserver { friend class ReadAirplaneModeSettingTask; friend class EnableRunnable; friend class DisableRunnable; - friend class NotifyRunnable; public: static FMRadioService* Singleton(); @@ -164,16 +151,10 @@ public: NS_DECL_ISUPPORTS virtual bool IsEnabled() const MOZ_OVERRIDE; - virtual bool IsRDSEnabled() const MOZ_OVERRIDE; virtual double GetFrequency() const MOZ_OVERRIDE; virtual double GetFrequencyUpperBound() const MOZ_OVERRIDE; virtual double GetFrequencyLowerBound() const MOZ_OVERRIDE; virtual double GetChannelWidth() const MOZ_OVERRIDE; - virtual Nullable GetPi() const MOZ_OVERRIDE; - virtual Nullable GetPty() const MOZ_OVERRIDE; - virtual bool GetPs(nsString& aPsname) MOZ_OVERRIDE; - virtual bool GetRt(nsString& aRadiotext) MOZ_OVERRIDE; - virtual bool GetRdsgroup(uint64_t& aRDSGroup) MOZ_OVERRIDE; virtual void Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; @@ -183,9 +164,6 @@ public: virtual void Seek(mozilla::hal::FMRadioSeekDirection aDirection, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void CancelSeek(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; - virtual void SetRDSGroupMask(uint32_t aRDSGroupMask) MOZ_OVERRIDE; - virtual void EnableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; - virtual void DisableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void AddObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; virtual void RemoveObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; @@ -194,8 +172,6 @@ public: /* FMRadioObserver */ void Notify(const hal::FMRadioOperationInformation& aInfo) MOZ_OVERRIDE; - /* FMRadioRDSObserver */ - void Notify(const hal::FMRadioRDSGroup& aRDSGroup) MOZ_OVERRIDE; NS_DECL_NSIOBSERVER @@ -221,7 +197,6 @@ private: bool mHasReadAirplaneModeSetting; bool mAirplaneModeEnabled; - bool mRDSEnabled; uint32_t mUpperBoundInKHz; uint32_t mLowerBoundInKHz; @@ -234,30 +209,6 @@ private: FMRadioEventObserverList mObserverList; static StaticRefPtr sFMRadioService; - - uint32_t mRDSGroupMask; - - uint16_t mLastPI; - uint16_t mLastPTY; - Atomic mPI; - Atomic mPTY; - Atomic mPISet; - Atomic mPTYSet; - - /* Protects mPSName, mRadiotext, and mRDSGroup */ - Mutex mRDSLock; - char16_t mPSName[9]; - char16_t mRadiotext[65]; - uint64_t mRDSGroup; - - uint8_t mPSNameState; - uint16_t mRadiotextState; - uint16_t mTempPSName[8]; - uint16_t mTempRadiotext[64]; - bool mRadiotextAB; - bool mRDSGroupSet; - bool mPSNameSet; - bool mRadiotextSet; }; END_FMRADIO_NAMESPACE diff --git a/dom/fmradio/ipc/FMRadioChild.cpp b/dom/fmradio/ipc/FMRadioChild.cpp index f74fda4e1832..0433bfce199a 100644 --- a/dom/fmradio/ipc/FMRadioChild.cpp +++ b/dom/fmradio/ipc/FMRadioChild.cpp @@ -16,13 +16,7 @@ StaticAutoPtr FMRadioChild::sFMRadioChild; FMRadioChild::FMRadioChild() : mEnabled(false) - , mRDSEnabled(false) - , mRDSGroupSet(false) - , mPSNameSet(false) - , mRadiotextSet(false) , mFrequency(0) - , mRDSGroup(0) - , mRDSGroupMask(0) , mObserverList(FMRadioEventObserverList()) { MOZ_COUNT_CTOR(FMRadioChild); @@ -50,12 +44,6 @@ FMRadioChild::IsEnabled() const return mEnabled; } -bool -FMRadioChild::IsRDSEnabled() const -{ - return mRDSEnabled; -} - double FMRadioChild::GetFrequency() const { @@ -81,43 +69,6 @@ FMRadioChild::GetChannelWidth() const return mChannelWidth; } -Nullable -FMRadioChild::GetPi() const -{ - return mPI; -} - -Nullable -FMRadioChild::GetPty() const -{ - return mPTY; -} - -bool -FMRadioChild::GetPs(nsString& aPSName) -{ - if (mPSNameSet) { - aPSName = mPSName; - } - return mPSNameSet; -} - -bool -FMRadioChild::GetRt(nsString& aRadiotext) -{ - if (mRadiotextSet) { - aRadiotext = mRadiotext; - } - return mRadiotextSet; -} - -bool -FMRadioChild::GetRdsgroup(uint64_t& aRDSGroup) -{ - aRDSGroup = mRDSGroup; - return mRDSGroupSet; -} - void FMRadioChild::Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) { @@ -150,25 +101,6 @@ FMRadioChild::CancelSeek(FMRadioReplyRunnable* aReplyRunnable) SendRequest(aReplyRunnable, CancelSeekRequestArgs()); } -void -FMRadioChild::SetRDSGroupMask(uint32_t aRDSGroupMask) -{ - mRDSGroupMask = aRDSGroupMask; - SendSetRDSGroupMask(aRDSGroupMask); -} - -void -FMRadioChild::EnableRDS(FMRadioReplyRunnable* aReplyRunnable) -{ - SendRequest(aReplyRunnable, EnableRDSArgs()); -} - -void -FMRadioChild::DisableRDS(FMRadioReplyRunnable* aReplyRunnable) -{ - SendRequest(aReplyRunnable, DisableRDSArgs()); -} - inline void FMRadioChild::NotifyFMRadioEvent(FMRadioEventType aType) { @@ -200,26 +132,6 @@ FMRadioChild::RecvNotifyFrequencyChanged(const double& aFrequency) { mFrequency = aFrequency; NotifyFMRadioEvent(FrequencyChanged); - - if (!mPI.IsNull()) { - mPI.SetNull(); - NotifyFMRadioEvent(PIChanged); - } - if (!mPTY.IsNull()) { - mPTY.SetNull(); - NotifyFMRadioEvent(PTYChanged); - } - if (mPSNameSet) { - mPSNameSet = false; - mPSName.Truncate(); - NotifyFMRadioEvent(PSChanged); - } - if (mRadiotextSet) { - mRadiotextSet = false; - mRadiotext.Truncate(); - NotifyFMRadioEvent(RadiotextChanged); - } - mRDSGroupSet = false; return true; } @@ -229,85 +141,10 @@ FMRadioChild::RecvNotifyEnabledChanged(const bool& aEnabled, { mEnabled = aEnabled; mFrequency = aFrequency; - if (!mEnabled) { - mPI.SetNull(); - mPTY.SetNull(); - mPSName.Truncate(); - mRadiotext.Truncate(); - mRDSGroupSet = false; - mPSNameSet = false; - mRadiotextSet = false; - } NotifyFMRadioEvent(EnabledChanged); return true; } -bool -FMRadioChild::RecvNotifyRDSEnabledChanged(const bool& aEnabled) -{ - mRDSEnabled = aEnabled; - NotifyFMRadioEvent(RDSEnabledChanged); - return true; -} - -bool -FMRadioChild::RecvNotifyPIChanged(const bool& aValid, - const uint16_t& aCode) -{ - if (aValid) { - mPI.SetValue(aCode); - } else { - mPI.SetNull(); - } - NotifyFMRadioEvent(PIChanged); - return true; -} - -bool -FMRadioChild::RecvNotifyPTYChanged(const bool& aValid, - const uint8_t& aPTY) -{ - if (aValid) { - mPTY.SetValue(aPTY); - } else { - mPTY.SetNull(); - } - NotifyFMRadioEvent(PTYChanged); - return true; -} - -bool -FMRadioChild::RecvNotifyPSChanged(const nsString& aPSName) -{ - mPSNameSet = true; - mPSName = aPSName; - NotifyFMRadioEvent(PSChanged); - return true; -} - -bool -FMRadioChild::RecvNotifyRadiotextChanged(const nsString& aRadiotext) -{ - mRadiotextSet = true; - mRadiotext = aRadiotext; - NotifyFMRadioEvent(RadiotextChanged); - return true; -} - -bool -FMRadioChild::RecvNotifyNewRDSGroup(const uint64_t& aGroup) -{ - uint16_t grouptype = (aGroup >> 43) & 0x1F; - if (!(mRDSGroupMask & (1 << grouptype))) { - return true; - } - - mRDSGroupSet = true; - mRDSGroup = aGroup; - NotifyFMRadioEvent(NewRDSGroup); - return true; -} - bool FMRadioChild::Recv__delete__() { diff --git a/dom/fmradio/ipc/FMRadioChild.h b/dom/fmradio/ipc/FMRadioChild.h index 1f39f1d8c24c..ff9f6162f04d 100644 --- a/dom/fmradio/ipc/FMRadioChild.h +++ b/dom/fmradio/ipc/FMRadioChild.h @@ -34,16 +34,10 @@ public: /* IFMRadioService */ virtual bool IsEnabled() const MOZ_OVERRIDE; - virtual bool IsRDSEnabled() const MOZ_OVERRIDE; virtual double GetFrequency() const MOZ_OVERRIDE; virtual double GetFrequencyUpperBound() const MOZ_OVERRIDE; virtual double GetFrequencyLowerBound() const MOZ_OVERRIDE; virtual double GetChannelWidth() const MOZ_OVERRIDE; - virtual Nullable GetPi() const MOZ_OVERRIDE; - virtual Nullable GetPty() const MOZ_OVERRIDE; - virtual bool GetPs(nsString& aPSName) MOZ_OVERRIDE; - virtual bool GetRt(nsString& aRadiotext) MOZ_OVERRIDE; - virtual bool GetRdsgroup(uint64_t& aRDSGroup) MOZ_OVERRIDE; virtual void Enable(double aFrequency, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; @@ -53,9 +47,6 @@ public: virtual void Seek(mozilla::hal::FMRadioSeekDirection aDirection, FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void CancelSeek(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; - virtual void SetRDSGroupMask(uint32_t aRDSGroupMask) MOZ_OVERRIDE; - virtual void EnableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; - virtual void DisableRDS(FMRadioReplyRunnable* aReplyRunnable) MOZ_OVERRIDE; virtual void AddObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; virtual void RemoveObserver(FMRadioEventObserver* aObserver) MOZ_OVERRIDE; @@ -73,26 +64,6 @@ public: RecvNotifyEnabledChanged(const bool& aEnabled, const double& aFrequency) MOZ_OVERRIDE; - virtual bool - RecvNotifyRDSEnabledChanged(const bool& aEnabled) MOZ_OVERRIDE; - - virtual bool - RecvNotifyPIChanged(const bool& aValid, - const uint16_t& aCode) MOZ_OVERRIDE; - - virtual bool - RecvNotifyPTYChanged(const bool& aValid, - const uint8_t& aPTY) MOZ_OVERRIDE; - - virtual bool - RecvNotifyPSChanged(const nsString& aPSName) MOZ_OVERRIDE; - - virtual bool - RecvNotifyRadiotextChanged(const nsString& aRadiotext) MOZ_OVERRIDE; - - virtual bool - RecvNotifyNewRDSGroup(const uint64_t& aGroup) MOZ_OVERRIDE; - virtual PFMRadioRequestChild* AllocPFMRadioRequestChild(const FMRadioRequestArgs& aArgs) MOZ_OVERRIDE; @@ -107,20 +78,10 @@ private: inline void NotifyFMRadioEvent(FMRadioEventType aType); bool mEnabled; - bool mRDSEnabled; - bool mRDSGroupSet; - bool mPSNameSet; - bool mRadiotextSet; double mFrequency; double mUpperBound; double mLowerBound; double mChannelWidth; - Nullable mPI; - Nullable mPTY; - nsAutoString mPSName; - nsAutoString mRadiotext; - uint64_t mRDSGroup; - uint32_t mRDSGroupMask; FMRadioEventObserverList mObserverList; diff --git a/dom/fmradio/ipc/FMRadioParent.cpp b/dom/fmradio/ipc/FMRadioParent.cpp index 50db2cd83b4a..b8af6680f030 100644 --- a/dom/fmradio/ipc/FMRadioParent.cpp +++ b/dom/fmradio/ipc/FMRadioParent.cpp @@ -6,7 +6,6 @@ #include "FMRadioParent.h" #include "mozilla/unused.h" #include "mozilla/dom/ContentParent.h" -#include "mozilla/DebugOnly.h" #include "FMRadioRequestParent.h" #include "FMRadioService.h" @@ -70,12 +69,6 @@ FMRadioParent::AllocPFMRadioRequestParent(const FMRadioRequestArgs& aArgs) case FMRadioRequestArgs::TCancelSeekRequestArgs: IFMRadioService::Singleton()->CancelSeek(requestParent); break; - case FMRadioRequestArgs::TEnableRDSArgs: - IFMRadioService::Singleton()->EnableRDS(requestParent); - break; - case FMRadioRequestArgs::TDisableRDSArgs: - IFMRadioService::Singleton()->DisableRDS(requestParent); - break; default: MOZ_CRASH(); } @@ -105,43 +98,6 @@ FMRadioParent::Notify(const FMRadioEventType& aType) IFMRadioService::Singleton()->IsEnabled(), IFMRadioService::Singleton()->GetFrequency()); break; - case RDSEnabledChanged: - unused << SendNotifyRDSEnabledChanged( - IFMRadioService::Singleton()->IsRDSEnabled()); - break; - case PIChanged: { - Nullable pi = - IFMRadioService::Singleton()->GetPi(); - unused << SendNotifyPIChanged(!pi.IsNull(), - pi.IsNull() ? 0 : pi.Value()); - break; - } - case PTYChanged: { - Nullable pty = IFMRadioService::Singleton()->GetPty(); - unused << SendNotifyPTYChanged(!pty.IsNull(), - pty.IsNull() ? 0 : pty.Value()); - break; - } - case PSChanged: { - nsAutoString psname; - IFMRadioService::Singleton()->GetPs(psname); - unused << SendNotifyPSChanged(psname); - break; - } - case RadiotextChanged: { - nsAutoString radiotext; - IFMRadioService::Singleton()->GetRt(radiotext); - unused << SendNotifyRadiotextChanged(radiotext); - break; - } - case NewRDSGroup: { - uint64_t group; - DebugOnly rdsgroupset = - IFMRadioService::Singleton()->GetRdsgroup(group); - MOZ_ASSERT(rdsgroupset); - unused << SendNotifyNewRDSGroup(group); - break; - } default: NS_RUNTIMEABORT("not reached"); break; @@ -155,12 +111,5 @@ FMRadioParent::RecvEnableAudio(const bool& aAudioEnabled) return true; } -bool -FMRadioParent::RecvSetRDSGroupMask(const uint32_t& aRDSGroupMask) -{ - IFMRadioService::Singleton()->SetRDSGroupMask(aRDSGroupMask); - return true; -} - END_FMRADIO_NAMESPACE diff --git a/dom/fmradio/ipc/FMRadioParent.h b/dom/fmradio/ipc/FMRadioParent.h index 024b240d75ef..96cc5a484ee6 100644 --- a/dom/fmradio/ipc/FMRadioParent.h +++ b/dom/fmradio/ipc/FMRadioParent.h @@ -39,9 +39,6 @@ public: virtual bool RecvEnableAudio(const bool& aAudioEnabled) MOZ_OVERRIDE; - - virtual bool - RecvSetRDSGroupMask(const uint32_t& aRDSGroupMask) MOZ_OVERRIDE; }; END_FMRADIO_NAMESPACE diff --git a/dom/fmradio/ipc/PFMRadio.ipdl b/dom/fmradio/ipc/PFMRadio.ipdl index f4929cfe70b9..be863e1a5e15 100644 --- a/dom/fmradio/ipc/PFMRadio.ipdl +++ b/dom/fmradio/ipc/PFMRadio.ipdl @@ -34,14 +34,6 @@ struct CancelSeekRequestArgs { }; -struct EnableRDSArgs -{ -}; - -struct DisableRDSArgs -{ -}; - union FMRadioRequestArgs { EnableRequestArgs; @@ -49,8 +41,6 @@ union FMRadioRequestArgs SetFrequencyRequestArgs; SeekRequestArgs; CancelSeekRequestArgs; - EnableRDSArgs; - DisableRDSArgs; }; struct StatusInfo @@ -76,30 +66,6 @@ child: * Sent when the power state of FM radio HW is changed. */ NotifyEnabledChanged(bool enabled, double frequency); - /** - * Sent when RDS is enabled or disabled. - */ - NotifyRDSEnabledChanged(bool enabled); - /** - * Sent when we have a new PI code. - */ - NotifyPIChanged(bool valid, uint16_t code); - /** - * Sent when we have a new PTY - */ - NotifyPTYChanged(bool valid, uint8_t pty); - /** - * Sent when we have a new PS name. - */ - NotifyPSChanged(nsString psname); - /** - * Sent when we have new radiotext. - */ - NotifyRadiotextChanged(nsString radiotext); - /** - * Sent when a full RDS group is received. - */ - NotifyNewRDSGroup(uint64_t data); __delete__(); @@ -125,11 +91,6 @@ parent: * Enable/Disable audio */ EnableAudio(bool audioEnabled); - - /** - * Set RDS group mask - */ - SetRDSGroupMask(uint32_t groupMask); }; } // namespace dom diff --git a/dom/webidl/FMRadio.webidl b/dom/webidl/FMRadio.webidl index 57db07691ae1..cb1c3e8051ff 100644 --- a/dom/webidl/FMRadio.webidl +++ b/dom/webidl/FMRadio.webidl @@ -6,9 +6,6 @@ interface FMRadio : EventTarget { /* Indicates if the FM radio is enabled. */ readonly attribute boolean enabled; - /* Indicates if RDS reception is enabled */ - readonly attribute boolean rdsEnabled; - /* Indicates if the antenna is plugged and available. */ readonly attribute boolean antennaAvailable; @@ -34,58 +31,12 @@ interface FMRadio : EventTarget { */ readonly attribute double channelWidth; - /** - * This is a mask consisting of bits corresponding to - * (1 << groupcode) that can be specified to receive - * raw RDS groups of specific group types. Note that - * groupcode corresponds to the upper 5 bits in block B. - */ - attribute unsigned long rdsGroupMask; - - /** - * The Program Identification (PI) code. - * Available if RDS is enabled on both the station and on this device. - * The value is null otherwise. - */ - readonly attribute unsigned short? pi; - - /** - * The Program Type (PTY) code. - * Available if RDS is enabled on both the station and on this device. - * The value is null otherwise. - */ - readonly attribute octet? pty; - - /** - * The Program Service (PS) name. - * Available if RDS is enabled on the station and on this device - */ - readonly attribute DOMString? ps; - - /** - * The radiotext, as provided by group 2A/2B. - * Available if RDS is enabled on the station and on this device - */ - readonly attribute DOMString? rt; - - /** - * The last RDS group received. - * Available if RDS is enabled on the station and on this device - */ - readonly attribute Uint16Array? rdsgroup; - /* Fired when the FM radio is enabled. */ attribute EventHandler onenabled; /* Fired when the FM radio is disabled. */ attribute EventHandler ondisabled; - /* Fired when the RDS is enabled. */ - attribute EventHandler onrdsenabled; - - /* Fired when the RDS is disabled. */ - attribute EventHandler onrdsdisabled; - /** * Fired when the antenna becomes available or unavailable, i.e., fired when * the antennaAvailable attribute changes. @@ -95,21 +46,6 @@ interface FMRadio : EventTarget { /* Fired when the FM radio's frequency is changed. */ attribute EventHandler onfrequencychange; - /* Fired when the PI code changes */ - attribute EventHandler onpichange; - - /* Fired when the PTY changes */ - attribute EventHandler onptychange; - - /* Fired when the PS name changes */ - attribute EventHandler onpschange; - - /* Fired when the radiotext changes */ - attribute EventHandler onrtchange; - - /* Fired when we get a new RDS group */ - attribute EventHandler onnewrdsgroup; - /** * Power the FM radio off. The disabled event will be fired if this request * completes successfully. @@ -158,19 +94,5 @@ interface FMRadio : EventTarget { * error will be fired. */ DOMRequest cancelSeek(); - - /** - * Enable RDS reception. - * - * If the radio is off, RDS will be enabled when the radio is turned on. - */ - DOMRequest enableRDS(); - - /** - * Disable RDS reception. - * - * If the radio is off, RDS will not be enabled when the radio is turned on. - */ - DOMRequest disableRDS(); }; From 610334f023e76bd131014f40e8f3a473ae1145d9 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 30 Sep 2014 13:43:22 -0400 Subject: [PATCH 93/93] Backed out changeset d1ad5d5bc00f (Bug 1041085) for red --- hal/Hal.cpp | 36 ------ hal/Hal.h | 26 ----- hal/HalTypes.h | 2 - hal/fallback/FallbackFMRadio.cpp | 8 -- hal/gonk/GonkFMRadio.cpp | 190 ------------------------------- hal/sandbox/PHal.ipdl | 7 -- hal/sandbox/SandboxHal.cpp | 12 -- 7 files changed, 281 deletions(-) diff --git a/hal/Hal.cpp b/hal/Hal.cpp index 790af80847d9..f09d5f622de7 100644 --- a/hal/Hal.cpp +++ b/hal/Hal.cpp @@ -1004,15 +1004,12 @@ ProcessPriorityToString(ProcessPriority aPriority, } static StaticAutoPtr > sFMRadioObservers; -static StaticAutoPtr > sFMRadioRDSObservers; static void InitializeFMRadioObserver() { if (!sFMRadioObservers) { sFMRadioObservers = new ObserverList; - sFMRadioRDSObservers = new ObserverList; - ClearOnShutdown(&sFMRadioRDSObservers); ClearOnShutdown(&sFMRadioObservers); } } @@ -1037,27 +1034,6 @@ NotifyFMRadioStatus(const FMRadioOperationInformation& aFMRadioState) { sFMRadioObservers->Broadcast(aFMRadioState); } -void -RegisterFMRadioRDSObserver(FMRadioRDSObserver* aFMRadioRDSObserver) { - AssertMainThread(); - InitializeFMRadioObserver(); - sFMRadioRDSObservers->AddObserver(aFMRadioRDSObserver); -} - -void -UnregisterFMRadioRDSObserver(FMRadioRDSObserver* aFMRadioRDSObserver) { - AssertMainThread(); - InitializeFMRadioObserver(); - sFMRadioRDSObservers->RemoveObserver(aFMRadioRDSObserver); -} - - -void -NotifyFMRadioRDSGroup(const FMRadioRDSGroup& aRDSGroup) { - InitializeFMRadioObserver(); - sFMRadioRDSObservers->Broadcast(aRDSGroup); -} - void EnableFMRadio(const FMRadioSettings& aInfo) { AssertMainThread(); @@ -1112,18 +1088,6 @@ CancelFMRadioSeek() { PROXY_IF_SANDBOXED(CancelFMRadioSeek()); } -void -EnableRDS(uint32_t aMask) { - AssertMainThread(); - PROXY_IF_SANDBOXED(EnableRDS(aMask)); -} - -void -DisableRDS() { - AssertMainThread(); - PROXY_IF_SANDBOXED(DisableRDS()); -} - FMRadioSettings GetFMBandSettings(FMRadioCountry aCountry) { FMRadioSettings settings; diff --git a/hal/Hal.h b/hal/Hal.h index 523bd32ee01f..b2aeec320198 100644 --- a/hal/Hal.h +++ b/hal/Hal.h @@ -503,28 +503,12 @@ void RegisterFMRadioObserver(hal::FMRadioObserver* aRadioObserver); */ void UnregisterFMRadioObserver(hal::FMRadioObserver* aRadioObserver); -/** - * Register an observer for the FM radio. - */ -void RegisterFMRadioRDSObserver(hal::FMRadioRDSObserver* aRDSObserver); - -/** - * Unregister the observer for the FM radio. - */ -void UnregisterFMRadioRDSObserver(hal::FMRadioRDSObserver* aRDSObserver); - /** * Notify observers that a call to EnableFMRadio, DisableFMRadio, or FMRadioSeek * has completed, and indicate what the call returned. */ void NotifyFMRadioStatus(const hal::FMRadioOperationInformation& aRadioState); -/** - * Notify observers of new RDS data - * This can be called on any thread. - */ -void NotifyFMRadioRDSGroup(const hal::FMRadioRDSGroup& aRDSGroup); - /** * Enable the FM radio and configure it according to the settings in aInfo. */ @@ -581,16 +565,6 @@ void CancelFMRadioSeek(); */ hal::FMRadioSettings GetFMBandSettings(hal::FMRadioCountry aCountry); -/** - * Enable RDS data reception - */ -void EnableRDS(uint32_t aMask); - -/** - * Disable RDS data reception - */ -void DisableRDS(); - /** * Start a watchdog to compulsively shutdown the system if it hangs. * @param aMode Specify how to shutdown the system. diff --git a/hal/HalTypes.h b/hal/HalTypes.h index a33d1a2cbac1..12cfcad516c4 100644 --- a/hal/HalTypes.h +++ b/hal/HalTypes.h @@ -225,9 +225,7 @@ enum FMRadioCountry { NUM_FM_RADIO_COUNTRY }; -class FMRadioRDSGroup; typedef Observer FMRadioObserver; -typedef Observer FMRadioRDSObserver; } // namespace hal } // namespace mozilla diff --git a/hal/fallback/FallbackFMRadio.cpp b/hal/fallback/FallbackFMRadio.cpp index ac9de9684b42..664928b9a777 100644 --- a/hal/fallback/FallbackFMRadio.cpp +++ b/hal/fallback/FallbackFMRadio.cpp @@ -57,13 +57,5 @@ void CancelFMRadioSeek() {} -void -EnableRDS(uint32_t aMask) -{} - -void -DisableRDS() -{} - } // hal_impl } // namespace mozilla diff --git a/hal/gonk/GonkFMRadio.cpp b/hal/gonk/GonkFMRadio.cpp index 7fd663ff2313..5f0406836769 100644 --- a/hal/gonk/GonkFMRadio.cpp +++ b/hal/gonk/GonkFMRadio.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -50,13 +49,10 @@ uint32_t GetFMRadioFrequency(); static int sRadioFD; static bool sRadioEnabled; -static bool sRDSEnabled; static pthread_t sRadioThread; -static pthread_t sRDSThread; static hal::FMRadioSettings sRadioSettings; static int sMsmFMVersion; static bool sMsmFMMode; -static bool sRDSSupported; static int setControl(uint32_t id, int32_t value) @@ -315,8 +311,6 @@ EnableFMRadio(const hal::FMRadioSettings& aInfo) hal::NotifyFMRadioStatus(info); return; } - - sRDSSupported = cap.capabilities & V4L2_CAP_RDS_CAPTURE; sRadioSettings = aInfo; if (sMsmFMMode) { @@ -372,9 +366,6 @@ DisableFMRadio() if (!sRadioEnabled) return; - if (sRDSEnabled) - DisableRDS(); - sRadioEnabled = false; if (sMsmFMMode) { @@ -503,186 +494,5 @@ void CancelFMRadioSeek() {} -/* Runs on the rds thread */ -static void* -readRDSDataThread(void* data) -{ - v4l2_rds_data rdsblocks[16]; - uint16_t blocks[4]; - - ScopedClose pipefd((int)data); - - ScopedClose epollfd(epoll_create(2)); - if (epollfd < 0) { - HAL_LOG(("Could not create epoll FD for RDS thread (%d)", errno)); - return nullptr; - } - - epoll_event event = { - EPOLLIN, - { 0 } - }; - - event.data.fd = pipefd; - if (epoll_ctl(epollfd, EPOLL_CTL_ADD, pipefd, &event) < 0) { - HAL_LOG(("Could not set up epoll FD for RDS thread (%d)", errno)); - return nullptr; - } - - event.data.fd = sRadioFD; - if (epoll_ctl(epollfd, EPOLL_CTL_ADD, sRadioFD, &event) < 0) { - HAL_LOG(("Could not set up epoll FD for RDS thread (%d)", errno)); - return nullptr; - } - - epoll_event events[2] = {{ 0 }}; - int event_count; - uint32_t block_bitmap = 0; - while ((event_count = epoll_wait(epollfd, events, 2, -1)) > 0 || - errno == EINTR) { - bool RDSDataAvailable = false; - for (int i = 0; i < event_count; i++) { - if (events[i].data.fd == pipefd) { - if (!sRDSEnabled) - return nullptr; - char tmp[32]; - TEMP_FAILURE_RETRY(read(pipefd, tmp, sizeof(tmp))); - } else if (events[i].data.fd == sRadioFD) { - RDSDataAvailable = true; - } - } - - if (!RDSDataAvailable) - continue; - - ssize_t len = - TEMP_FAILURE_RETRY(read(sRadioFD, rdsblocks, sizeof(rdsblocks))); - if (len < 0) { - HAL_LOG(("Unexpected error while reading RDS data %d", errno)); - return nullptr; - } - - int blockcount = len / sizeof(rdsblocks[0]); - int lastblock = -1; - for (int i = 0; i < blockcount; i++) { - if ((rdsblocks[i].block & V4L2_RDS_BLOCK_MSK) == V4L2_RDS_BLOCK_INVALID || - rdsblocks[i].block & V4L2_RDS_BLOCK_ERROR) { - block_bitmap |= 1 << V4L2_RDS_BLOCK_INVALID; - continue; - } - - int blocknum = rdsblocks[i].block & V4L2_RDS_BLOCK_MSK; - // In some cases, the full set of bits in an RDS group isn't - // needed, in which case version B RDS groups can be sent. - // Version B groups replace block C with block C' (V4L2_RDS_BLOCK_C_ALT). - // Block C' always stores the PI code, so receivers can find the PI - // code more quickly/reliably. - // However, we only process whole RDS groups, so it doesn't matter here. - if (blocknum == V4L2_RDS_BLOCK_C_ALT) - blocknum = V4L2_RDS_BLOCK_C; - if (blocknum > V4L2_RDS_BLOCK_D) { - HAL_LOG(("Unexpected RDS block number %d. This is a driver bug.", - blocknum)); - continue; - } - - if (blocknum == V4L2_RDS_BLOCK_A) - block_bitmap = 0; - - // Skip the group if we skipped a block. - // This stops us from processing blocks sent out of order. - if (block_bitmap != ((1 << blocknum) - 1)) { - block_bitmap |= 1 << V4L2_RDS_BLOCK_INVALID; - continue; - } - - block_bitmap |= 1 << blocknum; - - lastblock = blocknum; - blocks[blocknum] = (rdsblocks[i].msb << 8) | rdsblocks[i].lsb; - - // Make sure we have all 4 blocks and that they're valid - if (block_bitmap != 0x0F) - continue; - - FMRadioRDSGroup group; - group.blockA() = blocks[V4L2_RDS_BLOCK_A]; - group.blockB() = blocks[V4L2_RDS_BLOCK_B]; - group.blockC() = blocks[V4L2_RDS_BLOCK_C]; - group.blockD() = blocks[V4L2_RDS_BLOCK_D]; - NotifyFMRadioRDSGroup(group); - } - } - - return nullptr; -} - -static int sRDSPipeFD; - -void -EnableRDS(uint32_t aMask) -{ - if (!sRadioEnabled || !sRDSSupported) - return; - - if (sMsmFMMode) - setControl(V4L2_CID_PRIVATE_TAVARUA_RDSGROUP_MASK, aMask); - - if (sRDSEnabled) - return; - - int pipefd[2]; - int rc = pipe2(pipefd, O_NONBLOCK); - if (rc < 0) { - HAL_LOG(("Could not create RDS thread signaling pipes (%d)", rc)); - return; - } - - ScopedClose writefd(pipefd[1]); - ScopedClose readfd(pipefd[0]); - - rc = setControl(V4L2_CID_RDS_RECEPTION, true); - if (rc < 0) { - HAL_LOG(("Could not enable RDS reception (%d)", rc)); - return; - } - - sRDSPipeFD = writefd; - - sRDSEnabled = true; - - rc = pthread_create(&sRDSThread, nullptr, - readRDSDataThread, (void*)pipefd[0]); - if (rc) { - HAL_LOG(("Could not start RDS reception thread (%d)", rc)); - setControl(V4L2_CID_RDS_RECEPTION, false); - sRDSEnabled = false; - return; - } - - readfd.forget(); - writefd.forget(); -} - -void -DisableRDS() -{ - if (!sRadioEnabled || !sRDSEnabled) - return; - - int rc = setControl(V4L2_CID_RDS_RECEPTION, false); - if (rc < 0) { - HAL_LOG(("Could not disable RDS reception (%d)", rc)); - } - - sRDSEnabled = false; - - write(sRDSPipeFD, "x", 1); - - pthread_join(sRDSThread, nullptr); - - close(sRDSPipeFD); -} - } // hal_impl } // namespace mozilla diff --git a/hal/sandbox/PHal.ipdl b/hal/sandbox/PHal.ipdl index f45d232ed249..a52d7e6ef779 100644 --- a/hal/sandbox/PHal.ipdl +++ b/hal/sandbox/PHal.ipdl @@ -69,13 +69,6 @@ struct FMRadioOperationInformation { uint32_t frequency; }; -struct FMRadioRDSGroup { - uint16_t blockA; - uint16_t blockB; - uint16_t blockC; - uint16_t blockD; -}; - struct FMRadioSettings { FMRadioCountry country; uint32_t upperLimit; diff --git a/hal/sandbox/SandboxHal.cpp b/hal/sandbox/SandboxHal.cpp index 1f662dacfb20..f2faba6e4e36 100644 --- a/hal/sandbox/SandboxHal.cpp +++ b/hal/sandbox/SandboxHal.cpp @@ -426,18 +426,6 @@ CancelFMRadioSeek() NS_RUNTIMEABORT("FM radio cannot be called from sandboxed contexts."); } -void -EnableRDS(uint32_t aMask) -{ - NS_RUNTIMEABORT("FM radio cannot be called from sandboxed contexts."); -} - -void -DisableRDS() -{ - NS_RUNTIMEABORT("FM radio cannot be called from sandboxed contexts."); -} - void FactoryReset(FactoryResetReason& aReason) {