merge mozilla-inbound to mozilla-central. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 20 May 2017 18:48:53 +0200
changeset 359766 5b74bbf20e803e299790d266fc6ebf5d53b7a1b7
parent 359721 51736db6772339152f72297c30817ab0f2c78dca (current diff)
parent 359765 8b115265af36830f21d88050cff5abf2a6dca190 (diff)
child 359767 d4c254e98c7f514afc5e75811eb07f846aa6ac9c
child 359812 b31a663614e8df7876563e03c4735aa5c8a38f5a
child 359827 093eab57d50408eab14dcfa17f8e916e34ecd4b6
push id43060
push userarchaeopteryx@coole-files.de
push dateSat, 20 May 2017 16:53:52 +0000
treeherderautoland@d4c254e98c7f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone55.0a1
first release with
nightly linux32
5b74bbf20e80 / 55.0a1 / 20170521100319 / files
nightly linux64
5b74bbf20e80 / 55.0a1 / 20170521100319 / files
nightly mac
5b74bbf20e80 / 55.0a1 / 20170521030205 / files
nightly win32
5b74bbf20e80 / 55.0a1 / 20170521030205 / files
nightly win64
5b74bbf20e80 / 55.0a1 / 20170521030205 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge mozilla-inbound to mozilla-central. r=merge a=merge MozReview-Commit-ID: EqC7wKnn6Jt
gfx/layers/d3d11/CompositorD3D11Shaders.h
gfx/layers/d3d11/genshaders.sh
toolkit/mozapps/extensions/internal/AddonConstants.jsm
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -4,17 +4,17 @@
 
 const TESTROOT = "http://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
 const TESTROOT2 = "http://example.org/browser/toolkit/mozapps/extensions/test/xpinstall/";
 const SECUREROOT = "https://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
 const XPINSTALL_URL = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
 const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
 const PROGRESS_NOTIFICATION = "addon-progress";
 
-const { REQUIRE_SIGNING } = Cu.import("resource://gre/modules/addons/AddonConstants.jsm", {});
+Cu.import("resource://gre/modules/AppConstants.jsm");
 
 var rootDir = getRootDirectory(gTestPath);
 var rootPath = rootDir.split("/");
 var chromeName = rootPath[0] + "//" + rootPath[2];
 var croot = chromeName + "/content/browser/toolkit/mozapps/extensions/test/xpinstall/";
 var jar = getJar(croot);
 if (jar) {
   var tmpdir = extractJarToTmp(jar);
@@ -33,157 +33,151 @@ function getObserverTopic(aNotificationI
     topic = "addon-install-started";
   else if (topic == "addon-install-restart")
     topic = "addon-install-complete";
   else if (topic == "addon-installed")
     topic = "webextension-install-notify";
   return topic;
 }
 
-function waitForProgressNotification(aPanelOpen = false, aExpectedCount = 1) {
-  return (async function() {
-    let notificationId = PROGRESS_NOTIFICATION;
-    info("Waiting for " + notificationId + " notification");
+async function waitForProgressNotification(aPanelOpen = false, aExpectedCount = 1) {
+  let notificationId = PROGRESS_NOTIFICATION;
+  info("Waiting for " + notificationId + " notification");
 
-    let topic = getObserverTopic(notificationId);
+  let topic = getObserverTopic(notificationId);
 
-    let observerPromise = new Promise(resolve => {
-      Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
-        // Ignore the progress notification unless that is the notification we want
-        if (notificationId != PROGRESS_NOTIFICATION &&
-            aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
-          return;
-        }
-        Services.obs.removeObserver(observer, topic);
-        resolve();
-      }, topic);
-    });
+  let observerPromise = new Promise(resolve => {
+    Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
+      // Ignore the progress notification unless that is the notification we want
+      if (notificationId != PROGRESS_NOTIFICATION &&
+          aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
+            return;
+      }
+      Services.obs.removeObserver(observer, topic);
+      resolve();
+    }, topic);
+  });
 
-    let panelEventPromise;
-    if (aPanelOpen) {
-      panelEventPromise = Promise.resolve();
-    } else {
-      panelEventPromise = new Promise(resolve => {
-        PopupNotifications.panel.addEventListener("popupshowing", function() {
-          resolve();
-        }, {once: true});
-      });
-    }
-
-    await observerPromise;
-    await panelEventPromise;
+  let panelEventPromise;
+  if (aPanelOpen) {
+    panelEventPromise = Promise.resolve();
+  } else {
+    panelEventPromise = new Promise(resolve => {
+      PopupNotifications.panel.addEventListener("popupshowing", function() {
+        resolve();
+      }, {once: true});
+    });
+  }
 
-    info("Saw a notification");
-    ok(PopupNotifications.isPanelOpen, "Panel should be open");
-    is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
-    if (PopupNotifications.panel.childNodes.length) {
-      let nodes = Array.from(PopupNotifications.panel.childNodes);
-      let notification = nodes.find(n => n.id == notificationId + "-notification");
-      ok(notification, `Should have seen the right notification`);
-      ok(notification.button.hasAttribute("disabled"),
-         "The install button should be disabled");
-    }
+  await observerPromise;
+  await panelEventPromise;
 
-    return PopupNotifications.panel;
-  })();
+  info("Saw a notification");
+  ok(PopupNotifications.isPanelOpen, "Panel should be open");
+  is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
+  if (PopupNotifications.panel.childNodes.length) {
+    let nodes = Array.from(PopupNotifications.panel.childNodes);
+    let notification = nodes.find(n => n.id == notificationId + "-notification");
+    ok(notification, `Should have seen the right notification`);
+    ok(notification.button.hasAttribute("disabled"),
+       "The install button should be disabled");
+  }
+
+  return PopupNotifications.panel;
 }
 
-function waitForNotification(aId, aExpectedCount = 1) {
-  return (async function() {
-    info("Waiting for " + aId + " notification");
+async function waitForNotification(aId, aExpectedCount = 1) {
+  info("Waiting for " + aId + " notification");
 
-    let topic = getObserverTopic(aId);
+  let topic = getObserverTopic(aId);
 
-    let observerPromise = new Promise(resolve => {
-      Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
-        // Ignore the progress notification unless that is the notification we want
-        if (aId != PROGRESS_NOTIFICATION &&
-            aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
-          return;
-        }
-        Services.obs.removeObserver(observer, topic);
-        resolve();
-      }, topic);
-    });
+  let observerPromise = new Promise(resolve => {
+    Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
+      // Ignore the progress notification unless that is the notification we want
+      if (aId != PROGRESS_NOTIFICATION &&
+          aTopic == getObserverTopic(PROGRESS_NOTIFICATION)) {
+            return;
+      }
+      Services.obs.removeObserver(observer, topic);
+      resolve();
+    }, topic);
+  });
 
-    let panelEventPromise = new Promise(resolve => {
-      PopupNotifications.panel.addEventListener("PanelUpdated", function eventListener(e) {
-        // Skip notifications that are not the one that we are supposed to be looking for
-        if (e.detail.indexOf(aId) == -1) {
-          return;
-        }
-        PopupNotifications.panel.removeEventListener("PanelUpdated", eventListener);
-        resolve();
-      });
+  let panelEventPromise = new Promise(resolve => {
+    PopupNotifications.panel.addEventListener("PanelUpdated", function eventListener(e) {
+      // Skip notifications that are not the one that we are supposed to be looking for
+      if (e.detail.indexOf(aId) == -1) {
+        return;
+      }
+      PopupNotifications.panel.removeEventListener("PanelUpdated", eventListener);
+      resolve();
     });
+  });
 
-    await observerPromise;
-    await panelEventPromise;
+  await observerPromise;
+  await panelEventPromise;
 
-    info("Saw a " + aId + " notification");
-    ok(PopupNotifications.isPanelOpen, "Panel should be open");
-    is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
-    if (PopupNotifications.panel.childNodes.length) {
-      let nodes = Array.from(PopupNotifications.panel.childNodes);
-      let notification = nodes.find(n => n.id == aId + "-notification");
-      ok(notification, "Should have seen the " + aId + " notification");
-    }
+  info("Saw a " + aId + " notification");
+  ok(PopupNotifications.isPanelOpen, "Panel should be open");
+  is(PopupNotifications.panel.childNodes.length, aExpectedCount, "Should be the right number of notifications");
+  if (PopupNotifications.panel.childNodes.length) {
+    let nodes = Array.from(PopupNotifications.panel.childNodes);
+    let notification = nodes.find(n => n.id == aId + "-notification");
+    ok(notification, "Should have seen the " + aId + " notification");
+  }
 
-    return PopupNotifications.panel;
-  })();
+  return PopupNotifications.panel;
 }
 
 function waitForNotificationClose() {
   return new Promise(resolve => {
     info("Waiting for notification to close");
     PopupNotifications.panel.addEventListener("popuphidden", function() {
       resolve();
     }, {once: true});
   });
 }
 
-function waitForInstallDialog() {
-  return (async function() {
-    if (Preferences.get("xpinstall.customConfirmationUI", false)) {
-      let panel = await waitForNotification("addon-install-confirmation");
-      return panel.childNodes[0];
-    }
+async function waitForInstallDialog() {
+  if (Preferences.get("xpinstall.customConfirmationUI", false)) {
+    let panel = await waitForNotification("addon-install-confirmation");
+    return panel.childNodes[0];
+  }
 
-    info("Waiting for install dialog");
+  info("Waiting for install dialog");
 
-    let window = await new Promise(resolve => {
-      Services.wm.addListener({
-        onOpenWindow(aXULWindow) {
-          Services.wm.removeListener(this);
-          resolve(aXULWindow);
-        },
-        onCloseWindow(aXULWindow) {
-        },
-        onWindowTitleChange(aXULWindow, aNewTitle) {
-        }
-      });
+  let window = await new Promise(resolve => {
+    Services.wm.addListener({
+      onOpenWindow(aXULWindow) {
+        Services.wm.removeListener(this);
+        resolve(aXULWindow);
+      },
+      onCloseWindow(aXULWindow) {
+      },
+      onWindowTitleChange(aXULWindow, aNewTitle) {
+      }
     });
-    info("Install dialog opened, waiting for focus");
+  });
+  info("Install dialog opened, waiting for focus");
 
-    let domwindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
-                          .getInterface(Ci.nsIDOMWindow);
-    await new Promise(resolve => {
-      waitForFocus(function() {
-        resolve();
-      }, domwindow);
-    });
-    info("Saw install dialog");
-    is(domwindow.document.location.href, XPINSTALL_URL, "Should have seen the right window open");
+  let domwindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
+                        .getInterface(Ci.nsIDOMWindow);
+  await new Promise(resolve => {
+    waitForFocus(function() {
+      resolve();
+    }, domwindow);
+  });
+  info("Saw install dialog");
+  is(domwindow.document.location.href, XPINSTALL_URL, "Should have seen the right window open");
 
-    // Override the countdown timer on the accept button
-    let button = domwindow.document.documentElement.getButton("accept");
-    button.disabled = false;
+  // Override the countdown timer on the accept button
+  let button = domwindow.document.documentElement.getButton("accept");
+  button.disabled = false;
 
-    return null;
-  })();
+  return null;
 }
 
 function removeTab() {
   return Promise.all([
     waitForNotificationClose(),
     BrowserTestUtils.removeTab(gBrowser.selectedTab)
   ]);
 }
@@ -201,26 +195,24 @@ function cancelInstallDialog(installDial
   if (Preferences.get("xpinstall.customConfirmationUI", false)) {
     installDialog.secondaryButton.click();
   } else {
     let win = Services.wm.getMostRecentWindow("Addons:Install");
     win.document.documentElement.cancelDialog();
   }
 }
 
-function waitForSingleNotification(aCallback) {
-  return (async function() {
-    while (PopupNotifications.panel.childNodes.length == 2) {
-      await new Promise(resolve => executeSoon(resolve));
+async function waitForSingleNotification(aCallback) {
+  while (PopupNotifications.panel.childNodes.length == 2) {
+    await new Promise(resolve => executeSoon(resolve));
 
-      info("Waiting for single notification");
-      // Notification should never close while we wait
-      ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    }
-  })();
+    info("Waiting for single notification");
+    // Notification should never close while we wait
+    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  }
 }
 
 function setupRedirect(aSettings) {
   var url = "https://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/redirect.sjs?mode=setup";
   for (var name in aSettings) {
     url += "&" + name + "=" + aSettings[name];
   }
 
@@ -231,809 +223,767 @@ function setupRedirect(aSettings) {
 
 function getInstalls() {
   return new Promise(resolve => {
     AddonManager.getAllInstalls(installs => resolve(installs));
   });
 }
 
 var TESTS = [
-function test_disabledInstall() {
-  return (async function() {
-    Services.prefs.setBoolPref("xpinstall.enabled", false);
+async function test_disabledInstall() {
+  Services.prefs.setBoolPref("xpinstall.enabled", false);
 
-    let notificationPromise = waitForNotification("xpinstall-disabled");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("xpinstall-disabled");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Enable", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "Software installation is currently disabled. Click Enable and try again.");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Enable", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "Software installation is currently disabled. Click Enable and try again.");
 
-    let closePromise = waitForNotificationClose();
-    // Click on Enable
-    EventUtils.synthesizeMouseAtCenter(notification.button, {});
-    await closePromise;
+  let closePromise = waitForNotificationClose();
+  // Click on Enable
+  EventUtils.synthesizeMouseAtCenter(notification.button, {});
+  await closePromise;
 
-    try {
-      ok(Services.prefs.getBoolPref("xpinstall.enabled"), "Installation should be enabled");
-    } catch (e) {
-      ok(false, "xpinstall.enabled should be set");
-    }
+  try {
+    ok(Services.prefs.getBoolPref("xpinstall.enabled"), "Installation should be enabled");
+  } catch (e) {
+    ok(false, "xpinstall.enabled should be set");
+  }
 
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-    let installs = await getInstalls();
-    is(installs.length, 0, "Shouldn't be any pending installs");
-  })();
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  let installs = await getInstalls();
+  is(installs.length, 0, "Shouldn't be any pending installs");
 },
 
-function test_blockedInstall() {
-  return (async function() {
-    let notificationPromise = waitForNotification("addon-install-blocked");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
+async function test_blockedInstall() {
+  let notificationPromise = waitForNotification("addon-install-blocked");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Allow", "Should have seen the right button");
-    is(notification.getAttribute("origin"), "example.com",
-       "Should have seen the right origin host");
-    is(notification.getAttribute("label"),
-       gApp + " prevented this site from asking you to install software on your computer.",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Allow", "Should have seen the right button");
+  is(notification.getAttribute("origin"), "example.com",
+     "Should have seen the right origin host");
+  is(notification.getAttribute("label"),
+     gApp + " prevented this site from asking you to install software on your computer.",
+     "Should have seen the right message");
 
-    let dialogPromise = waitForInstallDialog();
-    // Click on Allow
-    EventUtils.synthesizeMouse(notification.button, 20, 10, {});
-    // Notification should have changed to progress notification
-    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
-    let installDialog = await dialogPromise;
+  let dialogPromise = waitForInstallDialog();
+  // Click on Allow
+  EventUtils.synthesizeMouse(notification.button, 20, 10, {});
+  // Notification should have changed to progress notification
+  ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
+  let installDialog = await dialogPromise;
 
-    notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    panel = await notificationPromise;
+  notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  panel = await notificationPromise;
 
-    notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "XPI Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
-    await removeTab();
-  })();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
+  await removeTab();
 },
 
-function test_whitelistedInstall() {
-  return (async function() {
-    let originalTab = gBrowser.selectedTab;
-    let tab;
-    gBrowser.selectedTab = originalTab;
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_whitelistedInstall() {
+  let originalTab = gBrowser.selectedTab;
+  let tab;
+  gBrowser.selectedTab = originalTab;
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?"
-      + triggers).then(newTab => tab = newTab);
-    await progressPromise;
-    let installDialog = await dialogPromise;
-    await BrowserTestUtils.waitForCondition(() => !!tab, "tab should be present");
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?"
+                                                + triggers).then(newTab => tab = newTab);
+  await progressPromise;
+  let installDialog = await dialogPromise;
+  await BrowserTestUtils.waitForCondition(() => !!tab, "tab should be present");
 
-    is(gBrowser.selectedTab, tab,
-       "tab selected in response to the addon-install-confirmation notification");
+  is(gBrowser.selectedTab, tab,
+     "tab selected in response to the addon-install-confirmation notification");
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-             "XPI Test will be installed after you restart " + gApp + ".",
-             "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_failedDownload() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_failedDownload() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let failPromise = waitForNotification("addon-install-failed");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "missing.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let panel = await failPromise;
+  let progressPromise = waitForProgressNotification();
+  let failPromise = waitForNotification("addon-install-failed");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "missing.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let panel = await failPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "The add-on could not be downloaded because of a connection failure.",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "The add-on could not be downloaded because of a connection failure.",
+     "Should have seen the right message");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_corruptFile() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_corruptFile() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let failPromise = waitForNotification("addon-install-failed");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "corrupt.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let panel = await failPromise;
+  let progressPromise = waitForProgressNotification();
+  let failPromise = waitForNotification("addon-install-failed");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "corrupt.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let panel = await failPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "The add-on downloaded from this site could not be installed " +
-       "because it appears to be corrupt.",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "The add-on downloaded from this site could not be installed " +
+     "because it appears to be corrupt.",
+     "Should have seen the right message");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_incompatible() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_incompatible() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let failPromise = waitForNotification("addon-install-failed");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "incompatible.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let panel = await failPromise;
+  let progressPromise = waitForProgressNotification();
+  let failPromise = waitForNotification("addon-install-failed");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "incompatible.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let panel = await failPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "XPI Test could not be installed because it is not compatible with " +
-       gApp + " " + gVersion + ".",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "XPI Test could not be installed because it is not compatible with " +
+     gApp + " " + gVersion + ".",
+     "Should have seen the right message");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_restartless() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_restartless() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "restartless.xpi"
-    }));
-    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "restartless.xpi"
+  }));
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notificationPromise = waitForNotification("addon-installed");
-    acceptInstallDialog(installDialog);
-    await notificationPromise;
+  let notificationPromise = waitForNotification("addon-installed");
+  acceptInstallDialog(installDialog);
+  await notificationPromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending installs");
+  let installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending installs");
 
-    let addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", result => {
-        resolve(result);
-      });
+  let addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", result => {
+      resolve(result);
     });
-    addon.uninstall();
+  });
+  addon.uninstall();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
+  Services.perms.remove(makeURI("http://example.com/"), "install");
 
-    let closePromise = waitForNotificationClose();
-    gBrowser.removeTab(gBrowser.selectedTab);
-    await closePromise;
-  })();
+  let closePromise = waitForNotificationClose();
+  gBrowser.removeTab(gBrowser.selectedTab);
+  await closePromise;
 },
 
-function test_sequential() {
-  return (async function() {
-    // This test is only relevant if using the new doorhanger UI
-    // TODO: this subtest is disabled until multiple notification prompts are
-    // reworked in bug 1188152
-    if (true || !Preferences.get("xpinstall.customConfirmationUI", false)) {
-      return;
-    }
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_sequential() {
+  // This test is only relevant if using the new doorhanger UI
+  // TODO: this subtest is disabled until multiple notification prompts are
+  // reworked in bug 1188152
+  if (true || !Preferences.get("xpinstall.customConfirmationUI", false)) {
+    return;
+  }
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Restartless XPI": "restartless.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Restartless XPI": "restartless.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    // Should see the right add-on
-    let container = document.getElementById("addon-install-confirmation-content");
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  // Should see the right add-on
+  let container = document.getElementById("addon-install-confirmation-content");
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
 
-    progressPromise = waitForProgressNotification(true, 2);
-    triggers = encodeURIComponent(JSON.stringify({
-      "Theme XPI": "theme.xpi"
-    }));
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
+  progressPromise = waitForProgressNotification(true, 2);
+  triggers = encodeURIComponent(JSON.stringify({
+    "Theme XPI": "theme.xpi"
+  }));
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
 
-    // Should still have the right add-on in the confirmation notification
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  // Should still have the right add-on in the confirmation notification
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
 
-    // Wait for the install to complete, we won't see a new confirmation
-    // notification
-    await new Promise(resolve => {
-      Services.obs.addObserver(function observer() {
-        Services.obs.removeObserver(observer, "addon-install-confirmation");
-        resolve();
-      }, "addon-install-confirmation");
-    });
+  // Wait for the install to complete, we won't see a new confirmation
+  // notification
+  await new Promise(resolve => {
+    Services.obs.addObserver(function observer() {
+      Services.obs.removeObserver(observer, "addon-install-confirmation");
+      resolve();
+    }, "addon-install-confirmation");
+  });
 
-    // Make sure browser-addons.js executes first
-    await new Promise(resolve => executeSoon(resolve));
+  // Make sure browser-addons.js executes first
+  await new Promise(resolve => executeSoon(resolve));
 
-    // Should have dropped the progress notification
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
-    is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
-       "Should only be showing one install confirmation");
+  // Should have dropped the progress notification
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
+  is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
+     "Should only be showing one install confirmation");
 
-    // Should still have the right add-on in the confirmation notification
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  // Should still have the right add-on in the confirmation notification
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
 
-    cancelInstallDialog(installDialog);
-
-    ok(PopupNotifications.isPanelOpen, "Panel should still be open");
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
-    is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
-       "Should still have an install confirmation open");
+  cancelInstallDialog(installDialog);
 
-    // Should have the next add-on's confirmation dialog
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
+  ok(PopupNotifications.isPanelOpen, "Panel should still be open");
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
+  is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
+     "Should still have an install confirmation open");
 
-    Services.perms.remove(makeURI("http://example.com"), "install");
-    let closePromise = waitForNotificationClose();
-    cancelInstallDialog(installDialog);
-    await closePromise;
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-  })();
+  // Should have the next add-on's confirmation dialog
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
+
+  Services.perms.remove(makeURI("http://example.com"), "install");
+  let closePromise = waitForNotificationClose();
+  cancelInstallDialog(installDialog);
+  await closePromise;
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 },
 
-function test_allUnverified() {
-  return (async function() {
-    // This test is only relevant if using the new doorhanger UI and allowing
-    // unsigned add-ons
-    if (!Preferences.get("xpinstall.customConfirmationUI", false) ||
-        Preferences.get("xpinstall.signatures.required", true) ||
-        REQUIRE_SIGNING) {
-      return;
-    }
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_allUnverified() {
+  // This test is only relevant if using the new doorhanger UI and allowing
+  // unsigned add-ons
+  if (!Preferences.get("xpinstall.customConfirmationUI", false) ||
+      Preferences.get("xpinstall.signatures.required", true) ||
+      AppConstants.MOZ_REQUIRE_SIGNING) {
+        return;
+  }
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Extension XPI": "restartless-unsigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Extension XPI": "restartless-unsigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notification = document.getElementById("addon-install-confirmation-notification");
-    let message = notification.getAttribute("label");
-    is(message, "Caution: This site would like to install an unverified add-on in " + gApp + ". Proceed at your own risk.");
+  let notification = document.getElementById("addon-install-confirmation-notification");
+  let message = notification.getAttribute("label");
+  is(message, "Caution: This site would like to install an unverified add-on in " + gApp + ". Proceed at your own risk.");
 
-    let container = document.getElementById("addon-install-confirmation-content");
-    is(container.childNodes.length, 1, "Should be one item listed");
-    is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
-    is(container.childNodes[0].childNodes.length, 1, "Shouldn't have the unverified marker");
+  let container = document.getElementById("addon-install-confirmation-content");
+  is(container.childNodes.length, 1, "Should be one item listed");
+  is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
+  is(container.childNodes[0].childNodes.length, 1, "Shouldn't have the unverified marker");
 
-    let notificationPromise = waitForNotification("addon-installed");
-    acceptInstallDialog(installDialog);
-    await notificationPromise;
+  let notificationPromise = waitForNotification("addon-installed");
+  acceptInstallDialog(installDialog);
+  await notificationPromise;
 
-    let addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
-        resolve(result);
-      });
+  let addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
+      resolve(result);
     });
-    addon.uninstall();
+  });
+  addon.uninstall();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_url() {
-  return (async function() {
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI(TESTROOT + "amosigned.xpi");
-    await progressPromise;
-    let installDialog = await dialogPromise;
+async function test_url() {
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI(TESTROOT + "amosigned.xpi");
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "XPI Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
 
-    await removeTab();
-  })();
+  await removeTab();
 },
 
-function test_localFile() {
-  return (async function() {
-    let cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
-                       .getService(Components.interfaces.nsIChromeRegistry);
-    let path;
-    try {
-      path = cr.convertChromeURL(makeURI(CHROMEROOT + "corrupt.xpi")).spec;
-    } catch (ex) {
-      path = CHROMEROOT + "corrupt.xpi";
-    }
+async function test_localFile() {
+  let cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
+                     .getService(Components.interfaces.nsIChromeRegistry);
+  let path;
+  try {
+    path = cr.convertChromeURL(makeURI(CHROMEROOT + "corrupt.xpi")).spec;
+  } catch (ex) {
+    path = CHROMEROOT + "corrupt.xpi";
+  }
 
-    let failPromise = new Promise(resolve => {
-      Services.obs.addObserver(function observer() {
-        Services.obs.removeObserver(observer, "addon-install-failed");
-        resolve();
-      }, "addon-install-failed");
-    });
-    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI(path);
-    await failPromise;
+  let failPromise = new Promise(resolve => {
+    Services.obs.addObserver(function observer() {
+      Services.obs.removeObserver(observer, "addon-install-failed");
+      resolve();
+    }, "addon-install-failed");
+  });
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI(path);
+  await failPromise;
 
-    // Wait for the browser code to add the failure notification
-    await waitForSingleNotification();
+  // Wait for the browser code to add the failure notification
+  await waitForSingleNotification();
 
-    let notification = PopupNotifications.panel.childNodes[0];
-    is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
-    is(notification.getAttribute("label"),
-       "This add-on could not be installed because it appears to be corrupt.",
-       "Should have seen the right message");
+  let notification = PopupNotifications.panel.childNodes[0];
+  is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
+  is(notification.getAttribute("label"),
+     "This add-on could not be installed because it appears to be corrupt.",
+     "Should have seen the right message");
 
-    await removeTab();
-  })();
+  await removeTab();
 },
 
-function test_tabClose() {
-  return (async function() {
-    if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
-      info("Test skipped due to xpinstall.customConfirmationUI being false.");
-      return;
-    }
+async function test_tabClose() {
+  if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
+    info("Test skipped due to xpinstall.customConfirmationUI being false.");
+    return;
+  }
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI(TESTROOT + "amosigned.xpi");
-    await progressPromise;
-    await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI(TESTROOT + "amosigned.xpi");
+  await progressPromise;
+  await dialogPromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
 
-    let closePromise = waitForNotificationClose();
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-    await closePromise;
+  let closePromise = waitForNotificationClose();
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  await closePromise;
 
-    installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending install since the tab is closed");
-  })();
+  installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending install since the tab is closed");
 },
 
 // Add-ons should be cancelled and the install notification destroyed when
 // navigating to a new origin
-function test_tabNavigate() {
-  return (async function() {
-    if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
-      return;
-    }
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_tabNavigate() {
+  if (!Preferences.get("xpinstall.customConfirmationUI", false)) {
+    return;
+  }
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Extension XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Extension XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  await dialogPromise;
 
-    let closePromise = waitForNotificationClose();
-    let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gBrowser.loadURI("about:blank");
-    await closePromise;
+  let closePromise = waitForNotificationClose();
+  let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gBrowser.loadURI("about:blank");
+  await closePromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending install");
+  let installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending install");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await loadPromise;
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await loadPromise;
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 },
 
-function test_urlBar() {
-  return (async function() {
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
+async function test_urlBar() {
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
+  await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
+  gURLBar.value = TESTROOT + "amosigned.xpi";
+  gURLBar.focus();
+  EventUtils.synthesizeKey("VK_RETURN", {});
 
-    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
-    await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
-    gURLBar.value = TESTROOT + "amosigned.xpi";
-    gURLBar.focus();
-    EventUtils.synthesizeKey("VK_RETURN", {});
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
+
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
+
+  await removeTab();
+},
+
+async function test_wrongHost() {
+  let requestedUrl = TESTROOT2 + "enabled.html";
+  gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-             "XPI Test will be installed after you restart " + gApp + ".",
-             "Should have seen the right message");
+  let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
+  gBrowser.loadURI(TESTROOT2 + "enabled.html");
+  await loadedPromise;
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  let progressPromise = waitForProgressNotification();
+  let notificationPromise = waitForNotification("addon-install-failed");
+  gBrowser.loadURI(TESTROOT + "corrupt.xpi");
+  await progressPromise;
+  let panel = await notificationPromise;
 
-    await removeTab();
-  })();
+  let notification = panel.childNodes[0];
+  is(notification.getAttribute("label"),
+     "The add-on downloaded from this site could not be installed " +
+     "because it appears to be corrupt.",
+     "Should have seen the right message");
+
+  await removeTab();
 },
 
-function test_wrongHost() {
-  return (async function() {
-    let requestedUrl = TESTROOT2 + "enabled.html";
-    gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
+async function test_reload() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
-    gBrowser.loadURI(TESTROOT2 + "enabled.html");
-    await loadedPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Unsigned XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
+
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let progressPromise = waitForProgressNotification();
-    let notificationPromise = waitForNotification("addon-install-failed");
-    gBrowser.loadURI(TESTROOT + "corrupt.xpi");
-    await progressPromise;
-    let panel = await notificationPromise;
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "XPI Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    let notification = panel.childNodes[0];
-    is(notification.getAttribute("label"),
-       "The add-on downloaded from this site could not be installed " +
-       "because it appears to be corrupt.",
-       "Should have seen the right message");
+  function testFail() {
+    ok(false, "Reloading should not have hidden the notification");
+  }
+  PopupNotifications.panel.addEventListener("popuphiding", testFail);
+  let requestedUrl = TESTROOT2 + "enabled.html";
+  let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
+  gBrowser.loadURI(TESTROOT2 + "enabled.html");
+  await loadedPromise;
+  PopupNotifications.panel.removeEventListener("popuphiding", testFail);
 
-    await removeTab();
-  })();
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending install");
+  installs[0].cancel();
+
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_reload() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_theme() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Unsigned XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "Theme XPI": "theme.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "XPI Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  let notification = panel.childNodes[0];
+  is(notification.button.label, "Restart Now", "Should have seen the right button");
+  is(notification.getAttribute("label"),
+     "Theme Test will be installed after you restart " + gApp + ".",
+     "Should have seen the right message");
 
-    function testFail() {
-      ok(false, "Reloading should not have hidden the notification");
-    }
-    PopupNotifications.panel.addEventListener("popuphiding", testFail);
-    let requestedUrl = TESTROOT2 + "enabled.html";
-    let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, requestedUrl);
-    gBrowser.loadURI(TESTROOT2 + "enabled.html");
-    await loadedPromise;
-    PopupNotifications.panel.removeEventListener("popuphiding", testFail);
+  let addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("{972ce4c6-7e08-4474-a285-3208198ce6fd}", function(result) {
+      resolve(result);
+    });
+  });
+  ok(addon.userDisabled, "Should be switching away from the default theme.");
+  // Undo the pending theme switch
+  addon.userDisabled = false;
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending install");
-    installs[0].cancel();
+  addon = await new Promise(resolve => {
+    AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(result) {
+      resolve(result);
+    });
+  });
+  isnot(addon, null, "Test theme will have been installed");
+  addon.uninstall();
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_theme() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_renotifyBlocked() {
+  let notificationPromise = waitForNotification("addon-install-blocked");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "Theme XPI": "theme.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let closePromise = waitForNotificationClose();
+  // hide the panel (this simulates the user dismissing it)
+  panel.hidePopup();
+  await closePromise;
 
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
+  info("Timeouts after this probably mean bug 589954 regressed");
 
-    let notification = panel.childNodes[0];
-    is(notification.button.label, "Restart Now", "Should have seen the right button");
-    is(notification.getAttribute("label"),
-       "Theme Test will be installed after you restart " + gApp + ".",
-       "Should have seen the right message");
+  await new Promise(resolve => executeSoon(resolve));
+
+  notificationPromise = waitForNotification("addon-install-blocked");
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await notificationPromise;
 
-    let addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("{972ce4c6-7e08-4474-a285-3208198ce6fd}", function(result) {
-        resolve(result);
-      });
-    });
-    ok(addon.userDisabled, "Should be switching away from the default theme.");
-    // Undo the pending theme switch
-    addon.userDisabled = false;
+  let installs = await getInstalls();
+  is(installs.length, 2, "Should be two pending installs");
 
-    addon = await new Promise(resolve => {
-      AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(result) {
-        resolve(result);
-      });
-    });
-    isnot(addon, null, "Test theme will have been installed");
-    addon.uninstall();
+  closePromise = waitForNotificationClose();
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
+  await closePromise;
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  installs = await getInstalls();
+  is(installs.length, 0, "Should have cancelled the installs");
 },
 
-function test_renotifyBlocked() {
-  return (async function() {
-    let notificationPromise = waitForNotification("addon-install-blocked");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
+async function test_renotifyInstalled() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
-    let closePromise = waitForNotificationClose();
-    // hide the panel (this simulates the user dismissing it)
-    panel.hidePopup();
-    await closePromise;
+  let progressPromise = waitForProgressNotification();
+  let dialogPromise = waitForInstallDialog();
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  let installDialog = await dialogPromise;
 
-    info("Timeouts after this probably mean bug 589954 regressed");
+  // Wait for the complete notification
+  let notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  let panel = await notificationPromise;
+
+  let closePromise = waitForNotificationClose();
+  // hide the panel (this simulates the user dismissing it)
+  panel.hidePopup();
+  await closePromise;
 
-    await new Promise(resolve => executeSoon(resolve));
+  // Install another
+  await new Promise(resolve => executeSoon(resolve));
 
-    notificationPromise = waitForNotification("addon-install-blocked");
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await notificationPromise;
+  progressPromise = waitForProgressNotification();
+  dialogPromise = waitForInstallDialog();
+  gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
+  await progressPromise;
+  installDialog = await dialogPromise;
+
+  info("Timeouts after this probably mean bug 589954 regressed");
 
-    let installs = await getInstalls();
-    is(installs.length, 2, "Should be two pending installs");
+  // Wait for the complete notification
+  notificationPromise = waitForNotification("addon-install-restart");
+  acceptInstallDialog(installDialog);
+  await notificationPromise;
 
-    closePromise = waitForNotificationClose();
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-    await closePromise;
+  let installs = await getInstalls();
+  is(installs.length, 1, "Should be one pending installs");
+  installs[0].cancel();
 
-    installs = await getInstalls();
-    is(installs.length, 0, "Should have cancelled the installs");
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await removeTab();
 },
 
-function test_renotifyInstalled() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+async function test_cancel() {
+  let pm = Services.perms;
+  pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
+
+  let notificationPromise = waitForNotification(PROGRESS_NOTIFICATION);
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "slowinstall.sjs?file=amosigned.xpi"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    let progressPromise = waitForProgressNotification();
-    let dialogPromise = waitForInstallDialog();
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    let installDialog = await dialogPromise;
+  let notification = panel.childNodes[0];
+  // Close the notification
+  let anchor = document.getElementById("addons-notification-icon");
+  anchor.click();
+  // Reopen the notification
+  anchor.click();
 
-    // Wait for the complete notification
-    let notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    let panel = await notificationPromise;
-
-    let closePromise = waitForNotificationClose();
-    // hide the panel (this simulates the user dismissing it)
-    panel.hidePopup();
-    await closePromise;
+  ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
 
-    // Install another
-    await new Promise(resolve => executeSoon(resolve));
-
-    progressPromise = waitForProgressNotification();
-    dialogPromise = waitForInstallDialog();
-    gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
-    await progressPromise;
-    installDialog = await dialogPromise;
-
-    info("Timeouts after this probably mean bug 589954 regressed");
+  // Cancel the download
+  let install = notification.notification.options.installs[0];
+  let cancelledPromise = new Promise(resolve => {
+    install.addListener({
+      onDownloadCancelled() {
+        install.removeListener(this);
+        resolve();
+      }
+    });
+  });
+  EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
+  await cancelledPromise;
 
-    // Wait for the complete notification
-    notificationPromise = waitForNotification("addon-install-restart");
-    acceptInstallDialog(installDialog);
-    await notificationPromise;
+  await new Promise(resolve => executeSoon(resolve));
+
+  ok(!PopupNotifications.isPanelOpen, "Notification should be closed");
 
-    let installs = await getInstalls();
-    is(installs.length, 1, "Should be one pending installs");
-    installs[0].cancel();
+  let installs = await getInstalls();
+  is(installs.length, 0, "Should be no pending install");
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await removeTab();
-  })();
+  Services.perms.remove(makeURI("http://example.com/"), "install");
+  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 },
 
-function test_cancel() {
-  return (async function() {
-    let pm = Services.perms;
-    pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
-
-    let notificationPromise = waitForNotification(PROGRESS_NOTIFICATION);
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "slowinstall.sjs?file=amosigned.xpi"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
-
-    let notification = panel.childNodes[0];
-    // Close the notification
-    let anchor = document.getElementById("addons-notification-icon");
-    anchor.click();
-    // Reopen the notification
-    anchor.click();
+async function test_failedSecurity() {
+  Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, false);
+  setupRedirect({
+    "Location": TESTROOT + "amosigned.xpi"
+  });
 
-    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
+  let notificationPromise = waitForNotification("addon-install-blocked");
+  let triggers = encodeURIComponent(JSON.stringify({
+    "XPI": "redirect.sjs?mode=redirect"
+  }));
+  BrowserTestUtils.openNewForegroundTab(gBrowser, SECUREROOT + "installtrigger.html?" + triggers);
+  let panel = await notificationPromise;
 
-    // Cancel the download
-    let install = notification.notification.options.installs[0];
-    let cancelledPromise = new Promise(resolve => {
-      install.addListener({
-        onDownloadCancelled() {
-          install.removeListener(this);
-          resolve();
-        }
-      });
-    });
-    EventUtils.synthesizeMouseAtCenter(notification.secondaryButton, {});
-    await cancelledPromise;
-
-    await new Promise(resolve => executeSoon(resolve));
-
-    ok(!PopupNotifications.isPanelOpen, "Notification should be closed");
-
-    let installs = await getInstalls();
-    is(installs.length, 0, "Should be no pending install");
+  let notification = panel.childNodes[0];
+  // Click on Allow
+  EventUtils.synthesizeMouse(notification.button, 20, 10, {});
 
-    Services.perms.remove(makeURI("http://example.com/"), "install");
-    await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-  })();
-},
-
-function test_failedSecurity() {
-  return (async function() {
-    Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, false);
-    setupRedirect({
-      "Location": TESTROOT + "amosigned.xpi"
-    });
-
-    let notificationPromise = waitForNotification("addon-install-blocked");
-    let triggers = encodeURIComponent(JSON.stringify({
-      "XPI": "redirect.sjs?mode=redirect"
-    }));
-    BrowserTestUtils.openNewForegroundTab(gBrowser, SECUREROOT + "installtrigger.html?" + triggers);
-    let panel = await notificationPromise;
-
-    let notification = panel.childNodes[0];
-    // Click on Allow
-    EventUtils.synthesizeMouse(notification.button, 20, 10, {});
+  // Notification should have changed to progress notification
+  ok(PopupNotifications.isPanelOpen, "Notification should still be open");
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
 
-    // Notification should have changed to progress notification
-    ok(PopupNotifications.isPanelOpen, "Notification should still be open");
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
+  // Wait for it to fail
+  await new Promise(resolve => {
+    Services.obs.addObserver(function observer() {
+      Services.obs.removeObserver(observer, "addon-install-failed");
+      resolve();
+    }, "addon-install-failed");
+  });
 
-    // Wait for it to fail
-    await new Promise(resolve => {
-      Services.obs.addObserver(function observer() {
-        Services.obs.removeObserver(observer, "addon-install-failed");
-        resolve();
-      }, "addon-install-failed");
-    });
+  // Allow the browser code to add the failure notification and then wait
+  // for the progress notification to dismiss itself
+  await waitForSingleNotification();
+  is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
+  notification = panel.childNodes[0];
+  is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
 
-    // Allow the browser code to add the failure notification and then wait
-    // for the progress notification to dismiss itself
-    await waitForSingleNotification();
-    is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
-    notification = panel.childNodes[0];
-    is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
-
-    Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, true);
-    await removeTab();
-  })();
+  Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, true);
+  await removeTab();
 }
 ];
 
 var gTestStart = null;
 
 var XPInstallObserver = {
   observe(aSubject, aTopic, aData) {
     var installInfo = aSubject.wrappedJSObject;
--- a/devtools/client/shared/components/search-box.js
+++ b/devtools/client/shared/components/search-box.js
@@ -144,16 +144,18 @@ module.exports = createClass({
     let {
       type = "search",
       placeholder,
       autocompleteList
     } = this.props;
     let { value } = this.state;
     let divClassList = ["devtools-searchbox", "has-clear-btn"];
     let inputClassList = [`devtools-${type}input`];
+    let showAutocomplete =
+      autocompleteList.length > 0 && this.state.focused && value !== "";
 
     if (value !== "") {
       inputClassList.push("filled");
     }
     return dom.div(
       { className: divClassList.join(" ") },
       dom.input({
         className: inputClassList.join(" "),
@@ -165,18 +167,17 @@ module.exports = createClass({
         ref: "input",
         value,
       }),
       dom.button({
         className: "devtools-searchinput-clear",
         hidden: value == "",
         onClick: this.onClearButtonClick
       }),
-      autocompleteList.length > 0 && this.state.focused &&
-      AutocompletePopup({
+      showAutocomplete && AutocompletePopup({
         list: autocompleteList,
         filter: value,
         ref: "autocomplete",
         onItemSelected: (itemValue) => {
           this.setState({ value: itemValue });
           this.onChange();
         }
       })
--- a/devtools/client/shared/components/test/mochitest/test_searchbox-with-autocomplete.html
+++ b/devtools/client/shared/components/test/mochitest/test_searchbox-with-autocomplete.html
@@ -46,57 +46,58 @@ window.onload = async function () {
     autocompleteList: [
       "foo",
       "BAR",
       "baZ",
       "abc",
       "pqr",
       "xyz",
       "ABC",
+      "a1",
+      "a2",
+      "a3",
+      "a4",
+      "a5",
     ],
     onChange: () => null,
   });
   const { refs } = component;
 
   async function testSearchBoxWithAutocomplete() {
     ok(!$(".devtools-autocomplete-popup"), "Autocomplete list not visible");
 
     $(".devtools-searchinput").focus();
     await forceRender(component); // Wait for state update
+    ok(!$(".devtools-autocomplete-popup"), "Autocomplete list not visible");
+
+    sendString("a");
+    await forceRender(component);
 
     compareAutocompleteList($(".devtools-autocomplete-listbox"), [
       "ABC",
-      "BAR",
+      "a1",
+      "a2",
+      "a3",
+      "a4",
+      "a5",
       "abc",
-      "baZ",
-      "foo",
-      "pqr",
-      "xyz",
     ]);
 
     is(refs.autocomplete.state.selectedIndex, -1, "Initialised selectedIndex is -1");
 
     // Blur event
     $(".devtools-searchinput").blur();
     await forceRender(component);
     ok(!component.state.focused, "focused state was properly set");
     ok(!$(".devtools-autocomplete-popup"), "Autocomplete list removed from DOM");
   }
 
   async function testKeyEventsWithAutocomplete() {
-    // Filtering of list
+    // Clear the initial input
     $(".devtools-searchinput").focus();
-    await forceRender(component);
-    sendString("aB");
-    await forceRender(component);
-    compareAutocompleteList($(".devtools-autocomplete-listbox"), ["ABC", "abc"]);
-
-    // Clear the initial input
-    synthesizeKey("VK_BACK_SPACE", {});
-    synthesizeKey("VK_BACK_SPACE", {});
 
     // ArrowDown
     synthesizeKey("VK_DOWN", {});
     await forceRender(component);
     is(refs.autocomplete.state.selectedIndex, 0, "selectedIndex is 0");
     ok($(".devtools-autocomplete-listbox .autocomplete-item:nth-child(1)")
       .className.includes("autocomplete-selected"),
       "Selection class applied");
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -336,19 +336,25 @@ Element::TabIndex()
 
   return TabIndexDefault();
 }
 
 void
 Element::Focus(mozilla::ErrorResult& aError)
 {
   nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(this);
-  nsIFocusManager* fm = nsFocusManager::GetFocusManager();
+  nsFocusManager* fm = nsFocusManager::GetFocusManager();
+  // Also other browsers seem to have the hack to not re-focus (and flush) when
+  // the element is already focused.
   if (fm && domElement) {
-    aError = fm->SetFocus(domElement, 0);
+    if (fm->CanSkipFocus(this)) {
+      fm->NeedsFlushBeforeEventHandling(this);
+    } else {
+      aError = fm->SetFocus(domElement, 0);
+    }
   }
 }
 
 void
 Element::SetTabIndex(int32_t aTabIndex, mozilla::ErrorResult& aError)
 {
   nsAutoString value;
   value.AppendInt(aTabIndex);
--- a/dom/base/Timeout.cpp
+++ b/dom/base/Timeout.cpp
@@ -17,17 +17,17 @@ namespace dom {
 Timeout::Timeout()
   : mCleared(false),
     mRunning(false),
     mIsInterval(false),
     mIsTracking(false),
     mReason(Reason::eTimeoutOrInterval),
     mTimeoutId(0),
     mInterval(0),
-    mFiringDepth(0),
+    mFiringId(TimeoutManager::InvalidFiringId),
     mNestingLevel(0),
     mPopupState(openAllowed)
 {
   MOZ_COUNT_CTOR(Timeout);
 }
 
 Timeout::~Timeout()
 {
@@ -38,23 +38,21 @@ Timeout::~Timeout()
 
   MOZ_COUNT_DTOR(Timeout);
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(Timeout)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Timeout)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mPrincipal)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mScriptHandler)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Timeout)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrincipal)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mScriptHandler)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(Timeout, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(Timeout, Release)
 
 namespace {
 
--- a/dom/base/Timeout.h
+++ b/dom/base/Timeout.h
@@ -85,21 +85,19 @@ public:
   Reason mReason;
 
   // Returned as value of setTimeout()
   uint32_t mTimeoutId;
 
   // Interval in milliseconds
   uint32_t mInterval;
 
-  // Principal with which to execute
-  nsCOMPtr<nsIPrincipal> mPrincipal;
-
-  // stack depth at which timeout is firing
-  uint32_t mFiringDepth;
+  // Identifies which firing level this Timeout is being processed in
+  // when sync loops trigger nested firing.
+  uint32_t mFiringId;
 
   uint32_t mNestingLevel;
 
   // The popup state at timeout creation time if not created from
   // another timeout
   PopupControlState mPopupState;
 
   // The language-specific information about the callback.
--- a/dom/base/TimeoutManager.cpp
+++ b/dom/base/TimeoutManager.cpp
@@ -134,22 +134,83 @@ static int32_t              gRunningTime
 #define DEFAULT_MIN_TRACKING_BACKGROUND_TIMEOUT_VALUE 1000 // 1000ms
 static int32_t gMinTimeoutValue = 0;
 static int32_t gMinBackgroundTimeoutValue = 0;
 static int32_t gMinTrackingTimeoutValue = 0;
 static int32_t gMinTrackingBackgroundTimeoutValue = 0;
 static int32_t gTrackingTimeoutThrottlingDelay = 0;
 static bool    gAnnotateTrackingChannels = false;
 
+// static
+const uint32_t TimeoutManager::InvalidFiringId = 0;
+
 bool
 TimeoutManager::IsBackground() const
 {
   return !mWindow.AsInner()->IsPlayingAudio() && mWindow.IsBackgroundInternal();
 }
 
+uint32_t
+TimeoutManager::CreateFiringId()
+{
+  uint32_t id = mNextFiringId;
+  mNextFiringId += 1;
+  if (mNextFiringId == InvalidFiringId) {
+    mNextFiringId += 1;
+  }
+
+  mFiringIdStack.AppendElement(id);
+
+  return id;
+}
+
+void
+TimeoutManager::DestroyFiringId(uint32_t aFiringId)
+{
+  MOZ_DIAGNOSTIC_ASSERT(!mFiringIdStack.IsEmpty());
+  MOZ_DIAGNOSTIC_ASSERT(mFiringIdStack.LastElement() == aFiringId);
+  mFiringIdStack.RemoveElementAt(mFiringIdStack.Length() - 1);
+}
+
+bool
+TimeoutManager::IsInvalidFiringId(uint32_t aFiringId) const
+{
+  // Check the most common ways to invalidate a firing id first.
+  // These should be quite fast.
+  if (aFiringId == InvalidFiringId ||
+      mFiringIdStack.IsEmpty() ||
+      (mFiringIdStack.Length() == 1 && mFiringIdStack[0] != aFiringId)) {
+    return true;
+  }
+
+  // Next do a range check on the first and last items in the stack
+  // of active firing ids.  This is a bit slower.
+  uint32_t low = mFiringIdStack[0];
+  uint32_t high = mFiringIdStack.LastElement();
+  MOZ_DIAGNOSTIC_ASSERT(low != high);
+  if (low > high) {
+    // If the first element is bigger than the last element in the
+    // stack, that means mNextFiringId wrapped around to zero at
+    // some point.
+    Swap(low, high);
+  }
+  MOZ_DIAGNOSTIC_ASSERT(low < high);
+
+  if (aFiringId < low || aFiringId > high) {
+    return true;
+  }
+
+  // Finally, fall back to verifying the firing id is not anywhere
+  // in the stack.  This could be slow for a large stack, but that
+  // should be rare.  It can only happen with deeply nested event
+  // loop spinning.  For example, a page that does a lot of timers
+  // and a lot of sync XHRs within those timers could be slow here.
+  return !mFiringIdStack.Contains(aFiringId);
+}
+
 int32_t
 TimeoutManager::DOMMinTimeoutValue(bool aIsTracking) const {
   // First apply any back pressure delay that might be in effect.
   int32_t value = std::max(mBackPressureDelayMS, 0);
   // Don't use the background timeout value when the tab is playing audio.
   // Until bug 1336484 we only used to do this for pages that use Web Audio.
   // The original behavior was implemented in bug 11811073.
   bool isBackground = IsBackground();
@@ -179,20 +240,20 @@ static int32_t gTimeoutBucketingStrategy
 // timer code can handle, really. See DELAY_INTERVAL_LIMIT in
 // nsTimerImpl.h for details.
 #define DOM_MAX_TIMEOUT_VALUE    DELAY_INTERVAL_LIMIT
 
 uint32_t TimeoutManager::sNestingLevel = 0;
 
 namespace {
 
-// The maximum number of timer callbacks we will try to run in a single event
-// loop runnable.
-#define DEFAULT_TARGET_MAX_CONSECUTIVE_CALLBACKS 5
-uint32_t gTargetMaxConsecutiveCallbacks;
+// The maximum number of milliseconds to allow consecutive timer callbacks
+// to run in a single event loop runnable.
+#define DEFAULT_MAX_CONSECUTIVE_CALLBACKS_MILLISECONDS 4
+uint32_t gMaxConsecutiveCallbacksMilliseconds;
 
 // The number of queued runnables within the TabGroup ThrottledEventQueue
 // at which to begin applying back pressure to the window.
 #define DEFAULT_THROTTLED_EVENT_QUEUE_BACK_PRESSURE 5000
 static uint32_t gThrottledEventQueueBackPressure;
 
 // The amount of delay to apply to timers when back pressure is triggered.
 // As the length of the ThrottledEventQueue grows delay is increased.  The
@@ -236,17 +297,17 @@ CalculateNewBackPressureDelayMS(uint32_t
   return static_cast<int32_t>(value);
 }
 
 } // anonymous namespace
 
 TimeoutManager::TimeoutManager(nsGlobalWindow& aWindow)
   : mWindow(aWindow),
     mTimeoutIdCounter(1),
-    mTimeoutFiringDepth(0),
+    mNextFiringId(InvalidFiringId + 1),
     mRunningTimeout(nullptr),
     mIdleCallbackTimeoutCounter(1),
     mBackPressureDelayMS(0),
     mThrottleTrackingTimeouts(gTrackingTimeoutThrottlingDelay <= 0)
 {
   MOZ_DIAGNOSTIC_ASSERT(aWindow.IsInnerWindow());
 
   MOZ_LOG(gLog, LogLevel::Debug,
@@ -297,33 +358,39 @@ TimeoutManager::Initialize()
                                DEFAULT_BACK_PRESSURE_DELAY_MS);
   Preferences::AddUintVarCache(&gBackPressureDelayReductionThresholdMS,
                                "dom.timeout.back_pressure_delay_reduction_threshold_ms",
                                DEFAULT_BACK_PRESSURE_DELAY_REDUCTION_THRESHOLD_MS);
   Preferences::AddUintVarCache(&gBackPressureDelayMinimumMS,
                                "dom.timeout.back_pressure_delay_minimum_ms",
                                DEFAULT_BACK_PRESSURE_DELAY_MINIMUM_MS);
 
-  Preferences::AddUintVarCache(&gTargetMaxConsecutiveCallbacks,
-                               "dom.timeout.max_consecutive_callbacks",
-                               DEFAULT_TARGET_MAX_CONSECUTIVE_CALLBACKS);
+  Preferences::AddUintVarCache(&gMaxConsecutiveCallbacksMilliseconds,
+                               "dom.timeout.max_consecutive_callbacks_ms",
+                               DEFAULT_MAX_CONSECUTIVE_CALLBACKS_MILLISECONDS);
 }
 
 uint32_t
 TimeoutManager::GetTimeoutId(Timeout::Reason aReason)
 {
   switch (aReason) {
     case Timeout::Reason::eIdleCallbackTimeout:
       return ++mIdleCallbackTimeoutCounter;
     case Timeout::Reason::eTimeoutOrInterval:
     default:
       return ++mTimeoutIdCounter;
   }
 }
 
+bool
+TimeoutManager::IsRunningTimeout() const
+{
+  return mRunningTimeout;
+}
+
 nsresult
 TimeoutManager::SetTimeout(nsITimeoutHandler* aHandler,
                            int32_t interval, bool aIsInterval,
                            Timeout::Reason aReason, int32_t* aReturn)
 {
   // If we don't have a document (we could have been unloaded since
   // the call to setTimeout was made), do nothing.
   nsCOMPtr<nsIDocument> doc = mWindow.GetExtantDoc();
@@ -517,22 +584,43 @@ void
 TimeoutManager::RunTimeout(Timeout* aTimeout)
 {
   if (mWindow.IsSuspended()) {
     return;
   }
 
   NS_ASSERTION(!mWindow.IsFrozen(), "Timeout running on a window in the bfcache!");
 
+  // Limit the overall time spent in RunTimeout() to reduce jank.
+  uint32_t totalTimeLimitMS = std::max(1u, gMaxConsecutiveCallbacksMilliseconds);
+  const TimeDuration totalTimeLimit = TimeDuration::FromMilliseconds(totalTimeLimitMS);
+
+  // Allow up to 25% of our total time budget to be used figuring out which
+  // timers need to run.  This is the initial loop in this method.
+  const TimeDuration initalTimeLimit =
+    TimeDuration::FromMilliseconds(totalTimeLimit.ToMilliseconds() / 4);
+
+  // Ammortize overhead from from calling TimeStamp::Now() in the initial
+  // loop, though, by only checking for an elapsed limit every N timeouts.
+  const uint32_t kNumTimersPerInitialElapsedCheck = 100;
+
+  // Start measuring elapsed time immediately.  We won't potentially expire
+  // the time budget until at least one Timeout has run, though.
+  TimeStamp start = TimeStamp::Now();
+
   Timeout* last_expired_normal_timeout = nullptr;
   Timeout* last_expired_tracking_timeout = nullptr;
   bool     last_expired_timeout_is_normal = false;
   Timeout* last_normal_insertion_point = nullptr;
   Timeout* last_tracking_insertion_point = nullptr;
-  uint32_t firingDepth = mTimeoutFiringDepth + 1;
+
+  uint32_t firingId = CreateFiringId();
+  auto guard = MakeScopeExit([&] {
+    DestroyFiringId(firingId);
+  });
 
   // Make sure that the window and the script context don't go away as
   // a result of running timeouts
   nsCOMPtr<nsIScriptGlobalObject> windowKungFuDeathGrip(&mWindow);
   // Silence the static analysis error about windowKungFuDeathGrip.  Accessing
   // members of mWindow here is safe, because the lifetime of TimeoutManager is
   // the same as the lifetime of the containing nsGlobalWindow.
   Unused << windowKungFuDeathGrip;
@@ -572,20 +660,20 @@ TimeoutManager::RunTimeout(Timeout* aTim
     bool targetTimerSeen = false;
 
     while (true) {
       Timeout* timeout = expiredIter.Next();
       if (!timeout || timeout->When() > deadline) {
         break;
       }
 
-      if (timeout->mFiringDepth == 0) {
+      if (IsInvalidFiringId(timeout->mFiringId)) {
         // Mark any timeouts that are on the list to be fired with the
         // firing depth so that we can reentrantly run timeouts
-        timeout->mFiringDepth = firingDepth;
+        timeout->mFiringId = firingId;
         last_expired_timeout_is_normal = expiredIter.PickedNormalIter();
         if (last_expired_timeout_is_normal) {
           last_expired_normal_timeout = timeout;
         } else {
           last_expired_tracking_timeout = timeout;
         }
 
         numTimersToRun += 1;
@@ -595,26 +683,23 @@ TimeoutManager::RunTimeout(Timeout* aTim
         if (timeout == aTimeout) {
           targetTimerSeen = true;
         }
 
         // Run only a limited number of timers based on the configured
         // maximum.  Note, we must always run our target timer however.
         // Further timers that are ready will get picked up by their own
         // nsITimer runnables when they execute.
-        //
-        // For chrome windows, however, we do coalesce all timers and
-        // do not yield the main thread.  This is partly because we
-        // trust chrome windows not to misbehave and partly because a
-        // number of browser chrome tests have races that depend on this
-        // coalescing.
-        if (targetTimerSeen &&
-            numTimersToRun >= gTargetMaxConsecutiveCallbacks &&
-            !mWindow.IsChromeWindow()) {
-          break;
+        if (targetTimerSeen) {
+          if (numTimersToRun % kNumTimersPerInitialElapsedCheck == 0) {
+            TimeDuration elapsed(TimeStamp::Now() - start);
+            if (elapsed >= initalTimeLimit) {
+              break;
+            }
+          }
         }
       }
 
       expiredIter.UpdateIterator();
     }
   }
 
   // Maybe the timeout that the event was fired for has been deleted
@@ -625,24 +710,24 @@ TimeoutManager::RunTimeout(Timeout* aTim
   }
 
   // Insert a dummy timeout into the list of timeouts between the
   // portion of the list that we are about to process now and those
   // timeouts that will be processed in a future call to
   // win_run_timeout(). This dummy timeout serves as the head of the
   // list for any timeouts inserted as a result of running a timeout.
   RefPtr<Timeout> dummy_normal_timeout = new Timeout();
-  dummy_normal_timeout->mFiringDepth = firingDepth;
+  dummy_normal_timeout->mFiringId = firingId;
   dummy_normal_timeout->SetDummyWhen(now);
   if (last_expired_timeout_is_normal) {
     last_expired_normal_timeout->setNext(dummy_normal_timeout);
   }
 
   RefPtr<Timeout> dummy_tracking_timeout = new Timeout();
-  dummy_tracking_timeout->mFiringDepth = firingDepth;
+  dummy_tracking_timeout->mFiringId = firingId;
   dummy_tracking_timeout->SetDummyWhen(now);
   if (!last_expired_timeout_is_normal) {
     last_expired_tracking_timeout->setNext(dummy_tracking_timeout);
   }
 
   RefPtr<Timeout> timeoutExtraRef1(dummy_normal_timeout);
   RefPtr<Timeout> timeoutExtraRef2(dummy_tracking_timeout);
 
@@ -658,16 +743,18 @@ TimeoutManager::RunTimeout(Timeout* aTim
 
   last_tracking_insertion_point = mTrackingTimeouts.InsertionPoint();
   if (!last_expired_timeout_is_normal) {
     // If we ever start setting mTrackingTimeoutInsertionPoint to a non-dummy timeout,
     // the logic in ResetTimersForThrottleReduction will need to change.
     mTrackingTimeouts.SetInsertionPoint(dummy_tracking_timeout);
   }
 
+  bool targetTimeoutSeen = false;
+
   // We stop iterating each list when we go past the last expired timeout from
   // that list that we have observed above.  That timeout will either be the
   // dummy timeout for the list that the last expired timeout came from, or it
   // will be the next item after the last timeout we looked at (or nullptr if
   // we have exhausted the entire list while looking for the last expired
   // timeout).
   {
     // Use a nested scope in order to make sure the strong references held by
@@ -675,53 +762,58 @@ TimeoutManager::RunTimeout(Timeout* aTim
     OrderedTimeoutIterator runIter(mNormalTimeouts,
                                    mTrackingTimeouts,
                                    last_expired_normal_timeout ?
                                      last_expired_normal_timeout->getNext() :
                                      nullptr,
                                    last_expired_tracking_timeout ?
                                      last_expired_tracking_timeout->getNext() :
                                      nullptr);
-    while (!mWindow.IsFrozen()) {
+    while (true) {
       Timeout* timeout = runIter.Next();
       MOZ_ASSERT(timeout != dummy_normal_timeout &&
                  timeout != dummy_tracking_timeout,
                  "We should have stopped iterating before getting to the dummy timeout");
       if (!timeout) {
         // We have run out of timeouts!
         break;
       }
       runIter.UpdateIterator();
 
-      if (timeout->mFiringDepth != firingDepth) {
+      if (timeout->mFiringId != firingId) {
         // We skip the timeout since it's on the list to run at another
         // depth.
         continue;
       }
 
+      MOZ_ASSERT_IF(mWindow.IsFrozen(), mWindow.IsSuspended());
       if (mWindow.IsSuspended()) {
-        // Some timer did suspend us. Make sure the
-        // rest of the timers get executed later.
-        timeout->mFiringDepth = 0;
-        continue;
+        break;
       }
 
       // The timeout is on the list to run at this depth, go ahead and
       // process it.
 
       // Get the script context (a strong ref to prevent it going away)
       // for this timeout and ensure the script language is enabled.
       nsCOMPtr<nsIScriptContext> scx = mWindow.GetContextInternal();
 
       if (!scx) {
         // No context means this window was closed or never properly
-        // initialized for this language.
+        // initialized for this language.  This timer will never fire
+        // so just remove it.
+        timeout->remove();
+        timeout->Release();
         continue;
       }
 
+      if (timeout == aTimeout) {
+        targetTimeoutSeen = true;
+      }
+
       // This timeout is good to run
       bool timeout_was_cleared = mWindow.RunTimeoutHandler(timeout, scx);
       MOZ_LOG(gLog, LogLevel::Debug,
               ("Run%s(TimeoutManager=%p, timeout=%p, aTimeout=%p, tracking=%d) returned %d\n", timeout->mIsInterval ? "Interval" : "Timeout",
                this, timeout, aTimeout,
                int(aTimeout->mIsTracking),
                !!timeout_was_cleared));
 
@@ -745,16 +837,19 @@ TimeoutManager::RunTimeout(Timeout* aTim
           MOZ_ASSERT(dummy_normal_timeout->HasRefCnt(2), "dummy_normal_timeout may leak");
           MOZ_ASSERT(dummy_tracking_timeout->HasRefCnt(1), "dummy_tracking_timeout may leak");
           Unused << timeoutExtraRef2.forget().take();
         }
 
         mNormalTimeouts.SetInsertionPoint(last_normal_insertion_point);
         mTrackingTimeouts.SetInsertionPoint(last_tracking_insertion_point);
 
+        // Since ClearAllTimeouts() was called the lists should be empty.
+        MOZ_DIAGNOSTIC_ASSERT(!HasTimeouts());
+
         return;
       }
 
       // If we have a regular interval timer, we re-schedule the
       // timeout, accounting for clock drift.
       bool needsReinsertion = RescheduleTimeout(timeout, now, !aTimeout);
 
       // Running a timeout can cause another timeout to be deleted, so
@@ -774,16 +869,28 @@ TimeoutManager::RunTimeout(Timeout* aTim
           mNormalTimeouts.Insert(timeout,
                                  mWindow.IsFrozen() ? Timeouts::SortBy::TimeRemaining
                                                     : Timeouts::SortBy::TimeWhen);
         }
       }
 
       // Release the timeout struct since it's possibly out of the list
       timeout->Release();
+
+      // Check to see if we have run out of time to execute timeout handlers.
+      // If we've exceeded our time budget then terminate the loop immediately.
+      //
+      // Note, we only do this if we have seen the Timeout object explicitly
+      // passed to RunTimeout().  The target timeout must always be executed.
+      if (targetTimeoutSeen) {
+        TimeDuration elapsed = TimeStamp::Now() - start;
+        if (elapsed >= totalTimeLimit) {
+          break;
+        }
+      }
     }
   }
 
   // Take the dummy timeout off the head of the list
   if (dummy_normal_timeout->isInList()) {
     dummy_normal_timeout->remove();
   }
   timeoutExtraRef1 = nullptr;
@@ -1095,21 +1202,21 @@ TimeoutManager::Timeouts::ResetTimersFor
       Timeout* prevTimeout = timeout->getPrevious();
       if (prevTimeout && prevTimeout->When() > timeout->When()) {
         // It is safe to remove and re-insert because When() is now
         // strictly smaller than it used to be, so we know we'll insert
         // |timeout| before nextTimeout.
         NS_ASSERTION(!nextTimeout ||
                      timeout->When() < nextTimeout->When(), "How did that happen?");
         timeout->remove();
-        // Insert() will addref |timeout| and reset mFiringDepth.  Make sure to
+        // Insert() will addref |timeout| and reset mFiringId.  Make sure to
         // undo that after calling it.
-        uint32_t firingDepth = timeout->mFiringDepth;
+        uint32_t firingId = timeout->mFiringId;
         Insert(timeout, aSortBy);
-        timeout->mFiringDepth = firingDepth;
+        timeout->mFiringId = firingId;
         timeout->Release();
       }
 
       nsresult rv = timeout->InitTimer(aQueue, delay.ToMilliseconds());
 
       if (NS_FAILED(rv)) {
         NS_WARNING("Error resetting non background timer for DOM timeout!");
         return rv;
@@ -1193,31 +1300,30 @@ TimeoutManager::Timeouts::Insert(Timeout
 
   // Now link in aTimeout after prevSibling.
   if (prevSibling) {
     prevSibling->setNext(aTimeout);
   } else {
     InsertFront(aTimeout);
   }
 
-  aTimeout->mFiringDepth = 0;
+  aTimeout->mFiringId = InvalidFiringId;
 
   // Increment the timeout's reference count since it's now held on to
   // by the list
   aTimeout->AddRef();
 }
 
 Timeout*
 TimeoutManager::BeginRunningTimeout(Timeout* aTimeout)
 {
   Timeout* currentTimeout = mRunningTimeout;
   mRunningTimeout = aTimeout;
 
   ++gRunningTimeoutDepth;
-  ++mTimeoutFiringDepth;
 
   if (!mWindow.IsChromeWindow()) {
     TimeStamp now = TimeStamp::Now();
     if (currentTimeout) {
       // If we're already running a timeout and start running another
       // one, record the fragment duration already collected.
       TimeoutTelemetry::Get().RecordExecution(
         now, currentTimeout, IsBackground());
@@ -1228,17 +1334,16 @@ TimeoutManager::BeginRunningTimeout(Time
   }
 
   return currentTimeout;
 }
 
 void
 TimeoutManager::EndRunningTimeout(Timeout* aTimeout)
 {
-  --mTimeoutFiringDepth;
   --gRunningTimeoutDepth;
 
   if (!mWindow.IsChromeWindow()) {
     TimeStamp now = TimeStamp::Now();
     TimeoutTelemetry::Get().RecordExecution(now, mRunningTimeout, IsBackground());
 
     if (aTimeout) {
       // If we were running a nested timeout, restart the measurement
--- a/dom/base/TimeoutManager.h
+++ b/dom/base/TimeoutManager.h
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_TimeoutManager_h__
 #define mozilla_dom_TimeoutManager_h__
 
 #include "mozilla/dom/Timeout.h"
+#include "nsTArray.h"
 
 class nsIEventTarget;
 class nsITimeoutHandler;
 class nsGlobalWindow;
 
 namespace mozilla {
 namespace dom {
 
@@ -22,17 +23,17 @@ class OrderedTimeoutIterator;
 class TimeoutManager final
 {
 public:
   explicit TimeoutManager(nsGlobalWindow& aWindow);
   ~TimeoutManager();
   TimeoutManager(const TimeoutManager& rhs) = delete;
   void operator=(const TimeoutManager& rhs) = delete;
 
-  bool IsRunningTimeout() const { return mTimeoutFiringDepth > 0; }
+  bool IsRunningTimeout() const;
 
   static uint32_t GetNestingLevel() { return sNestingLevel; }
   static void SetNestingLevel(uint32_t aLevel) { sNestingLevel = aLevel; }
 
   bool HasTimeouts() const
   {
     return !mNormalTimeouts.IsEmpty() ||
            !mTrackingTimeouts.IsEmpty();
@@ -112,21 +113,34 @@ public:
   {
     if (!mNormalTimeouts.ForEachAbortable(c)) {
       mTrackingTimeouts.ForEachAbortable(c);
     }
   }
 
   void BeginSyncOperation();
   void EndSyncOperation();
+
+  static const uint32_t InvalidFiringId;
+
 private:
   nsresult ResetTimersForThrottleReduction(int32_t aPreviousThrottleDelayMS);
   void MaybeStartThrottleTrackingTimout();
 
   bool IsBackground() const;
+
+  uint32_t
+  CreateFiringId();
+
+  void
+  DestroyFiringId(uint32_t aFiringId);
+
+  bool
+  IsInvalidFiringId(uint32_t aFiringId) const;
+
 private:
   struct Timeouts {
     Timeouts()
       : mTimeoutInsertionPoint(nullptr)
     {
     }
 
     // Insert aTimeout into the list, before all timeouts that would
@@ -204,17 +218,18 @@ private:
   // Each nsGlobalWindow object has a TimeoutManager member.  This reference
   // points to that holder object.
   nsGlobalWindow&             mWindow;
   // The list of timeouts coming from non-tracking scripts.
   Timeouts                    mNormalTimeouts;
   // The list of timeouts coming from scripts on the tracking protection list.
   Timeouts                    mTrackingTimeouts;
   uint32_t                    mTimeoutIdCounter;
-  uint32_t                    mTimeoutFiringDepth;
+  uint32_t                    mNextFiringId;
+  AutoTArray<uint32_t, 2>     mFiringIdStack;
   mozilla::dom::Timeout*      mRunningTimeout;
 
    // The current idle request callback timeout handle
   uint32_t                    mIdleCallbackTimeoutCounter;
 
   int32_t                     mBackPressureDelayMS;
 
   nsCOMPtr<nsITimer>          mThrottleTrackingTimeoutsTimer;
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -176,16 +176,17 @@ static const char* kObservedPrefs[] = {
   "accessibility.browsewithcaret",
   "accessibility.tabfocus_applies_to_xul",
   "accessibility.mouse_focuses_formcontrol",
   "focusmanager.testmode",
   nullptr
 };
 
 nsFocusManager::nsFocusManager()
+  : mEventHandlingNeedsFlush(false)
 { }
 
 nsFocusManager::~nsFocusManager()
 {
   Preferences::RemoveObservers(this, kObservedPrefs);
 
   nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
   if (obs) {
@@ -1562,16 +1563,17 @@ nsFocusManager::CheckIfFocusable(nsICont
   nsCOMPtr<nsIDocument> doc = aContent->GetComposedDoc();
   // can't focus elements that are not in documents
   if (!doc) {
     LOGCONTENT("Cannot focus %s because content not in document", aContent)
     return nullptr;
   }
 
   // Make sure that our frames are up to date
+  mEventHandlingNeedsFlush = false;
   doc->FlushPendingNotifications(FlushType::Layout);
 
   nsIPresShell *shell = doc->GetShell();
   if (!shell)
     return nullptr;
 
   // the root content can always be focused,
   // except in userfocusignored context.
--- a/dom/base/nsFocusManager.h
+++ b/dom/base/nsFocusManager.h
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsFocusManager_h___
 #define nsFocusManager_h___
 
 #include "nsCycleCollectionParticipant.h"
+#include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIFocusManager.h"
 #include "nsIObserver.h"
 #include "nsIWidget.h"
 #include "nsWeakReference.h"
 #include "mozilla/Attributes.h"
 
 #define FOCUSMETHOD_MASK 0xF000
@@ -88,16 +89,39 @@ public:
   already_AddRefed<nsIDocument>
     SetMouseButtonHandlingDocument(nsIDocument* aDocument)
   {
     nsCOMPtr<nsIDocument> handlingDocument = mMouseButtonEventHandlingDocument;
     mMouseButtonEventHandlingDocument = aDocument;
     return handlingDocument.forget();
   }
 
+  void NeedsFlushBeforeEventHandling(nsIContent* aContent)
+  {
+    if (mFocusedContent == aContent) {
+      mEventHandlingNeedsFlush = true;
+    }
+  }
+
+  bool CanSkipFocus(nsIContent* aContent)
+  {
+    return mFocusedContent == aContent;
+  }
+
+  void FlushBeforeEventHandlingIfNeeded(nsIContent* aContent)
+  {
+    if (mEventHandlingNeedsFlush) {
+      nsCOMPtr<nsIDocument> doc = aContent->GetComposedDoc();
+      if (doc) {
+        mEventHandlingNeedsFlush = false;
+        doc->FlushPendingNotifications(mozilla::FlushType::Layout);
+      }
+    }
+  }
+
   /**
    * Update the caret with current mode (whether in caret browsing mode or not).
    */
   void UpdateCaretForCaretBrowsingMode();
 
   /**
    * Returns the content node that would be focused if aWindow was in an
    * active window. This will traverse down the frame hierarchy, starting at
@@ -556,16 +580,20 @@ private:
   // content if it's not consumed.  Therefore, while DOM event handlers are
   // handling mouse down events or preceding mosue down event is consumed but
   // handling mouse up events, they should be able to steal focus from any
   // elements even if focus is in chrome content.  So, if this isn't nullptr
   // and the caller can access the document node, the caller should succeed in
   // moving focus.
   nsCOMPtr<nsIDocument> mMouseButtonEventHandlingDocument;
 
+  // If set to true, layout of the document of the event target should be
+  // flushed before handling focus depending events.
+  bool mEventHandlingNeedsFlush;
+
   static bool sTestMode;
 
   // the single focus manager
   static nsFocusManager* sInstance;
 };
 
 nsresult
 NS_NewFocusManager(nsIFocusManager** aResult);
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -4920,16 +4920,24 @@ HTMLInputElement::UnbindFromTree(bool aD
 }
 
 void
 HTMLInputElement::HandleTypeChange(uint8_t aNewType, bool aNotify)
 {
   uint8_t oldType = mType;
   MOZ_ASSERT(oldType != aNewType);
 
+  nsFocusManager* fm = nsFocusManager::GetFocusManager();
+  if (fm) {
+    // Input element can represent very different kinds of UIs, and we may
+    // need to flush styling even when focusing the already focused input
+    // element.
+    fm->NeedsFlushBeforeEventHandling(this);
+  }
+
   if (aNewType == NS_FORM_INPUT_FILE || oldType == NS_FORM_INPUT_FILE) {
     if (aNewType == NS_FORM_INPUT_FILE) {
       mFileData.reset(new FileData());
     } else {
       mFileData->Unlink();
       mFileData = nullptr;
     }
   }
--- a/extensions/cookie/moz.build
+++ b/extensions/cookie/moz.build
@@ -9,16 +9,20 @@ TEST_DIRS += ['test']
 UNIFIED_SOURCES += [
     'nsCookieModule.cpp',
     'nsCookiePermission.cpp',
     'nsPermission.cpp',
     'nsPermissionManager.cpp',
     'nsPopupWindowManager.cpp',
 ]
 
+LOCAL_INCLUDES += [
+    '/caps',
+]
+
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wno-error=shadow']
 
 with Files('**'):
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -1,9 +1,10 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 
 #include "mozilla/dom/ContentParent.h"
@@ -36,16 +37,17 @@
 #include "nsReadLine.h"
 #include "mozilla/Telemetry.h"
 #include "nsIConsoleService.h"
 #include "nsINavHistoryService.h"
 #include "nsToolkitCompsCID.h"
 #include "nsIObserverService.h"
 #include "nsPrintfCString.h"
 #include "mozilla/AbstractThread.h"
+#include "ContentPrincipal.h"
 
 static nsPermissionManager *gPermissionManager = nullptr;
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static bool
 IsChildProcess()
@@ -233,48 +235,62 @@ GetNextSubDomainForHost(const nsACString
   // subdomain.
   if (NS_FAILED(rv)) {
     return EmptyCString();
   }
 
   return subDomain;
 }
 
+// This function produces a nsIURI which is identical to the current
+// nsIURI, except that it has one less subdomain segment. It returns
+// `nullptr` if there are no more segments to remove.
+already_AddRefed<nsIURI>
+GetNextSubDomainURI(nsIURI* aURI)
+{
+  nsAutoCString host;
+  nsresult rv = aURI->GetHost(host);
+  if (NS_FAILED(rv)) {
+    return nullptr;
+  }
+
+  nsCString domain = GetNextSubDomainForHost(host);
+  if (domain.IsEmpty()) {
+    return nullptr;
+  }
+
+  nsCOMPtr<nsIURI> uri;
+  rv = aURI->Clone(getter_AddRefs(uri));
+  if (NS_FAILED(rv) || !uri) {
+    return nullptr;
+  }
+
+  rv = uri->SetHost(domain);
+  if (NS_FAILED(rv)) {
+    return nullptr;
+  }
+
+  return uri.forget();
+}
+
 // This function produces a nsIPrincipal which is identical to the current
 // nsIPrincipal, except that it has one less subdomain segment. It returns
 // `nullptr` if there are no more segments to remove.
 already_AddRefed<nsIPrincipal>
 GetNextSubDomainPrincipal(nsIPrincipal* aPrincipal)
 {
   nsCOMPtr<nsIURI> uri;
   nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri));
   if (NS_FAILED(rv) || !uri) {
     return nullptr;
   }
 
-  nsAutoCString host;
-  rv = uri->GetHost(host);
-  if (NS_FAILED(rv)) {
-    return nullptr;
-  }
-
-  nsCString domain = GetNextSubDomainForHost(host);
-  if (domain.IsEmpty()) {
-    return nullptr;
-  }
-
   // Create a new principal which is identical to the current one, but with the new host
-  nsCOMPtr<nsIURI> newURI;
-  rv = uri->Clone(getter_AddRefs(newURI));
-  if (NS_FAILED(rv)) {
-    return nullptr;
-  }
-
-  rv = newURI->SetHost(domain);
-  if (NS_FAILED(rv)) {
+  nsCOMPtr<nsIURI> newURI = GetNextSubDomainURI(uri);
+  if (!newURI) {
     return nullptr;
   }
 
   // Copy the attributes over
   mozilla::OriginAttributes attrs = aPrincipal->OriginAttributesRef();
 
   // Disable userContext and firstParty isolation for permissions.
   attrs.StripAttributes(mozilla::OriginAttributes::STRIP_USER_CONTEXT_ID |
@@ -706,16 +722,28 @@ nsPermissionManager::PermissionKey::Crea
   aResult = GetOriginFromPrincipal(aPrincipal, origin);
   if (NS_WARN_IF(NS_FAILED(aResult))) {
     return nullptr;
   }
 
   return new PermissionKey(origin);
 }
 
+nsPermissionManager::PermissionKey*
+nsPermissionManager::PermissionKey::CreateFromURI(nsIURI* aURI, nsresult& aResult)
+{
+  nsAutoCString origin;
+  aResult = ContentPrincipal::GenerateOriginNoSuffixFromURI(aURI, origin);
+  if (NS_WARN_IF(NS_FAILED(aResult))) {
+    return nullptr;
+  }
+
+  return new PermissionKey(origin);
+}
+
 /**
  * Simple callback used by |AsyncClose| to trigger a treatment once
  * the database is closed.
  *
  * Note: Beware that, if you hold onto a |CloseDatabaseListener| from a
  * |nsPermissionManager|, this will create a cycle.
  *
  * Note: Once the callback has been called this DeleteFromMozHostListener cannot
@@ -2064,21 +2092,17 @@ nsPermissionManager::RemoveAllInternal(b
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPermissionManager::TestExactPermission(nsIURI     *aURI,
                                          const char *aType,
                                          uint32_t   *aPermission)
 {
-  nsCOMPtr<nsIPrincipal> principal;
-  nsresult rv = GetPrincipal(aURI, getter_AddRefs(principal));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return TestExactPermissionFromPrincipal(principal, aType, aPermission);
+  return CommonTestPermission(aURI, aType, aPermission, true, true);
 }
 
 NS_IMETHODIMP
 nsPermissionManager::TestExactPermissionFromPrincipal(nsIPrincipal* aPrincipal,
                                                       const char* aType,
                                                       uint32_t* aPermission)
 {
   return CommonTestPermission(aPrincipal, aType, aPermission, true, true);
@@ -2092,21 +2116,17 @@ nsPermissionManager::TestExactPermanentP
   return CommonTestPermission(aPrincipal, aType, aPermission, true, false);
 }
 
 NS_IMETHODIMP
 nsPermissionManager::TestPermission(nsIURI     *aURI,
                                     const char *aType,
                                     uint32_t   *aPermission)
 {
-  nsCOMPtr<nsIPrincipal> principal;
-  nsresult rv = GetPrincipal(aURI, getter_AddRefs(principal));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return TestPermissionFromPrincipal(principal, aType, aPermission);
+  return CommonTestPermission(aURI, aType, aPermission, false, true);
 }
 
 NS_IMETHODIMP
 nsPermissionManager::TestPermissionFromWindow(mozIDOMWindow* aWindow,
                                               const char* aType,
                                               uint32_t* aPermission)
 {
   NS_ENSURE_ARG(aWindow);
@@ -2193,26 +2213,29 @@ nsPermissionManager::GetPermissionObject
   if (NS_WARN_IF(!r)) {
     return NS_ERROR_FAILURE;
   }
   r.forget(aResult);
   return NS_OK;
 }
 
 nsresult
-nsPermissionManager::CommonTestPermission(nsIPrincipal* aPrincipal,
-                                          const char *aType,
-                                          uint32_t   *aPermission,
-                                          bool        aExactHostMatch,
-                                          bool        aIncludingSession)
+nsPermissionManager::CommonTestPermissionInternal(nsIPrincipal* aPrincipal,
+                                                  nsIURI      * aURI,
+                                                  const char  * aType,
+                                                  uint32_t    * aPermission,
+                                                  bool          aExactHostMatch,
+                                                  bool          aIncludingSession)
 {
-  NS_ENSURE_ARG_POINTER(aPrincipal);
+  MOZ_ASSERT(aPrincipal || aURI);
+  MOZ_ASSERT_IF(aPrincipal, !aURI);
+  NS_ENSURE_ARG_POINTER(aPrincipal || aURI);
   NS_ENSURE_ARG_POINTER(aType);
 
-  if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
+  if (aPrincipal && nsContentUtils::IsSystemPrincipal(aPrincipal)) {
     *aPermission = nsIPermissionManager::ALLOW_ACTION;
     return NS_OK;
   }
 
   // Set the default.
   *aPermission = nsIPermissionManager::UNKNOWN_ACTION;
 
   // For expanded principals, we want to iterate over the whitelist and see
@@ -2220,39 +2243,49 @@ nsPermissionManager::CommonTestPermissio
   nsCOMPtr<nsIExpandedPrincipal> ep = do_QueryInterface(aPrincipal);
   if (ep) {
     nsTArray<nsCOMPtr<nsIPrincipal>>* whitelist;
     nsresult rv = ep->GetWhiteList(&whitelist);
     NS_ENSURE_SUCCESS(rv, rv);
 
     for (size_t i = 0; i < whitelist->Length(); ++i) {
       uint32_t perm;
-      rv = CommonTestPermission(whitelist->ElementAt(i), aType, &perm, aExactHostMatch,
-                                aIncludingSession);
+      rv = CommonTestPermission(whitelist->ElementAt(i), aType, &perm,
+                                aExactHostMatch, aIncludingSession);
       NS_ENSURE_SUCCESS(rv, rv);
       if (perm == nsIPermissionManager::ALLOW_ACTION) {
         *aPermission = perm;
         return NS_OK;
       } else if (perm == nsIPermissionManager::PROMPT_ACTION) {
         // Store it, but keep going to see if we can do better.
         *aPermission = perm;
       }
     }
 
     return NS_OK;
   }
 
-  MOZ_ASSERT(PermissionAvaliable(aPrincipal, aType));
+#ifdef DEBUG
+  {
+    nsCOMPtr<nsIPrincipal> prin = aPrincipal;
+    if (!prin) {
+      prin = mozilla::BasePrincipal::CreateCodebasePrincipal(aURI, OriginAttributes());
+    }
+    MOZ_ASSERT(PermissionAvaliable(prin, aType));
+  }
+#endif
 
   int32_t typeIndex = GetTypeIndex(aType, false);
   // If type == -1, the type isn't known,
   // so just return NS_OK
   if (typeIndex == -1) return NS_OK;
 
-  PermissionHashKey* entry = GetPermissionHashKey(aPrincipal, typeIndex, aExactHostMatch);
+  PermissionHashKey* entry = aPrincipal ?
+    GetPermissionHashKey(aPrincipal, typeIndex, aExactHostMatch) :
+    GetPermissionHashKey(aURI, typeIndex, aExactHostMatch);
   if (!entry ||
       (!aIncludingSession &&
        entry->GetPermission(typeIndex).mNonSessionExpireType ==
          nsIPermissionManager::EXPIRE_SESSION)) {
     return NS_OK;
   }
 
   *aPermission = aIncludingSession
@@ -2312,16 +2345,84 @@ nsPermissionManager::GetPermissionHashKe
       return GetPermissionHashKey(principal, aType, aExactHostMatch);
     }
   }
 
   // No entry, really...
   return nullptr;
 }
 
+// Returns PermissionHashKey for a given { host, appId, isInBrowserElement } tuple.
+// This is not simply using PermissionKey because we will walk-up domains in
+// case of |host| contains sub-domains.
+// Returns null if nothing found.
+// Also accepts host on the format "<foo>". This will perform an exact match
+// lookup as the string doesn't contain any dots.
+nsPermissionManager::PermissionHashKey*
+nsPermissionManager::GetPermissionHashKey(nsIURI* aURI,
+                                          uint32_t aType,
+                                          bool aExactHostMatch)
+{
+#ifdef DEBUG
+  {
+    nsCOMPtr<nsIPrincipal> principal;
+    nsresult rv = GetPrincipal(aURI, getter_AddRefs(principal));
+    MOZ_ASSERT_IF(NS_SUCCEEDED(rv),
+                  PermissionAvaliable(principal, mTypeArray[aType].get()));
+  }
+#endif
+
+  nsresult rv;
+  RefPtr<PermissionKey> key =
+    PermissionKey::CreateFromURI(aURI, rv);
+  if (!key) {
+    return nullptr;
+  }
+
+  PermissionHashKey* entry = mPermissionTable.GetEntry(key);
+
+  if (entry) {
+    PermissionEntry permEntry = entry->GetPermission(aType);
+
+    // if the entry is expired, remove and keep looking for others.
+    // Note that EXPIRE_SESSION only honors expireTime if it is nonzero.
+    if ((permEntry.mExpireType == nsIPermissionManager::EXPIRE_TIME ||
+         (permEntry.mExpireType == nsIPermissionManager::EXPIRE_SESSION &&
+          permEntry.mExpireTime != 0)) &&
+        permEntry.mExpireTime <= (PR_Now() / 1000)) {
+      entry = nullptr;
+      // If we need to remove a permission we mint a principal.  This is a bit
+      // inefficient, but hopefully this code path isn't super common.
+      nsCOMPtr<nsIPrincipal> principal;
+      nsresult rv = GetPrincipal(aURI, getter_AddRefs(principal));
+      if (NS_WARN_IF(NS_FAILED(rv))) {
+        return nullptr;
+      }
+      RemoveFromPrincipal(principal, mTypeArray[aType].get());
+    } else if (permEntry.mPermission == nsIPermissionManager::UNKNOWN_ACTION) {
+      entry = nullptr;
+    }
+  }
+
+  if (entry) {
+    return entry;
+  }
+
+  // If aExactHostMatch wasn't true, we can check if the base domain has a permission entry.
+  if (!aExactHostMatch) {
+    nsCOMPtr<nsIURI> uri = GetNextSubDomainURI(aURI);
+    if (uri) {
+      return GetPermissionHashKey(uri, aType, aExactHostMatch);
+    }
+  }
+
+  // No entry, really...
+  return nullptr;
+}
+
 NS_IMETHODIMP nsPermissionManager::GetEnumerator(nsISimpleEnumerator **aEnum)
 {
   if (XRE_IsContentProcess()) {
     NS_WARNING("nsPermissionManager's enumerator is not avaliable in the "
                "content process, as not all permissions may be avaliable.");
     *aEnum = nullptr;
     return NS_ERROR_NOT_AVAILABLE;
   }
--- a/extensions/cookie/nsPermissionManager.h
+++ b/extensions/cookie/nsPermissionManager.h
@@ -1,9 +1,10 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPermissionManager_h__
 #define nsPermissionManager_h__
 
 #include "nsIPermissionManager.h"
@@ -71,16 +72,18 @@ public:
    * NOTE: It could be implementing nsIHashable but there is no reason to worry
    * with XPCOM interfaces while we don't need to.
    */
   class PermissionKey
   {
   public:
     static PermissionKey* CreateFromPrincipal(nsIPrincipal* aPrincipal,
                                               nsresult& aResult);
+    static PermissionKey* CreateFromURI(nsIURI* aURI,
+                                        nsresult& aResult);
 
     explicit PermissionKey(const nsACString& aOrigin)
       : mOrigin(aOrigin)
     {
     }
 
     bool operator==(const PermissionKey& aKey) const {
       return mOrigin.Equals(aKey.mOrigin);
@@ -268,22 +271,46 @@ private:
   virtual ~nsPermissionManager();
 
   int32_t GetTypeIndex(const char *aTypeString,
                        bool        aAdd);
 
   PermissionHashKey* GetPermissionHashKey(nsIPrincipal* aPrincipal,
                                           uint32_t      aType,
                                           bool          aExactHostMatch);
+  PermissionHashKey* GetPermissionHashKey(nsIURI*       aURI,
+                                          uint32_t      aType,
+                                          bool          aExactHostMatch);
 
   nsresult CommonTestPermission(nsIPrincipal* aPrincipal,
-                                const char *aType,
-                                uint32_t   *aPermission,
+                                const char  * aType,
+                                uint32_t    * aPermission,
+                                bool          aExactHostMatch,
+                                bool          aIncludingSession)
+  {
+    return CommonTestPermissionInternal(aPrincipal, nullptr, aType,
+                                        aPermission, aExactHostMatch,
+                                        aIncludingSession);
+  }
+  nsresult CommonTestPermission(nsIURI    * aURI,
+                                const char* aType,
+                                uint32_t  * aPermission,
                                 bool        aExactHostMatch,
-                                bool        aIncludingSession);
+                                bool        aIncludingSession)
+  {
+    return CommonTestPermissionInternal(nullptr, aURI, aType, aPermission,
+                                        aExactHostMatch, aIncludingSession);
+  }
+  // Only one of aPrincipal or aURI is allowed to be passed in.
+  nsresult CommonTestPermissionInternal(nsIPrincipal* aPrincipal,
+                                        nsIURI      * aURI,
+                                        const char  * aType,
+                                        uint32_t    * aPermission,
+                                        bool          aExactHostMatch,
+                                        bool          aIncludingSession);
 
   nsresult OpenDatabase(nsIFile* permissionsFile);
   nsresult InitDB(bool aRemoveFile);
   nsresult CreateTable();
   nsresult Import();
   nsresult ImportDefaults();
   nsresult _DoImport(nsIInputStream *inputStream, mozIStorageConnection *aConn);
   nsresult Read();
deleted file mode 100755
--- a/gfx/layers/d3d11/CompositorD3D11Shaders.h
+++ /dev/null
@@ -1,12597 +0,0 @@
-struct ShaderBytes { const void* mData; size_t mLength; };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4x4 mLayerTransform;          // Offset:    0 Size:    64
-//   float4x4 mProjection;              // Offset:   64 Size:    64
-//   float4 vRenderTargetOffset;        // Offset:  128 Size:    16
-//   float4 vTextureCoords;             // Offset:  144 Size:    16
-//   float4 vLayerQuad;                 // Offset:  160 Size:    16
-//   float4x4 mMaskTransform;           // Offset:  176 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  240 Size:    64 [unused]
-//   float4 fLayerColor;                // Offset:  304 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:  320 Size:     4 [unused]
-//   uint4 iBlendConfig;                // Offset:  336 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:  352 Size:    44 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// POSITION                 0   xy          0     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float   xyzw
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c1         cb0             0         2  ( FLT, FLT, FLT, FLT)
-// c3         cb0             3         8  ( FLT, FLT, FLT, FLT)
-//
-//
-// Runtime generated constant mappings:
-//
-// Target Reg                               Constant Description
-// ---------- --------------------------------------------------
-// c0                              Vertex Shader position offset
-//
-//
-// Level9 shader bytecode:
-//
-    vs_2_x
-    dcl_texcoord v0
-    mad oT0.xy, v0, c9.zwzw, c9
-    mad r0.xy, v0, c10.zwzw, c10
-    mul r1, r0.y, c2
-    mad r0, c1, r0.x, r1
-    add r0, r0, c3
-    rcp r1.x, r0.w
-    mul r0.xyz, r0, r1.x
-    add r0, r0, -c8
-    mul r0.xyz, r0.w, r0
-    mul r1, r0.y, c5
-    mad r1, c4, r0.x, r1
-    mad r1, c6, r0.z, r1
-    mad r0, c7, r0.w, r1
-    mad oPos.xy, r0.w, c0, r0
-    mov oPos.zw, r0
-
-// approximately 15 instruction slots used
-vs_4_0
-dcl_constantbuffer CB0[11], immediateIndexed
-dcl_input v0.xy
-dcl_output_siv o0.xyzw, position
-dcl_output o1.xy
-dcl_temps 2
-mad r0.xy, v0.xyxx, cb0[10].zwzz, cb0[10].xyxx
-mul r1.xyzw, r0.yyyy, cb0[1].xyzw
-mad r0.xyzw, cb0[0].xyzw, r0.xxxx, r1.xyzw
-add r0.xyzw, r0.xyzw, cb0[3].xyzw
-div r0.xyz, r0.xyzx, r0.wwww
-add r0.xyzw, r0.xyzw, -cb0[8].xyzw
-mul r0.xyz, r0.wwww, r0.xyzx
-mul r1.xyzw, r0.yyyy, cb0[5].xyzw
-mad r1.xyzw, cb0[4].xyzw, r0.xxxx, r1.xyzw
-mad r1.xyzw, cb0[6].xyzw, r0.zzzz, r1.xyzw
-mad o0.xyzw, cb0[7].xyzw, r0.wwww, r1.xyzw
-mad o1.xy, v0.xyxx, cb0[9].zwzz, cb0[9].xyxx
-ret 
-// Approximately 13 instruction slots used
-#endif
-
-const BYTE LayerQuadVS[] =
-{
-     68,  88,  66,  67, 158, 249, 
-    155,   4, 180, 205,  12, 198, 
-     13, 145, 179,  10, 107, 120, 
-    251,  61,   1,   0,   0,   0, 
-     72,   7,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    152,   1,   0,   0, 160,   3, 
-      0,   0,  28,   4,   0,   0, 
-    188,   6,   0,   0, 240,   6, 
-      0,   0,  65, 111, 110,  57, 
-     88,   1,   0,   0,  88,   1, 
-      0,   0,   0,   2, 254, 255, 
-     24,   1,   0,   0,  64,   0, 
-      0,   0,   2,   0,  36,   0, 
-      0,   0,  60,   0,   0,   0, 
-     60,   0,   0,   0,  36,   0, 
-      1,   0,  60,   0,   0,   0, 
-      0,   0,   2,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   8,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   2, 254, 255, 
-     31,   0,   0,   2,   5,   0, 
-      0, 128,   0,   0,  15, 144, 
-      4,   0,   0,   4,   0,   0, 
-      3, 224,   0,   0, 228, 144, 
-      9,   0, 238, 160,   9,   0, 
-    228, 160,   4,   0,   0,   4, 
-      0,   0,   3, 128,   0,   0, 
-    228, 144,  10,   0, 238, 160, 
-     10,   0, 228, 160,   5,   0, 
-      0,   3,   1,   0,  15, 128, 
-      0,   0,  85, 128,   2,   0, 
-    228, 160,   4,   0,   0,   4, 
-      0,   0,  15, 128,   1,   0, 
-    228, 160,   0,   0,   0, 128, 
-      1,   0, 228, 128,   2,   0, 
-      0,   3,   0,   0,  15, 128, 
-      0,   0, 228, 128,   3,   0, 
-    228, 160,   6,   0,   0,   2, 
-      1,   0,   1, 128,   0,   0, 
-    255, 128,   5,   0,   0,   3, 
-      0,   0,   7, 128,   0,   0, 
-    228, 128,   1,   0,   0, 128, 
-      2,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      8,   0, 228, 161,   5,   0, 
-      0,   3,   0,   0,   7, 128, 
-      0,   0, 255, 128,   0,   0, 
-    228, 128,   5,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-     85, 128,   5,   0, 228, 160, 
-      4,   0,   0,   4,   1,   0, 
-     15, 128,   4,   0, 228, 160, 
-      0,   0,   0, 128,   1,   0, 
-    228, 128,   4,   0,   0,   4, 
-      1,   0,  15, 128,   6,   0, 
-    228, 160,   0,   0, 170, 128, 
-      1,   0, 228, 128,   4,   0, 
-      0,   4,   0,   0,  15, 128, 
-      7,   0, 228, 160,   0,   0, 
-    255, 128,   1,   0, 228, 128, 
-      4,   0,   0,   4,   0,   0, 
-      3, 192,   0,   0, 255, 128, 
-      0,   0, 228, 160,   0,   0, 
-    228, 128,   1,   0,   0,   2, 
-      0,   0,  12, 192,   0,   0, 
-    228, 128, 255, 255,   0,   0, 
-     83,  72,  68,  82,   0,   2, 
-      0,   0,  64,   0,   1,   0, 
-    128,   0,   0,   0,  89,   0, 
-      0,   4,  70, 142,  32,   0, 
-      0,   0,   0,   0,  11,   0, 
-      0,   0,  95,   0,   0,   3, 
-     50,  16,  16,   0,   0,   0, 
-      0,   0, 103,   0,   0,   4, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3,  50,  32, 
-     16,   0,   1,   0,   0,   0, 
-    104,   0,   0,   2,   2,   0, 
-      0,   0,  50,   0,   0,  11, 
-     50,   0,  16,   0,   0,   0, 
-      0,   0,  70,  16,  16,   0, 
-      0,   0,   0,   0, 230, 138, 
-     32,   0,   0,   0,   0,   0, 
-     10,   0,   0,   0,  70, 128, 
-     32,   0,   0,   0,   0,   0, 
-     10,   0,   0,   0,  56,   0, 
-      0,   8, 242,   0,  16,   0, 
-      1,   0,   0,   0,  86,   5, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     50,   0,   0,  10, 242,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      6,   0,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   8, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-     14,   0,   0,   7, 114,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,   2,  16,   0,   0,   0, 
-      0,   0, 246,  15,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   9, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32, 128,  65,   0, 
-      0,   0,   0,   0,   0,   0, 
-      8,   0,   0,   0,  56,   0, 
-      0,   7, 114,   0,  16,   0, 
-      0,   0,   0,   0, 246,  15, 
-     16,   0,   0,   0,   0,   0, 
-     70,   2,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  86,   5,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      5,   0,   0,   0,  50,   0, 
-      0,  10, 242,   0,  16,   0, 
-      1,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   6,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,  50,   0,   0,  10, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  70, 142,  32,   0, 
-      0,   0,   0,   0,   6,   0, 
-      0,   0, 166,  10,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   1,   0,   0,   0, 
-     50,   0,   0,  10, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   7,   0,   0,   0, 
-    246,  15,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      1,   0,   0,   0,  50,   0, 
-      0,  11,  50,  32,  16,   0, 
-      1,   0,   0,   0,  70,  16, 
-     16,   0,   0,   0,   0,   0, 
-    230, 138,  32,   0,   0,   0, 
-      0,   0,   9,   0,   0,   0, 
-     70, 128,  32,   0,   0,   0, 
-      0,   0,   9,   0,   0,   0, 
-     62,   0,   0,   1,  83,  84, 
-     65,  84, 116,   0,   0,   0, 
-     13,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,  12,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  82,  68,  69,  70, 
-    152,   2,   0,   0,   1,   0, 
-      0,   0,  72,   0,   0,   0, 
-      1,   0,   0,   0,  28,   0, 
-      0,   0,   0,   4, 254, 255, 
-      0,   1,   0,   0, 112,   2, 
-      0,   0,  60,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,  36,  71, 
-    108, 111,  98,  97, 108, 115, 
-      0, 171, 171, 171,  60,   0, 
-      0,   0,  11,   0,   0,   0, 
-     96,   0,   0,   0, 144,   1, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 104,   1, 
-      0,   0,   0,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 136,   1, 
-      0,   0,  64,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 148,   1, 
-      0,   0, 128,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0, 184,   1, 
-      0,   0, 144,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 216,   1, 
-      0,   0, 160,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 227,   1, 
-      0,   0, 176,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 242,   1, 
-      0,   0, 240,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0,   5,   2, 
-      0,   0,  48,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0,  17,   2, 
-      0,   0,  64,   1,   0,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,  32,   2,   0,   0, 
-      0,   0,   0,   0,  48,   2, 
-      0,   0,  80,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,  64,   2,   0,   0, 
-      0,   0,   0,   0,  80,   2, 
-      0,   0,  96,   1,   0,   0, 
-     44,   0,   0,   0,   0,   0, 
-      0,   0,  96,   2,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  84, 101, 120, 116, 117, 
-    114, 101,  67, 111, 111, 114, 
-    100, 115,   0, 171,   1,   0, 
-      3,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 118,  76,  97, 121, 
-    101, 114,  81, 117,  97, 100, 
-      0, 109,  77,  97, 115, 107, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0, 109,  66, 
-     97,  99, 107, 100, 114, 111, 
-    112,  84, 114,  97, 110, 115, 
-    102, 111, 114, 109,   0, 102, 
-     76,  97, 121, 101, 114,  67, 
-    111, 108, 111, 114,   0, 102, 
-     76,  97, 121, 101, 114,  79, 
-    112,  97,  99, 105, 116, 121, 
-      0, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  77, 105, 
-     99, 114, 111, 115, 111, 102, 
-    116,  32,  40,  82,  41,  32, 
-     72,  76,  83,  76,  32,  83, 
-    104,  97, 100, 101, 114,  32, 
-     67, 111, 109, 112, 105, 108, 
-    101, 114,  32,  49,  48,  46, 
-     49,   0,  73,  83,  71,  78, 
-     44,   0,   0,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   3,   3,   0,   0, 
-     80,  79,  83,  73,  84,  73, 
-     79,  78,   0, 171, 171, 171, 
-     79,  83,  71,  78,  80,   0, 
-      0,   0,   2,   0,   0,   0, 
-      8,   0,   0,   0,  56,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  68,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,  12,   0,   0,  83,  86, 
-     95,  80, 111, 115, 105, 116, 
-    105, 111, 110,   0,  84,  69, 
-     88,  67,  79,  79,  82,  68, 
-      0, 171, 171, 171
-};
-ShaderBytes sLayerQuadVS = { LayerQuadVS, sizeof(LayerQuadVS) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4x4 mLayerTransform;          // Offset:    0 Size:    64
-//   float4x4 mProjection;              // Offset:   64 Size:    64
-//   float4 vRenderTargetOffset;        // Offset:  128 Size:    16
-//   float4 vTextureCoords;             // Offset:  144 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  160 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  176 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  240 Size:    64 [unused]
-//   float4 fLayerColor;                // Offset:  304 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:  320 Size:     4 [unused]
-//   uint4 iBlendConfig;                // Offset:  336 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:  352 Size:    44 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// POSITION                 0   xy          0     NONE   float   xy  
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float   xyzw
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c1         cb0             0         2  ( FLT, FLT, FLT, FLT)
-// c3         cb0             3         6  ( FLT, FLT, FLT, FLT)
-//
-//
-// Runtime generated constant mappings:
-//
-// Target Reg                               Constant Description
-// ---------- --------------------------------------------------
-// c0                              Vertex Shader position offset
-//
-//
-// Level9 shader bytecode:
-//
-    vs_2_x
-    dcl_texcoord v0
-    dcl_texcoord1 v1
-    mul r0, v0.y, c2
-    mad r0, c1, v0.x, r0
-    add r0, r0, c3
-    rcp r1.x, r0.w
-    mul r0.xyz, r0, r1.x
-    add r0, r0, -c8
-    mul r0.xyz, r0.w, r0
-    mul r1, r0.y, c5
-    mad r1, c4, r0.x, r1
-    mad r1, c6, r0.z, r1
-    mad r0, c7, r0.w, r1
-    mad oPos.xy, r0.w, c0, r0
-    mov oPos.zw, r0
-    mov oT0.xy, v1
-
-// approximately 14 instruction slots used
-vs_4_0
-dcl_constantbuffer CB0[9], immediateIndexed
-dcl_input v0.xy
-dcl_input v1.xy
-dcl_output_siv o0.xyzw, position
-dcl_output o1.xy
-dcl_temps 2
-mul r0.xyzw, v0.yyyy, cb0[1].xyzw
-mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw
-add r0.xyzw, r0.xyzw, cb0[3].xyzw
-div r0.xyz, r0.xyzx, r0.wwww
-add r0.xyzw, r0.xyzw, -cb0[8].xyzw
-mul r0.xyz, r0.wwww, r0.xyzx
-mul r1.xyzw, r0.yyyy, cb0[5].xyzw
-mad r1.xyzw, cb0[4].xyzw, r0.xxxx, r1.xyzw
-mad r1.xyzw, cb0[6].xyzw, r0.zzzz, r1.xyzw
-mad o0.xyzw, cb0[7].xyzw, r0.wwww, r1.xyzw
-mov o1.xy, v1.xyxx
-ret 
-// Approximately 12 instruction slots used
-#endif
-
-const BYTE LayerDynamicVS[] =
-{
-     68,  88,  66,  67,  11,  85, 
-      4, 119,  93, 228, 195, 201, 
-     22,  72, 173, 198,  47,  25, 
-    227, 199,   1,   0,   0,   0, 
-     32,   7,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    136,   1,   0,   0,  88,   3, 
-      0,   0, 212,   3,   0,   0, 
-    116,   6,   0,   0, 200,   6, 
-      0,   0,  65, 111, 110,  57, 
-     72,   1,   0,   0,  72,   1, 
-      0,   0,   0,   2, 254, 255, 
-      8,   1,   0,   0,  64,   0, 
-      0,   0,   2,   0,  36,   0, 
-      0,   0,  60,   0,   0,   0, 
-     60,   0,   0,   0,  36,   0, 
-      1,   0,  60,   0,   0,   0, 
-      0,   0,   2,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   6,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   2, 254, 255, 
-     31,   0,   0,   2,   5,   0, 
-      0, 128,   0,   0,  15, 144, 
-     31,   0,   0,   2,   5,   0, 
-      1, 128,   1,   0,  15, 144, 
-      5,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0,  85, 144, 
-      2,   0, 228, 160,   4,   0, 
-      0,   4,   0,   0,  15, 128, 
-      1,   0, 228, 160,   0,   0, 
-      0, 144,   0,   0, 228, 128, 
-      2,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      3,   0, 228, 160,   6,   0, 
-      0,   2,   1,   0,   1, 128, 
-      0,   0, 255, 128,   5,   0, 
-      0,   3,   0,   0,   7, 128, 
-      0,   0, 228, 128,   1,   0, 
-      0, 128,   2,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-    228, 128,   8,   0, 228, 161, 
-      5,   0,   0,   3,   0,   0, 
-      7, 128,   0,   0, 255, 128, 
-      0,   0, 228, 128,   5,   0, 
-      0,   3,   1,   0,  15, 128, 
-      0,   0,  85, 128,   5,   0, 
-    228, 160,   4,   0,   0,   4, 
-      1,   0,  15, 128,   4,   0, 
-    228, 160,   0,   0,   0, 128, 
-      1,   0, 228, 128,   4,   0, 
-      0,   4,   1,   0,  15, 128, 
-      6,   0, 228, 160,   0,   0, 
-    170, 128,   1,   0, 228, 128, 
-      4,   0,   0,   4,   0,   0, 
-     15, 128,   7,   0, 228, 160, 
-      0,   0, 255, 128,   1,   0, 
-    228, 128,   4,   0,   0,   4, 
-      0,   0,   3, 192,   0,   0, 
-    255, 128,   0,   0, 228, 160, 
-      0,   0, 228, 128,   1,   0, 
-      0,   2,   0,   0,  12, 192, 
-      0,   0, 228, 128,   1,   0, 
-      0,   2,   0,   0,   3, 224, 
-      1,   0, 228, 144, 255, 255, 
-      0,   0,  83,  72,  68,  82, 
-    200,   1,   0,   0,  64,   0, 
-      1,   0, 114,   0,   0,   0, 
-     89,   0,   0,   4,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      9,   0,   0,   0,  95,   0, 
-      0,   3,  50,  16,  16,   0, 
-      0,   0,   0,   0,  95,   0, 
-      0,   3,  50,  16,  16,   0, 
-      1,   0,   0,   0, 103,   0, 
-      0,   4, 242,  32,  16,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0, 101,   0,   0,   3, 
-     50,  32,  16,   0,   1,   0, 
-      0,   0, 104,   0,   0,   2, 
-      2,   0,   0,   0,  56,   0, 
-      0,   8, 242,   0,  16,   0, 
-      0,   0,   0,   0,  86,  21, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     50,   0,   0,  10, 242,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      6,  16,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   8, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-     14,   0,   0,   7, 114,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,   2,  16,   0,   0,   0, 
-      0,   0, 246,  15,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   9, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32, 128,  65,   0, 
-      0,   0,   0,   0,   0,   0, 
-      8,   0,   0,   0,  56,   0, 
-      0,   7, 114,   0,  16,   0, 
-      0,   0,   0,   0, 246,  15, 
-     16,   0,   0,   0,   0,   0, 
-     70,   2,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  86,   5,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      5,   0,   0,   0,  50,   0, 
-      0,  10, 242,   0,  16,   0, 
-      1,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   6,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,  50,   0,   0,  10, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  70, 142,  32,   0, 
-      0,   0,   0,   0,   6,   0, 
-      0,   0, 166,  10,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   1,   0,   0,   0, 
-     50,   0,   0,  10, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   7,   0,   0,   0, 
-    246,  15,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      1,   0,   0,   0,  54,   0, 
-      0,   5,  50,  32,  16,   0, 
-      1,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     62,   0,   0,   1,  83,  84, 
-     65,  84, 116,   0,   0,   0, 
-     12,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,  10,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  82,  68,  69,  70, 
-    152,   2,   0,   0,   1,   0, 
-      0,   0,  72,   0,   0,   0, 
-      1,   0,   0,   0,  28,   0, 
-      0,   0,   0,   4, 254, 255, 
-      0,   1,   0,   0, 112,   2, 
-      0,   0,  60,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,  36,  71, 
-    108, 111,  98,  97, 108, 115, 
-      0, 171, 171, 171,  60,   0, 
-      0,   0,  11,   0,   0,   0, 
-     96,   0,   0,   0, 144,   1, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 104,   1, 
-      0,   0,   0,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 136,   1, 
-      0,   0,  64,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 148,   1, 
-      0,   0, 128,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0, 184,   1, 
-      0,   0, 144,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 216,   1, 
-      0,   0, 160,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 227,   1, 
-      0,   0, 176,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 242,   1, 
-      0,   0, 240,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0,   5,   2, 
-      0,   0,  48,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0,  17,   2, 
-      0,   0,  64,   1,   0,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,  32,   2,   0,   0, 
-      0,   0,   0,   0,  48,   2, 
-      0,   0,  80,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,  64,   2,   0,   0, 
-      0,   0,   0,   0,  80,   2, 
-      0,   0,  96,   1,   0,   0, 
-     44,   0,   0,   0,   0,   0, 
-      0,   0,  96,   2,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  84, 101, 120, 116, 117, 
-    114, 101,  67, 111, 111, 114, 
-    100, 115,   0, 171,   1,   0, 
-      3,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 118,  76,  97, 121, 
-    101, 114,  81, 117,  97, 100, 
-      0, 109,  77,  97, 115, 107, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0, 109,  66, 
-     97,  99, 107, 100, 114, 111, 
-    112,  84, 114,  97, 110, 115, 
-    102, 111, 114, 109,   0, 102, 
-     76,  97, 121, 101, 114,  67, 
-    111, 108, 111, 114,   0, 102, 
-     76,  97, 121, 101, 114,  79, 
-    112,  97,  99, 105, 116, 121, 
-      0, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  77, 105, 
-     99, 114, 111, 115, 111, 102, 
-    116,  32,  40,  82,  41,  32, 
-     72,  76,  83,  76,  32,  83, 
-    104,  97, 100, 101, 114,  32, 
-     67, 111, 109, 112, 105, 108, 
-    101, 114,  32,  49,  48,  46, 
-     49,   0,  73,  83,  71,  78, 
-     76,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   3,   3,   0,   0, 
-     65,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     80,  79,  83,  73,  84,  73, 
-     79,  78,   0,  84,  69,  88, 
-     67,  79,  79,  82,  68,   0, 
-    171, 171,  79,  83,  71,  78, 
-     80,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     68,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,  12,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171
-};
-ShaderBytes sLayerDynamicVS = { LayerDynamicVS, sizeof(LayerDynamicVS) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16
-//   float fLayerOpacity;               // Offset:   16 Size:     4 [unused]
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float       
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             0         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    mov oC0, c0
-
-// approximately 1 instruction slot used
-ps_4_0
-dcl_constantbuffer CB0[1], immediateIndexed
-dcl_output o0.xyzw
-mov o0.xyzw, cb0[0].xyzw
-ret 
-// Approximately 2 instruction slots used
-#endif
-
-const BYTE SolidColorShader[] =
-{
-     68,  88,  66,  67,  31,  16, 
-     81, 179, 243, 141, 148, 255, 
-     60,  11,  92, 171,  28,  14, 
-    237, 203,   1,   0,   0,   0, 
-    120,   4,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    132,   0,   0,   0, 204,   0, 
-      0,   0,  72,   1,   0,   0, 
-    236,   3,   0,   0,  68,   4, 
-      0,   0,  65, 111, 110,  57, 
-     68,   0,   0,   0,  68,   0, 
-      0,   0,   0,   2, 255, 255, 
-     20,   0,   0,   0,  48,   0, 
-      0,   0,   1,   0,  36,   0, 
-      0,   0,  48,   0,   0,   0, 
-     48,   0,   0,   0,  36,   0, 
-      0,   0,  48,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   1,   2, 
-    255, 255,   1,   0,   0,   2, 
-      0,   8,  15, 128,   0,   0, 
-    228, 160, 255, 255,   0,   0, 
-     83,  72,  68,  82,  64,   0, 
-      0,   0,  64,   0,   0,   0, 
-     16,   0,   0,   0,  89,   0, 
-      0,   4,  70, 142,  32,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,  54,   0,   0,   6, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,  70, 142,  32,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  62,   0,   0,   1, 
-     83,  84,  65,  84, 116,   0, 
-      0,   0,   2,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  82,  68, 
-     69,  70, 156,   2,   0,   0, 
-      1,   0,   0,   0,  72,   0, 
-      0,   0,   1,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    255, 255,   0,   1,   0,   0, 
-    113,   2,   0,   0,  60,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-     36,  71, 108, 111,  98,  97, 
-    108, 115,   0, 171, 171, 171, 
-     60,   0,   0,   0,  11,   0, 
-      0,   0,  96,   0,   0,   0, 
-    144,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   1,   0,   0,   0,   0, 
-      0,   0,  16,   0,   0,   0, 
-      2,   0,   0,   0, 116,   1, 
-      0,   0,   0,   0,   0,   0, 
-    132,   1,   0,   0,  16,   0, 
-      0,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0, 148,   1, 
-      0,   0,   0,   0,   0,   0, 
-    164,   1,   0,   0,  32,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 180,   1, 
-      0,   0,   0,   0,   0,   0, 
-    196,   1,   0,   0,  48,   0, 
-      0,   0,  44,   0,   0,   0, 
-      0,   0,   0,   0, 212,   1, 
-      0,   0,   0,   0,   0,   0, 
-    228,   1,   0,   0,  96,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 244,   1, 
-      0,   0,   0,   0,   0,   0, 
-      4,   2,   0,   0, 160,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 244,   1, 
-      0,   0,   0,   0,   0,   0, 
-     16,   2,   0,   0, 224,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 116,   1, 
-      0,   0,   0,   0,   0,   0, 
-     36,   2,   0,   0, 240,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  52,   2, 
-      0,   0,   0,   0,   0,   0, 
-     68,   2,   0,   0,   0,   1, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  52,   2, 
-      0,   0,   0,   0,   0,   0, 
-     79,   2,   0,   0,  16,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 244,   1, 
-      0,   0,   0,   0,   0,   0, 
-     94,   2,   0,   0,  80,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 244,   1, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     67, 111, 108, 111, 114,   0, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  79, 112, 
-     97,  99, 105, 116, 121,   0, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0, 118,  84, 101, 120, 
-    116, 117, 114, 101,  67, 111, 
-    111, 114, 100, 115,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 118,  76, 
-     97, 121, 101, 114,  81, 117, 
-     97, 100,   0, 109,  77,  97, 
-    115, 107,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-    109,  66,  97,  99, 107, 100, 
-    114, 111, 112,  84, 114,  97, 
-    110, 115, 102, 111, 114, 109, 
-      0,  77, 105,  99, 114, 111, 
-    115, 111, 102, 116,  32,  40, 
-     82,  41,  32,  72,  76,  83, 
-     76,  32,  83, 104,  97, 100, 
-    101, 114,  32,  67, 111, 109, 
-    112, 105, 108, 101, 114,  32, 
-     49,  48,  46,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-     80,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     68,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   0,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171, 
-     79,  83,  71,  78,  44,   0, 
-      0,   0,   1,   0,   0,   0, 
-      8,   0,   0,   0,  32,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  83,  86, 
-     95,  84,  97, 114, 103, 101, 
-    116,   0, 171, 171
-};
-ShaderBytes sSolidColorShader = { SolidColorShader, sizeof(SolidColorShader) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tRGB                              texture  float4          2d             t0      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t0               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    dcl t0.xy
-    dcl_2d s0
-    texld r0, t0, s0
-    mul r0.xyz, r0, c0.x
-    mov r0.w, c0.x
-    mov oC0, r0
-
-// approximately 4 instruction slots used (1 texture, 3 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[2], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t0
-dcl_input_ps linear v1.xy
-dcl_output o0.xyzw
-dcl_temps 1
-sample r0.xyzw, v1.xyxx, t0.xyzw, s0
-mul o0.xyz, r0.xyzx, cb0[1].xxxx
-mov o0.w, cb0[1].x
-ret 
-// Approximately 4 instruction slots used
-#endif
-
-const BYTE RGBShader[] =
-{
-     68,  88,  66,  67,  26, 170, 
-     86, 163,  31,  89, 148,  91, 
-    161,  88, 174, 193, 214,  13, 
-    132, 225,   1,   0,   0,   0, 
-    128,   5,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    204,   0,   0,   0, 136,   1, 
-      0,   0,   4,   2,   0,   0, 
-    244,   4,   0,   0,  76,   5, 
-      0,   0,  65, 111, 110,  57, 
-    140,   0,   0,   0, 140,   0, 
-      0,   0,   0,   2, 255, 255, 
-     88,   0,   0,   0,  52,   0, 
-      0,   0,   1,   0,  40,   0, 
-      0,   0,  52,   0,   0,   0, 
-     52,   0,   1,   0,  36,   0, 
-      0,   0,  52,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   1,   2, 255, 255, 
-     31,   0,   0,   2,   0,   0, 
-      0, 128,   0,   0,   3, 176, 
-     31,   0,   0,   2,   0,   0, 
-      0, 144,   0,   8,  15, 160, 
-     66,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 176, 
-      0,   8, 228, 160,   5,   0, 
-      0,   3,   0,   0,   7, 128, 
-      0,   0, 228, 128,   0,   0, 
-      0, 160,   1,   0,   0,   2, 
-      0,   0,   8, 128,   0,   0, 
-      0, 160,   1,   0,   0,   2, 
-      0,   8,  15, 128,   0,   0, 
-    228, 128, 255, 255,   0,   0, 
-     83,  72,  68,  82, 180,   0, 
-      0,   0,  64,   0,   0,   0, 
-     45,   0,   0,   0,  89,   0, 
-      0,   4,  70, 142,  32,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,  90,   0,   0,   3, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   0,   0, 
-      0,   0,  85,  85,   0,   0, 
-     98,  16,   0,   3,  50,  16, 
-     16,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-    104,   0,   0,   2,   1,   0, 
-      0,   0,  69,   0,   0,   9, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   0,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   8, 
-    114,  32,  16,   0,   0,   0, 
-      0,   0,  70,   2,  16,   0, 
-      0,   0,   0,   0,   6, 128, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  54,   0, 
-      0,   6, 130,  32,  16,   0, 
-      0,   0,   0,   0,  10, 128, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  62,   0, 
-      0,   1,  83,  84,  65,  84, 
-    116,   0,   0,   0,   4,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     82,  68,  69,  70, 232,   2, 
-      0,   0,   1,   0,   0,   0, 
-    148,   0,   0,   0,   3,   0, 
-      0,   0,  28,   0,   0,   0, 
-      0,   4, 255, 255,   0,   1, 
-      0,   0, 189,   2,   0,   0, 
-    124,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0, 133,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 138,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-    115,  83,  97, 109, 112, 108, 
-    101, 114,   0, 116,  82,  71, 
-     66,   0,  36,  71, 108, 111, 
-     98,  97, 108, 115,   0, 171, 
-    138,   0,   0,   0,  11,   0, 
-      0,   0, 172,   0,   0,   0, 
-    144,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    180,   1,   0,   0,   0,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 192,   1, 
-      0,   0,   0,   0,   0,   0, 
-    208,   1,   0,   0,  16,   0, 
-      0,   0,   4,   0,   0,   0, 
-      2,   0,   0,   0, 224,   1, 
-      0,   0,   0,   0,   0,   0, 
-    240,   1,   0,   0,  32,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   2, 
-      0,   0,   0,   0,   0,   0, 
-     16,   2,   0,   0,  48,   0, 
-      0,   0,  44,   0,   0,   0, 
-      0,   0,   0,   0,  32,   2, 
-      0,   0,   0,   0,   0,   0, 
-     48,   2,   0,   0,  96,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-     80,   2,   0,   0, 160,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-     92,   2,   0,   0, 224,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 192,   1, 
-      0,   0,   0,   0,   0,   0, 
-    112,   2,   0,   0, 240,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 128,   2, 
-      0,   0,   0,   0,   0,   0, 
-    144,   2,   0,   0,   0,   1, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 128,   2, 
-      0,   0,   0,   0,   0,   0, 
-    155,   2,   0,   0,  16,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-    170,   2,   0,   0,  80,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     67, 111, 108, 111, 114,   0, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  79, 112, 
-     97,  99, 105, 116, 121,   0, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0, 118,  84, 101, 120, 
-    116, 117, 114, 101,  67, 111, 
-    111, 114, 100, 115,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 118,  76, 
-     97, 121, 101, 114,  81, 117, 
-     97, 100,   0, 109,  77,  97, 
-    115, 107,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-    109,  66,  97,  99, 107, 100, 
-    114, 111, 112,  84, 114,  97, 
-    110, 115, 102, 111, 114, 109, 
-      0,  77, 105,  99, 114, 111, 
-    115, 111, 102, 116,  32,  40, 
-     82,  41,  32,  72,  76,  83, 
-     76,  32,  83, 104,  97, 100, 
-    101, 114,  32,  67, 111, 109, 
-    112, 105, 108, 101, 114,  32, 
-     49,  48,  46,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-     80,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     68,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171, 
-     79,  83,  71,  78,  44,   0, 
-      0,   0,   1,   0,   0,   0, 
-      8,   0,   0,   0,  32,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  83,  86, 
-     95,  84,  97, 114, 103, 101, 
-    116,   0, 171, 171
-};
-ShaderBytes sRGBShader = { RGBShader, sizeof(RGBShader) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tRGB                              texture  float4          2d             t0      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t0               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    dcl t0.xy
-    dcl_2d s0
-    texld r0, t0, s0
-    mul r0, r0, c0.x
-    mov oC0, r0
-
-// approximately 3 instruction slots used (1 texture, 2 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[2], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t0
-dcl_input_ps linear v1.xy
-dcl_output o0.xyzw
-dcl_temps 1
-sample r0.xyzw, v1.xyxx, t0.xyzw, s0
-mul o0.xyzw, r0.xyzw, cb0[1].xxxx
-ret 
-// Approximately 3 instruction slots used
-#endif
-
-const BYTE RGBAShader[] =
-{
-     68,  88,  66,  67,  82, 143, 
-    160,  56, 250, 151,  68,  74, 
-    171, 251, 188, 119, 224, 208, 
-     55, 192,   1,   0,   0,   0, 
-     92,   5,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    192,   0,   0,   0, 100,   1, 
-      0,   0, 224,   1,   0,   0, 
-    208,   4,   0,   0,  40,   5, 
-      0,   0,  65, 111, 110,  57, 
-    128,   0,   0,   0, 128,   0, 
-      0,   0,   0,   2, 255, 255, 
-     76,   0,   0,   0,  52,   0, 
-      0,   0,   1,   0,  40,   0, 
-      0,   0,  52,   0,   0,   0, 
-     52,   0,   1,   0,  36,   0, 
-      0,   0,  52,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   1,   2, 255, 255, 
-     31,   0,   0,   2,   0,   0, 
-      0, 128,   0,   0,   3, 176, 
-     31,   0,   0,   2,   0,   0, 
-      0, 144,   0,   8,  15, 160, 
-     66,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 176, 
-      0,   8, 228, 160,   5,   0, 
-      0,   3,   0,   0,  15, 128, 
-      0,   0, 228, 128,   0,   0, 
-      0, 160,   1,   0,   0,   2, 
-      0,   8,  15, 128,   0,   0, 
-    228, 128, 255, 255,   0,   0, 
-     83,  72,  68,  82, 156,   0, 
-      0,   0,  64,   0,   0,   0, 
-     39,   0,   0,   0,  89,   0, 
-      0,   4,  70, 142,  32,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,  90,   0,   0,   3, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   0,   0, 
-      0,   0,  85,  85,   0,   0, 
-     98,  16,   0,   3,  50,  16, 
-     16,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-    104,   0,   0,   2,   1,   0, 
-      0,   0,  69,   0,   0,   9, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   0,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,   6, 128, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  62,   0, 
-      0,   1,  83,  84,  65,  84, 
-    116,   0,   0,   0,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     82,  68,  69,  70, 232,   2, 
-      0,   0,   1,   0,   0,   0, 
-    148,   0,   0,   0,   3,   0, 
-      0,   0,  28,   0,   0,   0, 
-      0,   4, 255, 255,   0,   1, 
-      0,   0, 189,   2,   0,   0, 
-    124,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0, 133,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 138,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-    115,  83,  97, 109, 112, 108, 
-    101, 114,   0, 116,  82,  71, 
-     66,   0,  36,  71, 108, 111, 
-     98,  97, 108, 115,   0, 171, 
-    138,   0,   0,   0,  11,   0, 
-      0,   0, 172,   0,   0,   0, 
-    144,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    180,   1,   0,   0,   0,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 192,   1, 
-      0,   0,   0,   0,   0,   0, 
-    208,   1,   0,   0,  16,   0, 
-      0,   0,   4,   0,   0,   0, 
-      2,   0,   0,   0, 224,   1, 
-      0,   0,   0,   0,   0,   0, 
-    240,   1,   0,   0,  32,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   2, 
-      0,   0,   0,   0,   0,   0, 
-     16,   2,   0,   0,  48,   0, 
-      0,   0,  44,   0,   0,   0, 
-      0,   0,   0,   0,  32,   2, 
-      0,   0,   0,   0,   0,   0, 
-     48,   2,   0,   0,  96,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-     80,   2,   0,   0, 160,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-     92,   2,   0,   0, 224,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 192,   1, 
-      0,   0,   0,   0,   0,   0, 
-    112,   2,   0,   0, 240,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 128,   2, 
-      0,   0,   0,   0,   0,   0, 
-    144,   2,   0,   0,   0,   1, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 128,   2, 
-      0,   0,   0,   0,   0,   0, 
-    155,   2,   0,   0,  16,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-    170,   2,   0,   0,  80,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0,  64,   2, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     67, 111, 108, 111, 114,   0, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  79, 112, 
-     97,  99, 105, 116, 121,   0, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0, 118,  84, 101, 120, 
-    116, 117, 114, 101,  67, 111, 
-    111, 114, 100, 115,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 118,  76, 
-     97, 121, 101, 114,  81, 117, 
-     97, 100,   0, 109,  77,  97, 
-    115, 107,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-    109,  66,  97,  99, 107, 100, 
-    114, 111, 112,  84, 114,  97, 
-    110, 115, 102, 111, 114, 109, 
-      0,  77, 105,  99, 114, 111, 
-    115, 111, 102, 116,  32,  40, 
-     82,  41,  32,  72,  76,  83, 
-     76,  32,  83, 104,  97, 100, 
-    101, 114,  32,  67, 111, 109, 
-    112, 105, 108, 101, 114,  32, 
-     49,  48,  46,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-     80,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     68,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171, 
-     79,  83,  71,  78,  44,   0, 
-      0,   0,   1,   0,   0,   0, 
-      8,   0,   0,   0,  32,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  83,  86, 
-     95,  84,  97, 114, 103, 101, 
-    116,   0, 171, 171
-};
-ShaderBytes sRGBAShader = { RGBAShader, sizeof(RGBAShader) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tRGB                              texture  float4          2d             t0      1 
-// tRGBWhite                         texture  float4          2d             t4      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-// SV_Target                1   xyzw        1   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t0               
-// s1             s0              t4               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    def c1, 1, 0, 0, 0
-    dcl t0.xy
-    dcl_2d s0
-    dcl_2d s1
-    texld r0, t0, s0
-    texld r1, t0, s1
-    add r1, r0, -r1
-    add r1, r1, c1.x
-    mov r0.w, r1.y
-    mul r1, r1, c0.x
-    mov oC1, r1
-    mul r0, r0, c0.x
-    mov oC0, r0
-
-// approximately 9 instruction slots used (2 texture, 7 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[2], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t0
-dcl_resource_texture2d (float,float,float,float) t4
-dcl_input_ps linear v1.xy
-dcl_output o0.xyzw
-dcl_output o1.xyzw
-dcl_temps 2
-sample r0.xyzw, v1.xyxx, t4.xyzw, s0
-sample r1.xyzw, v1.xyxx, t0.xyzw, s0
-add r0.xyzw, -r0.xyzw, r1.xyzw
-add r0.xyzw, r0.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
-mov r1.w, r0.y
-mul o1.xyzw, r0.xyzw, cb0[1].xxxx
-mul o0.xyzw, r1.xyzw, cb0[1].xxxx
-ret 
-// Approximately 8 instruction slots used
-#endif
-
-const BYTE ComponentAlphaShader[] =
-{
-     68,  88,  66,  67, 141,  83, 
-    151, 108, 122,  94,  34, 209, 
-     87, 123, 153, 156,  73,  70, 
-    116,  57,   1,   0,   0,   0, 
-    220,   6,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-     64,   1,   0,   0, 160,   2, 
-      0,   0,  28,   3,   0,   0, 
-     56,   6,   0,   0, 144,   6, 
-      0,   0,  65, 111, 110,  57, 
-      0,   1,   0,   0,   0,   1, 
-      0,   0,   0,   2, 255, 255, 
-    200,   0,   0,   0,  56,   0, 
-      0,   0,   1,   0,  44,   0, 
-      0,   0,  56,   0,   0,   0, 
-     56,   0,   2,   0,  36,   0, 
-      0,   0,  56,   0,   0,   0, 
-      0,   0,   4,   0,   1,   0, 
-      0,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   2, 255, 255,  81,   0, 
-      0,   5,   1,   0,  15, 160, 
-      0,   0, 128,  63,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  31,   0, 
-      0,   2,   0,   0,   0, 128, 
-      0,   0,   3, 176,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      0,   8,  15, 160,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      1,   8,  15, 160,  66,   0, 
-      0,   3,   0,   0,  15, 128, 
-      0,   0, 228, 176,   0,   8, 
-    228, 160,  66,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-    228, 176,   1,   8, 228, 160, 
-      2,   0,   0,   3,   1,   0, 
-     15, 128,   0,   0, 228, 128, 
-      1,   0, 228, 129,   2,   0, 
-      0,   3,   1,   0,  15, 128, 
-      1,   0, 228, 128,   1,   0, 
-      0, 160,   1,   0,   0,   2, 
-      0,   0,   8, 128,   1,   0, 
-     85, 128,   5,   0,   0,   3, 
-      1,   0,  15, 128,   1,   0, 
-    228, 128,   0,   0,   0, 160, 
-      1,   0,   0,   2,   1,   8, 
-     15, 128,   1,   0, 228, 128, 
-      5,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      0,   0,   0, 160,   1,   0, 
-      0,   2,   0,   8,  15, 128, 
-      0,   0, 228, 128, 255, 255, 
-      0,   0,  83,  72,  68,  82, 
-     88,   1,   0,   0,  64,   0, 
-      0,   0,  86,   0,   0,   0, 
-     89,   0,   0,   4,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      2,   0,   0,   0,  90,   0, 
-      0,   3,   0,  96,  16,   0, 
-      0,   0,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      0,   0,   0,   0,  85,  85, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   4,   0, 
-      0,   0,  85,  85,   0,   0, 
-     98,  16,   0,   3,  50,  16, 
-     16,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   1,   0,   0,   0, 
-    104,   0,   0,   2,   2,   0, 
-      0,   0,  69,   0,   0,   9, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   4,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  69,   0,   0,   9, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   0,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   8, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16, 128, 
-     65,   0,   0,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,  10, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-      2,  64,   0,   0,   0,   0, 
-    128,  63,   0,   0, 128,  63, 
-      0,   0, 128,  63,   0,   0, 
-    128,  63,  54,   0,   0,   5, 
-    130,   0,  16,   0,   1,   0, 
-      0,   0,  26,   0,  16,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,   8, 242,  32,  16,   0, 
-      1,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-      6, 128,  32,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     56,   0,   0,   8, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,   6, 128,  32,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,  62,   0,   0,   1, 
-     83,  84,  65,  84, 116,   0, 
-      0,   0,   8,   0,   0,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  82,  68, 
-     69,  70,  20,   3,   0,   0, 
-      1,   0,   0,   0, 192,   0, 
-      0,   0,   4,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    255, 255,   0,   1,   0,   0, 
-    233,   2,   0,   0, 156,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    165,   0,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0, 170,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   4,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 180,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-    115,  83,  97, 109, 112, 108, 
-    101, 114,   0, 116,  82,  71, 
-     66,   0, 116,  82,  71,  66, 
-     87, 104, 105, 116, 101,   0, 
-     36,  71, 108, 111,  98,  97, 
-    108, 115,   0, 171, 171, 171, 
-    180,   0,   0,   0,  11,   0, 
-      0,   0, 216,   0,   0,   0, 
-    144,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    224,   1,   0,   0,   0,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 236,   1, 
-      0,   0,   0,   0,   0,   0, 
-    252,   1,   0,   0,  16,   0, 
-      0,   0,   4,   0,   0,   0, 
-      2,   0,   0,   0,  12,   2, 
-      0,   0,   0,   0,   0,   0, 
-     28,   2,   0,   0,  32,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  44,   2, 
-      0,   0,   0,   0,   0,   0, 
-     60,   2,   0,   0,  48,   0, 
-      0,   0,  44,   0,   0,   0, 
-      0,   0,   0,   0,  76,   2, 
-      0,   0,   0,   0,   0,   0, 
-     92,   2,   0,   0,  96,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 108,   2, 
-      0,   0,   0,   0,   0,   0, 
-    124,   2,   0,   0, 160,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 108,   2, 
-      0,   0,   0,   0,   0,   0, 
-    136,   2,   0,   0, 224,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 236,   1, 
-      0,   0,   0,   0,   0,   0, 
-    156,   2,   0,   0, 240,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 172,   2, 
-      0,   0,   0,   0,   0,   0, 
-    188,   2,   0,   0,   0,   1, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 172,   2, 
-      0,   0,   0,   0,   0,   0, 
-    199,   2,   0,   0,  16,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 108,   2, 
-      0,   0,   0,   0,   0,   0, 
-    214,   2,   0,   0,  80,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 108,   2, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     67, 111, 108, 111, 114,   0, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  79, 112, 
-     97,  99, 105, 116, 121,   0, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0, 118,  84, 101, 120, 
-    116, 117, 114, 101,  67, 111, 
-    111, 114, 100, 115,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 118,  76, 
-     97, 121, 101, 114,  81, 117, 
-     97, 100,   0, 109,  77,  97, 
-    115, 107,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-    109,  66,  97,  99, 107, 100, 
-    114, 111, 112,  84, 114,  97, 
-    110, 115, 102, 111, 114, 109, 
-      0,  77, 105,  99, 114, 111, 
-    115, 111, 102, 116,  32,  40, 
-     82,  41,  32,  72,  76,  83, 
-     76,  32,  83, 104,  97, 100, 
-    101, 114,  32,  67, 111, 109, 
-    112, 105, 108, 101, 114,  32, 
-     49,  48,  46,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-     80,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     68,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171, 
-     79,  83,  71,  78,  68,   0, 
-      0,   0,   2,   0,   0,   0, 
-      8,   0,   0,   0,  56,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  56,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-     15,   0,   0,   0,  83,  86, 
-     95,  84,  97, 114, 103, 101, 
-    116,   0, 171, 171
-};
-ShaderBytes sComponentAlphaShader = { ComponentAlphaShader, sizeof(ComponentAlphaShader) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tY                                texture  float4          2d             t1      1 
-// tCb                               texture  float4          2d             t2      1 
-// tCr                               texture  float4          2d             t3      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-// c1         cb0             3         3  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t1               
-// s1             s0              t2               
-// s2             s0              t3               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    def c4, -0.0627499968, -0.50195998, 1, 0
-    dcl t0.xy
-    dcl_2d s0
-    dcl_2d s1
-    dcl_2d s2
-    mov r0.w, c4.z
-    texld r1, t0, s1
-    texld r2, t0, s0
-    add r2.x, r2.x, c4.x
-    add r2.y, r1.x, c4.y
-    texld r1, t0, s2
-    add r2.z, r1.x, c4.y
-    dp3 r0.x, c1, r2
-    dp3 r0.y, c2, r2
-    dp3 r0.z, c3, r2
-    mul r0, r0, c0.x
-    mov oC0, r0
-
-// approximately 12 instruction slots used (3 texture, 9 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[6], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t1
-dcl_resource_texture2d (float,float,float,float) t2
-dcl_resource_texture2d (float,float,float,float) t3
-dcl_input_ps linear v1.xy
-dcl_output o0.xyzw
-dcl_temps 3
-mov r0.w, l(1.000000)
-sample r1.xyzw, v1.xyxx, t1.xyzw, s0
-add r1.x, r1.x, l(-0.062750)
-sample r2.xyzw, v1.xyxx, t2.xyzw, s0
-add r1.y, r2.x, l(-0.501960)
-sample r2.xyzw, v1.xyxx, t3.xyzw, s0
-add r1.z, r2.x, l(-0.501960)
-dp3 r0.x, cb0[3].xyzx, r1.xyzx
-dp3 r0.y, cb0[4].xyzx, r1.xyzx
-dp3 r0.z, cb0[5].xyzx, r1.xyzx
-mul o0.xyzw, r0.xyzw, cb0[1].xxxx
-ret 
-// Approximately 12 instruction slots used
-#endif
-
-const BYTE YCbCrShader[] =
-{
-     68,  88,  66,  67, 144, 145, 
-      3, 115,  79, 221, 206,  93, 
-    244, 174, 182,  75, 160, 248, 
-     95, 149,   1,   0,   0,   0, 
-    164,   7,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    144,   1,   0,   0, 100,   3, 
-      0,   0, 224,   3,   0,   0, 
-     24,   7,   0,   0, 112,   7, 
-      0,   0,  65, 111, 110,  57, 
-     80,   1,   0,   0,  80,   1, 
-      0,   0,   0,   2, 255, 255, 
-      8,   1,   0,   0,  72,   0, 
-      0,   0,   2,   0,  48,   0, 
-      0,   0,  72,   0,   0,   0, 
-     72,   0,   3,   0,  36,   0, 
-      0,   0,  72,   0,   1,   0, 
-      0,   0,   2,   0,   1,   0, 
-      3,   0,   2,   0,   0,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   3,   0,   1,   0, 
-      0,   0,   0,   0,   1,   2, 
-    255, 255,  81,   0,   0,   5, 
-      4,   0,  15, 160,  18, 131, 
-    128, 189, 115, 128,   0, 191, 
-      0,   0, 128,  63,   0,   0, 
-      0,   0,  31,   0,   0,   2, 
-      0,   0,   0, 128,   0,   0, 
-      3, 176,  31,   0,   0,   2, 
-      0,   0,   0, 144,   0,   8, 
-     15, 160,  31,   0,   0,   2, 
-      0,   0,   0, 144,   1,   8, 
-     15, 160,  31,   0,   0,   2, 
-      0,   0,   0, 144,   2,   8, 
-     15, 160,   1,   0,   0,   2, 
-      0,   0,   8, 128,   4,   0, 
-    170, 160,  66,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-    228, 176,   1,   8, 228, 160, 
-     66,   0,   0,   3,   2,   0, 
-     15, 128,   0,   0, 228, 176, 
-      0,   8, 228, 160,   2,   0, 
-      0,   3,   2,   0,   1, 128, 
-      2,   0,   0, 128,   4,   0, 
-      0, 160,   2,   0,   0,   3, 
-      2,   0,   2, 128,   1,   0, 
-      0, 128,   4,   0,  85, 160, 
-     66,   0,   0,   3,   1,   0, 
-     15, 128,   0,   0, 228, 176, 
-      2,   8, 228, 160,   2,   0, 
-      0,   3,   2,   0,   4, 128, 
-      1,   0,   0, 128,   4,   0, 
-     85, 160,   8,   0,   0,   3, 
-      0,   0,   1, 128,   1,   0, 
-    228, 160,   2,   0, 228, 128, 
-      8,   0,   0,   3,   0,   0, 
-      2, 128,   2,   0, 228, 160, 
-      2,   0, 228, 128,   8,   0, 
-      0,   3,   0,   0,   4, 128, 
-      3,   0, 228, 160,   2,   0, 
-    228, 128,   5,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-    228, 128,   0,   0,   0, 160, 
-      1,   0,   0,   2,   0,   8, 
-     15, 128,   0,   0, 228, 128, 
-    255, 255,   0,   0,  83,  72, 
-     68,  82, 204,   1,   0,   0, 
-     64,   0,   0,   0, 115,   0, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   6,   0,   0,   0, 
-     90,   0,   0,   3,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   1,   0,   0,   0, 
-     85,  85,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      2,   0,   0,   0,  85,  85, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   3,   0, 
-      0,   0,  85,  85,   0,   0, 
-     98,  16,   0,   3,  50,  16, 
-     16,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-    104,   0,   0,   2,   3,   0, 
-      0,   0,  54,   0,   0,   5, 
-    130,   0,  16,   0,   0,   0, 
-      0,   0,   1,  64,   0,   0, 
-      0,   0, 128,  63,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      1,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   1,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   7,  18,   0,  16,   0, 
-      1,   0,   0,   0,  10,   0, 
-     16,   0,   1,   0,   0,   0, 
-      1,  64,   0,   0,  18, 131, 
-    128, 189,  69,   0,   0,   9, 
-    242,   0,  16,   0,   2,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   2,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   7, 
-     34,   0,  16,   0,   1,   0, 
-      0,   0,  10,   0,  16,   0, 
-      2,   0,   0,   0,   1,  64, 
-      0,   0, 115, 128,   0, 191, 
-     69,   0,   0,   9, 242,   0, 
-     16,   0,   2,   0,   0,   0, 
-     70,  16,  16,   0,   1,   0, 
-      0,   0,  70, 126,  16,   0, 
-      3,   0,   0,   0,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,   0,   7,  66,   0, 
-     16,   0,   1,   0,   0,   0, 
-     10,   0,  16,   0,   2,   0, 
-      0,   0,   1,  64,   0,   0, 
-    115, 128,   0, 191,  16,   0, 
-      0,   8,  18,   0,  16,   0, 
-      0,   0,   0,   0,  70, 130, 
-     32,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-     16,   0,   0,   8,  34,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 130,  32,   0,   0,   0, 
-      0,   0,   4,   0,   0,   0, 
-     70,   2,  16,   0,   1,   0, 
-      0,   0,  16,   0,   0,   8, 
-     66,   0,  16,   0,   0,   0, 
-      0,   0,  70, 130,  32,   0, 
-      0,   0,   0,   0,   5,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   8, 242,  32,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-      6, 128,  32,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     62,   0,   0,   1,  83,  84, 
-     65,  84, 116,   0,   0,   0, 
-     12,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      2,   0,   0,   0,   7,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  82,  68,  69,  70, 
-     48,   3,   0,   0,   1,   0, 
-      0,   0, 220,   0,   0,   0, 
-      5,   0,   0,   0,  28,   0, 
-      0,   0,   0,   4, 255, 255, 
-      0,   1,   0,   0,   5,   3, 
-      0,   0, 188,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      1,   0,   0,   0, 197,   0, 
-      0,   0,   2,   0,   0,   0, 
-      5,   0,   0,   0,   4,   0, 
-      0,   0, 255, 255, 255, 255, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0,  13,   0,   0,   0, 
-    200,   0,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   2,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0, 204,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 208,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-    115,  83,  97, 109, 112, 108, 
-    101, 114,   0, 116,  89,   0, 
-    116,  67,  98,   0, 116,  67, 
-    114,   0,  36,  71, 108, 111, 
-     98,  97, 108, 115,   0, 171, 
-    171, 171, 208,   0,   0,   0, 
-     11,   0,   0,   0, 244,   0, 
-      0,   0, 144,   1,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 252,   1,   0,   0, 
-      0,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      8,   2,   0,   0,   0,   0, 
-      0,   0,  24,   2,   0,   0, 
-     16,   0,   0,   0,   4,   0, 
-      0,   0,   2,   0,   0,   0, 
-     40,   2,   0,   0,   0,   0, 
-      0,   0,  56,   2,   0,   0, 
-     32,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-     72,   2,   0,   0,   0,   0, 
-      0,   0,  88,   2,   0,   0, 
-     48,   0,   0,   0,  44,   0, 
-      0,   0,   2,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 120,   2,   0,   0, 
-     96,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    136,   2,   0,   0,   0,   0, 
-      0,   0, 152,   2,   0,   0, 
-    160,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    136,   2,   0,   0,   0,   0, 
-      0,   0, 164,   2,   0,   0, 
-    224,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      8,   2,   0,   0,   0,   0, 
-      0,   0, 184,   2,   0,   0, 
-    240,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    200,   2,   0,   0,   0,   0, 
-      0,   0, 216,   2,   0,   0, 
-      0,   1,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    200,   2,   0,   0,   0,   0, 
-      0,   0, 227,   2,   0,   0, 
-     16,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    136,   2,   0,   0,   0,   0, 
-      0,   0, 242,   2,   0,   0, 
-     80,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    136,   2,   0,   0,   0,   0, 
-      0,   0, 102,  76,  97, 121, 
-    101, 114,  67, 111, 108, 111, 
-    114,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     79, 112,  97,  99, 105, 116, 
-    121,   0, 171, 171,   0,   0, 
-      3,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 105,  66, 108, 101, 
-    110, 100,  67, 111, 110, 102, 
-    105, 103,   0, 171, 171, 171, 
-      1,   0,  19,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  89, 
-    117, 118,  67, 111, 108, 111, 
-    114,  77,  97, 116, 114, 105, 
-    120,   0,   2,   0,   3,   0, 
-      3,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  76,  97, 121, 101, 114, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0,   3,   0, 
-      3,   0,   4,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  80, 114, 111, 
-    106, 101,  99, 116, 105, 111, 
-    110,   0, 118,  82, 101, 110, 
-    100, 101, 114,  84,  97, 114, 
-    103, 101, 116,  79, 102, 102, 
-    115, 101, 116,   0, 118,  84, 
-    101, 120, 116, 117, 114, 101, 
-     67, 111, 111, 114, 100, 115, 
-      0, 171,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  76,  97, 121, 101, 114, 
-     81, 117,  97, 100,   0, 109, 
-     77,  97, 115, 107,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0, 109,  66,  97,  99, 
-    107, 100, 114, 111, 112,  84, 
-    114,  97, 110, 115, 102, 111, 
-    114, 109,   0,  77, 105,  99, 
-    114, 111, 115, 111, 102, 116, 
-     32,  40,  82,  41,  32,  72, 
-     76,  83,  76,  32,  83, 104, 
-     97, 100, 101, 114,  32,  67, 
-    111, 109, 112, 105, 108, 101, 
-    114,  32,  49,  48,  46,  49, 
-      0, 171, 171, 171,  73,  83, 
-     71,  78,  80,   0,   0,   0, 
-      2,   0,   0,   0,   8,   0, 
-      0,   0,  56,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  15,   0, 
-      0,   0,  68,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      1,   0,   0,   0,   3,   3, 
-      0,   0,  83,  86,  95,  80, 
-    111, 115, 105, 116, 105, 111, 
-    110,   0,  84,  69,  88,  67, 
-     79,  79,  82,  68,   0, 171, 
-    171, 171,  79,  83,  71,  78, 
-     44,   0,   0,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     83,  86,  95,  84,  97, 114, 
-    103, 101, 116,   0, 171, 171
-};
-ShaderBytes sYCbCrShader = { YCbCrShader, sizeof(YCbCrShader) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tY                                texture  float4          2d             t1      1 
-// tCb                               texture  float4          2d             t2      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-// c1         cb0             3         3  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t1               
-// s1             s0              t2               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    def c4, -0.0627499968, -0.50195998, 1, 0
-    dcl t0.xy
-    dcl_2d s0
-    dcl_2d s1
-    mov r0.w, c4.z
-    texld r1, t0, s1
-    texld r2, t0, s0
-    add r2.x, r2.x, c4.x
-    add r2.yz, r1.xxyw, c4.y
-    dp3 r0.x, c1, r2
-    dp3 r0.y, c2, r2
-    dp3 r0.z, c3, r2
-    mul r0, r0, c0.x
-    mov oC0, r0
-
-// approximately 10 instruction slots used (2 texture, 8 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[6], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t1
-dcl_resource_texture2d (float,float,float,float) t2
-dcl_input_ps linear v1.xy
-dcl_output o0.xyzw
-dcl_temps 3
-mov r0.w, l(1.000000)
-sample r1.xyzw, v1.xyxx, t1.xyzw, s0
-add r1.x, r1.x, l(-0.062750)
-sample r2.xyzw, v1.xyxx, t2.xyzw, s0
-add r1.yz, r2.xxyx, l(0.000000, -0.501960, -0.501960, 0.000000)
-dp3 r0.x, cb0[3].xyzx, r1.xyzx
-dp3 r0.y, cb0[4].xyzx, r1.xyzx
-dp3 r0.z, cb0[5].xyzx, r1.xyzx
-mul o0.xyzw, r0.xyzw, cb0[1].xxxx
-ret 
-// Approximately 10 instruction slots used
-#endif
-
-const BYTE NV12Shader[] =
-{
-     68,  88,  66,  67, 196,  33, 
-    229,  30, 127, 191,  69,  57, 
-    188, 163, 187,  63, 196,  65, 
-     63,  98,   1,   0,   0,   0, 
-     12,   7,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-     96,   1,   0,   0, 240,   2, 
-      0,   0, 108,   3,   0,   0, 
-    128,   6,   0,   0, 216,   6, 
-      0,   0,  65, 111, 110,  57, 
-     32,   1,   0,   0,  32,   1, 
-      0,   0,   0,   2, 255, 255, 
-    220,   0,   0,   0,  68,   0, 
-      0,   0,   2,   0,  44,   0, 
-      0,   0,  68,   0,   0,   0, 
-     68,   0,   2,   0,  36,   0, 
-      0,   0,  68,   0,   1,   0, 
-      0,   0,   2,   0,   1,   0, 
-      0,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   3,   0, 
-      1,   0,   0,   0,   0,   0, 
-      1,   2, 255, 255,  81,   0, 
-      0,   5,   4,   0,  15, 160, 
-     18, 131, 128, 189, 115, 128, 
-      0, 191,   0,   0, 128,  63, 
-      0,   0,   0,   0,  31,   0, 
-      0,   2,   0,   0,   0, 128, 
-      0,   0,   3, 176,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      0,   8,  15, 160,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      1,   8,  15, 160,   1,   0, 
-      0,   2,   0,   0,   8, 128, 
-      4,   0, 170, 160,  66,   0, 
-      0,   3,   1,   0,  15, 128, 
-      0,   0, 228, 176,   1,   8, 
-    228, 160,  66,   0,   0,   3, 
-      2,   0,  15, 128,   0,   0, 
-    228, 176,   0,   8, 228, 160, 
-      2,   0,   0,   3,   2,   0, 
-      1, 128,   2,   0,   0, 128, 
-      4,   0,   0, 160,   2,   0, 
-      0,   3,   2,   0,   6, 128, 
-      1,   0, 208, 128,   4,   0, 
-     85, 160,   8,   0,   0,   3, 
-      0,   0,   1, 128,   1,   0, 
-    228, 160,   2,   0, 228, 128, 
-      8,   0,   0,   3,   0,   0, 
-      2, 128,   2,   0, 228, 160, 
-      2,   0, 228, 128,   8,   0, 
-      0,   3,   0,   0,   4, 128, 
-      3,   0, 228, 160,   2,   0, 
-    228, 128,   5,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-    228, 128,   0,   0,   0, 160, 
-      1,   0,   0,   2,   0,   8, 
-     15, 128,   0,   0, 228, 128, 
-    255, 255,   0,   0,  83,  72, 
-     68,  82, 136,   1,   0,   0, 
-     64,   0,   0,   0,  98,   0, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   6,   0,   0,   0, 
-     90,   0,   0,   3,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   1,   0,   0,   0, 
-     85,  85,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      2,   0,   0,   0,  85,  85, 
-      0,   0,  98,  16,   0,   3, 
-     50,  16,  16,   0,   1,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0, 104,   0,   0,   2, 
-      3,   0,   0,   0,  54,   0, 
-      0,   5, 130,   0,  16,   0, 
-      0,   0,   0,   0,   1,  64, 
-      0,   0,   0,   0, 128,  63, 
-     69,   0,   0,   9, 242,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  16,  16,   0,   1,   0, 
-      0,   0,  70, 126,  16,   0, 
-      1,   0,   0,   0,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,   0,   7,  18,   0, 
-     16,   0,   1,   0,   0,   0, 
-     10,   0,  16,   0,   1,   0, 
-      0,   0,   1,  64,   0,   0, 
-     18, 131, 128, 189,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      2,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   2,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,  10,  98,   0,  16,   0, 
-      1,   0,   0,   0,   6,   1, 
-     16,   0,   2,   0,   0,   0, 
-      2,  64,   0,   0,   0,   0, 
-      0,   0, 115, 128,   0, 191, 
-    115, 128,   0, 191,   0,   0, 
-      0,   0,  16,   0,   0,   8, 
-     18,   0,  16,   0,   0,   0, 
-      0,   0,  70, 130,  32,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,  16,   0, 
-      0,   8,  34,   0,  16,   0, 
-      0,   0,   0,   0,  70, 130, 
-     32,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-     16,   0,   0,   8,  66,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 130,  32,   0,   0,   0, 
-      0,   0,   5,   0,   0,   0, 
-     70,   2,  16,   0,   1,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,   6, 128, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  62,   0, 
-      0,   1,  83,  84,  65,  84, 
-    116,   0,   0,   0,  10,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,   6,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     82,  68,  69,  70,  12,   3, 
-      0,   0,   1,   0,   0,   0, 
-    184,   0,   0,   0,   4,   0, 
-      0,   0,  28,   0,   0,   0, 
-      0,   4, 255, 255,   0,   1, 
-      0,   0, 225,   2,   0,   0, 
-    156,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0, 165,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 168,   0, 
-      0,   0,   2,   0,   0,   0, 
-      5,   0,   0,   0,   4,   0, 
-      0,   0, 255, 255, 255, 255, 
-      2,   0,   0,   0,   1,   0, 
-      0,   0,  13,   0,   0,   0, 
-    172,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0, 115,  83,  97, 109, 
-    112, 108, 101, 114,   0, 116, 
-     89,   0, 116,  67,  98,   0, 
-     36,  71, 108, 111,  98,  97, 
-    108, 115,   0, 171, 171, 171, 
-    172,   0,   0,   0,  11,   0, 
-      0,   0, 208,   0,   0,   0, 
-    144,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    216,   1,   0,   0,   0,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 228,   1, 
-      0,   0,   0,   0,   0,   0, 
-    244,   1,   0,   0,  16,   0, 
-      0,   0,   4,   0,   0,   0, 
-      2,   0,   0,   0,   4,   2, 
-      0,   0,   0,   0,   0,   0, 
-     20,   2,   0,   0,  32,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  36,   2, 
-      0,   0,   0,   0,   0,   0, 
-     52,   2,   0,   0,  48,   0, 
-      0,   0,  44,   0,   0,   0, 
-      2,   0,   0,   0,  68,   2, 
-      0,   0,   0,   0,   0,   0, 
-     84,   2,   0,   0,  96,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 100,   2, 
-      0,   0,   0,   0,   0,   0, 
-    116,   2,   0,   0, 160,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 100,   2, 
-      0,   0,   0,   0,   0,   0, 
-    128,   2,   0,   0, 224,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 228,   1, 
-      0,   0,   0,   0,   0,   0, 
-    148,   2,   0,   0, 240,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 164,   2, 
-      0,   0,   0,   0,   0,   0, 
-    180,   2,   0,   0,   0,   1, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 164,   2, 
-      0,   0,   0,   0,   0,   0, 
-    191,   2,   0,   0,  16,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 100,   2, 
-      0,   0,   0,   0,   0,   0, 
-    206,   2,   0,   0,  80,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 100,   2, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     67, 111, 108, 111, 114,   0, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  79, 112, 
-     97,  99, 105, 116, 121,   0, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0, 118,  84, 101, 120, 
-    116, 117, 114, 101,  67, 111, 
-    111, 114, 100, 115,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 118,  76, 
-     97, 121, 101, 114,  81, 117, 
-     97, 100,   0, 109,  77,  97, 
-    115, 107,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-    109,  66,  97,  99, 107, 100, 
-    114, 111, 112,  84, 114,  97, 
-    110, 115, 102, 111, 114, 109, 
-      0,  77, 105,  99, 114, 111, 
-    115, 111, 102, 116,  32,  40, 
-     82,  41,  32,  72,  76,  83, 
-     76,  32,  83, 104,  97, 100, 
-    101, 114,  32,  67, 111, 109, 
-    112, 105, 108, 101, 114,  32, 
-     49,  48,  46,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-     80,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     68,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171, 
-     79,  83,  71,  78,  44,   0, 
-      0,   0,   1,   0,   0,   0, 
-      8,   0,   0,   0,  32,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  83,  86, 
-     95,  84,  97, 114, 103, 101, 
-    116,   0, 171, 171
-};
-ShaderBytes sNV12Shader = { NV12Shader, sizeof(NV12Shader) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4x4 mLayerTransform;          // Offset:    0 Size:    64
-//   float4x4 mProjection;              // Offset:   64 Size:    64
-//   float4 vRenderTargetOffset;        // Offset:  128 Size:    16
-//   float4 vTextureCoords;             // Offset:  144 Size:    16
-//   float4 vLayerQuad;                 // Offset:  160 Size:    16
-//   float4x4 mMaskTransform;           // Offset:  176 Size:    64
-//   float4x4 mBackdropTransform;       // Offset:  240 Size:    64 [unused]
-//   float4 fLayerColor;                // Offset:  304 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:  320 Size:     4 [unused]
-//   uint4 iBlendConfig;                // Offset:  336 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:  352 Size:    44 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// POSITION                 0   xy          0     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float   xyzw
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c1         cb0             0         2  ( FLT, FLT, FLT, FLT)
-// c3         cb0             3        12  ( FLT, FLT, FLT, FLT)
-//
-//
-// Runtime generated constant mappings:
-//
-// Target Reg                               Constant Description
-// ---------- --------------------------------------------------
-// c0                              Vertex Shader position offset
-//
-//
-// Level9 shader bytecode:
-//
-    vs_2_x
-    def c15, 1, 0, 0, 0
-    dcl_texcoord v0
-    mad r0.xy, v0, c10.zwzw, c10
-    mul r1, r0.y, c2
-    mad r0, c1, r0.x, r1
-    add r0, r0, c3
-    rcp r1.x, r0.w
-    mul r0.xyz, r0, r1.x
-    mul r1.xy, r0.y, c12
-    mad r1.xy, c11, r0.x, r1
-    mad r1.xy, c13, r0.z, r1
-    add r1.xy, r1, c14
-    mov r1.z, c15.x
-    mul oT1.xyz, r0.w, r1
-    add r0, r0, -c8
-    mad oT0.xy, v0, c9.zwzw, c9
-    mul r0.xyz, r0.w, r0
-    mul r1, r0.y, c5
-    mad r1, c4, r0.x, r1
-    mad r1, c6, r0.z, r1
-    mad r0, c7, r0.w, r1
-    mad oPos.xy, r0.w, c0, r0
-    mov oPos.zw, r0
-
-// approximately 21 instruction slots used
-vs_4_0
-dcl_constantbuffer CB0[15], immediateIndexed
-dcl_input v0.xy
-dcl_output_siv o0.xyzw, position
-dcl_output o1.xy
-dcl_output o2.xyz
-dcl_temps 4
-mad r0.xy, v0.xyxx, cb0[10].zwzz, cb0[10].xyxx
-mul r1.xyzw, r0.yyyy, cb0[1].xyzw
-mad r0.xyzw, cb0[0].xyzw, r0.xxxx, r1.xyzw
-add r0.xyzw, r0.xyzw, cb0[3].xyzw
-div r1.xyz, r0.xyzx, r0.wwww
-mov r1.w, r0.w
-add r2.xyzw, r1.xyzw, -cb0[8].xyzw
-mul r1.xyz, r2.wwww, r2.xyzx
-mul r3.xyzw, r1.yyyy, cb0[5].xyzw
-mad r3.xyzw, cb0[4].xyzw, r1.xxxx, r3.xyzw
-mad r3.xyzw, cb0[6].xyzw, r1.zzzz, r3.xyzw
-mad o0.xyzw, cb0[7].xyzw, r2.wwww, r3.xyzw
-mad o1.xy, v0.xyxx, cb0[9].zwzz, cb0[9].xyxx
-div r0.xyzw, r0.xyzw, r1.wwww
-mul r1.xy, r0.yyyy, cb0[12].xyxx
-mad r0.xy, cb0[11].xyxx, r0.xxxx, r1.xyxx
-mad r0.xy, cb0[13].xyxx, r0.zzzz, r0.xyxx
-mad r0.xy, cb0[14].xyxx, r0.wwww, r0.xyxx
-mov r0.z, l(1.000000)
-mul o2.xyz, r1.wwww, r0.xyzx
-ret 
-// Approximately 21 instruction slots used
-#endif
-
-const BYTE LayerQuadMaskVS[] =
-{
-     68,  88,  66,  67, 111, 249, 
-     41,  41,  38, 248,  53, 250, 
-      5, 230,  67,  13, 246,  34, 
-    179, 140,   1,   0,   0,   0, 
-    224,   8,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-     20,   2,   0,   0,  32,   5, 
-      0,   0, 156,   5,   0,   0, 
-     60,   8,   0,   0, 112,   8, 
-      0,   0,  65, 111, 110,  57, 
-    212,   1,   0,   0, 212,   1, 
-      0,   0,   0,   2, 254, 255, 
-    148,   1,   0,   0,  64,   0, 
-      0,   0,   2,   0,  36,   0, 
-      0,   0,  60,   0,   0,   0, 
-     60,   0,   0,   0,  36,   0, 
-      1,   0,  60,   0,   0,   0, 
-      0,   0,   2,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,  12,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   2, 254, 255, 
-     81,   0,   0,   5,  15,   0, 
-     15, 160,   0,   0, 128,  63, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     31,   0,   0,   2,   5,   0, 
-      0, 128,   0,   0,  15, 144, 
-      4,   0,   0,   4,   0,   0, 
-      3, 128,   0,   0, 228, 144, 
-     10,   0, 238, 160,  10,   0, 
-    228, 160,   5,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-     85, 128,   2,   0, 228, 160, 
-      4,   0,   0,   4,   0,   0, 
-     15, 128,   1,   0, 228, 160, 
-      0,   0,   0, 128,   1,   0, 
-    228, 128,   2,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-    228, 128,   3,   0, 228, 160, 
-      6,   0,   0,   2,   1,   0, 
-      1, 128,   0,   0, 255, 128, 
-      5,   0,   0,   3,   0,   0, 
-      7, 128,   0,   0, 228, 128, 
-      1,   0,   0, 128,   5,   0, 
-      0,   3,   1,   0,   3, 128, 
-      0,   0,  85, 128,  12,   0, 
-    228, 160,   4,   0,   0,   4, 
-      1,   0,   3, 128,  11,   0, 
-    228, 160,   0,   0,   0, 128, 
-      1,   0, 228, 128,   4,   0, 
-      0,   4,   1,   0,   3, 128, 
-     13,   0, 228, 160,   0,   0, 
-    170, 128,   1,   0, 228, 128, 
-      2,   0,   0,   3,   1,   0, 
-      3, 128,   1,   0, 228, 128, 
-     14,   0, 228, 160,   1,   0, 
-      0,   2,   1,   0,   4, 128, 
-     15,   0,   0, 160,   5,   0, 
-      0,   3,   1,   0,   7, 224, 
-      0,   0, 255, 128,   1,   0, 
-    228, 128,   2,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-    228, 128,   8,   0, 228, 161, 
-      4,   0,   0,   4,   0,   0, 
-      3, 224,   0,   0, 228, 144, 
-      9,   0, 238, 160,   9,   0, 
-    228, 160,   5,   0,   0,   3, 
-      0,   0,   7, 128,   0,   0, 
-    255, 128,   0,   0, 228, 128, 
-      5,   0,   0,   3,   1,   0, 
-     15, 128,   0,   0,  85, 128, 
-      5,   0, 228, 160,   4,   0, 
-      0,   4,   1,   0,  15, 128, 
-      4,   0, 228, 160,   0,   0, 
-      0, 128,   1,   0, 228, 128, 
-      4,   0,   0,   4,   1,   0, 
-     15, 128,   6,   0, 228, 160, 
-      0,   0, 170, 128,   1,   0, 
-    228, 128,   4,   0,   0,   4, 
-      0,   0,  15, 128,   7,   0, 
-    228, 160,   0,   0, 255, 128, 
-      1,   0, 228, 128,   4,   0, 
-      0,   4,   0,   0,   3, 192, 
-      0,   0, 255, 128,   0,   0, 
-    228, 160,   0,   0, 228, 128, 
-      1,   0,   0,   2,   0,   0, 
-     12, 192,   0,   0, 228, 128, 
-    255, 255,   0,   0,  83,  72, 
-     68,  82,   4,   3,   0,   0, 
-     64,   0,   1,   0, 193,   0, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     95,   0,   0,   3,  50,  16, 
-     16,   0,   0,   0,   0,   0, 
-    103,   0,   0,   4, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0, 101,   0, 
-      0,   3,  50,  32,  16,   0, 
-      1,   0,   0,   0, 101,   0, 
-      0,   3, 114,  32,  16,   0, 
-      2,   0,   0,   0, 104,   0, 
-      0,   2,   4,   0,   0,   0, 
-     50,   0,   0,  11,  50,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  16,  16,   0,   0,   0, 
-      0,   0, 230, 138,  32,   0, 
-      0,   0,   0,   0,  10,   0, 
-      0,   0,  70, 128,  32,   0, 
-      0,   0,   0,   0,  10,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  86,   5,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  50,   0, 
-      0,  10, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   6,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,   0,   0,   0,   8, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,  14,   0, 
-      0,   7, 114,   0,  16,   0, 
-      1,   0,   0,   0,  70,   2, 
-     16,   0,   0,   0,   0,   0, 
-    246,  15,  16,   0,   0,   0, 
-      0,   0,  54,   0,   0,   5, 
-    130,   0,  16,   0,   1,   0, 
-      0,   0,  58,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   9, 242,   0,  16,   0, 
-      2,   0,   0,   0,  70,  14, 
-     16,   0,   1,   0,   0,   0, 
-     70, 142,  32, 128,  65,   0, 
-      0,   0,   0,   0,   0,   0, 
-      8,   0,   0,   0,  56,   0, 
-      0,   7, 114,   0,  16,   0, 
-      1,   0,   0,   0, 246,  15, 
-     16,   0,   2,   0,   0,   0, 
-     70,   2,  16,   0,   2,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,   0,  16,   0,   3,   0, 
-      0,   0,  86,   5,  16,   0, 
-      1,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      5,   0,   0,   0,  50,   0, 
-      0,  10, 242,   0,  16,   0, 
-      3,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   6,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  14,  16,   0,   3,   0, 
-      0,   0,  50,   0,   0,  10, 
-    242,   0,  16,   0,   3,   0, 
-      0,   0,  70, 142,  32,   0, 
-      0,   0,   0,   0,   6,   0, 
-      0,   0, 166,  10,  16,   0, 
-      1,   0,   0,   0,  70,  14, 
-     16,   0,   3,   0,   0,   0, 
-     50,   0,   0,  10, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   7,   0,   0,   0, 
-    246,  15,  16,   0,   2,   0, 
-      0,   0,  70,  14,  16,   0, 
-      3,   0,   0,   0,  50,   0, 
-      0,  11,  50,  32,  16,   0, 
-      1,   0,   0,   0,  70,  16, 
-     16,   0,   0,   0,   0,   0, 
-    230, 138,  32,   0,   0,   0, 
-      0,   0,   9,   0,   0,   0, 
-     70, 128,  32,   0,   0,   0, 
-      0,   0,   9,   0,   0,   0, 
-     14,   0,   0,   7, 242,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   0,   0, 
-      0,   0, 246,  15,  16,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   8,  50,   0,  16,   0, 
-      1,   0,   0,   0,  86,   5, 
-     16,   0,   0,   0,   0,   0, 
-     70, 128,  32,   0,   0,   0, 
-      0,   0,  12,   0,   0,   0, 
-     50,   0,   0,  10,  50,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 128,  32,   0,   0,   0, 
-      0,   0,  11,   0,   0,   0, 
-      6,   0,  16,   0,   0,   0, 
-      0,   0,  70,   0,  16,   0, 
-      1,   0,   0,   0,  50,   0, 
-      0,  10,  50,   0,  16,   0, 
-      0,   0,   0,   0,  70, 128, 
-     32,   0,   0,   0,   0,   0, 
-     13,   0,   0,   0, 166,  10, 
-     16,   0,   0,   0,   0,   0, 
-     70,   0,  16,   0,   0,   0, 
-      0,   0,  50,   0,   0,  10, 
-     50,   0,  16,   0,   0,   0, 
-      0,   0,  70, 128,  32,   0, 
-      0,   0,   0,   0,  14,   0, 
-      0,   0, 246,  15,  16,   0, 
-      0,   0,   0,   0,  70,   0, 
-     16,   0,   0,   0,   0,   0, 
-     54,   0,   0,   5,  66,   0, 
-     16,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-    128,  63,  56,   0,   0,   7, 
-    114,  32,  16,   0,   2,   0, 
-      0,   0, 246,  15,  16,   0, 
-      1,   0,   0,   0,  70,   2, 
-     16,   0,   0,   0,   0,   0, 
-     62,   0,   0,   1,  83,  84, 
-     65,  84, 116,   0,   0,   0, 
-     21,   0,   0,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,  18,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  82,  68,  69,  70, 
-    152,   2,   0,   0,   1,   0, 
-      0,   0,  72,   0,   0,   0, 
-      1,   0,   0,   0,  28,   0, 
-      0,   0,   0,   4, 254, 255, 
-      0,   1,   0,   0, 112,   2, 
-      0,   0,  60,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,  36,  71, 
-    108, 111,  98,  97, 108, 115, 
-      0, 171, 171, 171,  60,   0, 
-      0,   0,  11,   0,   0,   0, 
-     96,   0,   0,   0, 144,   1, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 104,   1, 
-      0,   0,   0,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 136,   1, 
-      0,   0,  64,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 148,   1, 
-      0,   0, 128,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0, 184,   1, 
-      0,   0, 144,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 216,   1, 
-      0,   0, 160,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 227,   1, 
-      0,   0, 176,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 242,   1, 
-      0,   0, 240,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0,   5,   2, 
-      0,   0,  48,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0,  17,   2, 
-      0,   0,  64,   1,   0,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,  32,   2,   0,   0, 
-      0,   0,   0,   0,  48,   2, 
-      0,   0,  80,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,  64,   2,   0,   0, 
-      0,   0,   0,   0,  80,   2, 
-      0,   0,  96,   1,   0,   0, 
-     44,   0,   0,   0,   0,   0, 
-      0,   0,  96,   2,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  84, 101, 120, 116, 117, 
-    114, 101,  67, 111, 111, 114, 
-    100, 115,   0, 171,   1,   0, 
-      3,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 118,  76,  97, 121, 
-    101, 114,  81, 117,  97, 100, 
-      0, 109,  77,  97, 115, 107, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0, 109,  66, 
-     97,  99, 107, 100, 114, 111, 
-    112,  84, 114,  97, 110, 115, 
-    102, 111, 114, 109,   0, 102, 
-     76,  97, 121, 101, 114,  67, 
-    111, 108, 111, 114,   0, 102, 
-     76,  97, 121, 101, 114,  79, 
-    112,  97,  99, 105, 116, 121, 
-      0, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  77, 105, 
-     99, 114, 111, 115, 111, 102, 
-    116,  32,  40,  82,  41,  32, 
-     72,  76,  83,  76,  32,  83, 
-    104,  97, 100, 101, 114,  32, 
-     67, 111, 109, 112, 105, 108, 
-    101, 114,  32,  49,  48,  46, 
-     49,   0,  73,  83,  71,  78, 
-     44,   0,   0,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   3,   3,   0,   0, 
-     80,  79,  83,  73,  84,  73, 
-     79,  78,   0, 171, 171, 171, 
-     79,  83,  71,  78, 104,   0, 
-      0,   0,   3,   0,   0,   0, 
-      8,   0,   0,   0,  80,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  92,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,  12,   0,   0,  92,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   2,   0,   0,   0, 
-      7,   8,   0,   0,  83,  86, 
-     95,  80, 111, 115, 105, 116, 
-    105, 111, 110,   0,  84,  69, 
-     88,  67,  79,  79,  82,  68, 
-      0, 171, 171, 171
-};
-ShaderBytes sLayerQuadMaskVS = { LayerQuadMaskVS, sizeof(LayerQuadMaskVS) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4x4 mLayerTransform;          // Offset:    0 Size:    64
-//   float4x4 mProjection;              // Offset:   64 Size:    64
-//   float4 vRenderTargetOffset;        // Offset:  128 Size:    16
-//   float4 vTextureCoords;             // Offset:  144 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  160 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  176 Size:    64
-//   float4x4 mBackdropTransform;       // Offset:  240 Size:    64 [unused]
-//   float4 fLayerColor;                // Offset:  304 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:  320 Size:     4 [unused]
-//   uint4 iBlendConfig;                // Offset:  336 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:  352 Size:    44 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// POSITION                 0   xy          0     NONE   float   xy  
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float   xyzw
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c1         cb0             0         2  ( FLT, FLT, FLT, FLT)
-// c3         cb0             3         6  ( FLT, FLT, FLT, FLT)
-// c9         cb0            11         4  ( FLT, FLT, FLT, FLT)
-//
-//
-// Runtime generated constant mappings:
-//
-// Target Reg                               Constant Description
-// ---------- --------------------------------------------------
-// c0                              Vertex Shader position offset
-//
-//
-// Level9 shader bytecode:
-//
-    vs_2_x
-    def c13, 1, 0, 0, 0
-    dcl_texcoord v0
-    dcl_texcoord1 v1
-    mul r0, v0.y, c2
-    mad r0, c1, v0.x, r0
-    add r0, r0, c3
-    rcp r1.x, r0.w
-    mul r0.xyz, r0, r1.x
-    mul r1.xy, r0.y, c10
-    mad r1.xy, c9, r0.x, r1
-    mad r1.xy, c11, r0.z, r1
-    add r1.xy, r1, c12
-    mov r1.z, c13.x
-    mul oT1.xyz, r0.w, r1
-    add r0, r0, -c8
-    mul r0.xyz, r0.w, r0
-    mul r1, r0.y, c5
-    mad r1, c4, r0.x, r1
-    mad r1, c6, r0.z, r1
-    mad r0, c7, r0.w, r1
-    mad oPos.xy, r0.w, c0, r0
-    mov oPos.zw, r0
-    mov oT0.xy, v1
-
-// approximately 20 instruction slots used
-vs_4_0
-dcl_constantbuffer CB0[15], immediateIndexed
-dcl_input v0.xy
-dcl_input v1.xy
-dcl_output_siv o0.xyzw, position
-dcl_output o1.xy
-dcl_output o2.xyz
-dcl_temps 4
-mul r0.xyzw, v0.yyyy, cb0[1].xyzw
-mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw
-add r0.xyzw, r0.xyzw, cb0[3].xyzw
-div r1.xyz, r0.xyzx, r0.wwww
-mov r1.w, r0.w
-add r2.xyzw, r1.xyzw, -cb0[8].xyzw
-mul r1.xyz, r2.wwww, r2.xyzx
-mul r3.xyzw, r1.yyyy, cb0[5].xyzw
-mad r3.xyzw, cb0[4].xyzw, r1.xxxx, r3.xyzw
-mad r3.xyzw, cb0[6].xyzw, r1.zzzz, r3.xyzw
-mad o0.xyzw, cb0[7].xyzw, r2.wwww, r3.xyzw
-mov o1.xy, v1.xyxx
-div r0.xyzw, r0.xyzw, r1.wwww
-mul r1.xy, r0.yyyy, cb0[12].xyxx
-mad r0.xy, cb0[11].xyxx, r0.xxxx, r1.xyxx
-mad r0.xy, cb0[13].xyxx, r0.zzzz, r0.xyxx
-mad r0.xy, cb0[14].xyxx, r0.wwww, r0.xyxx
-mov r0.z, l(1.000000)
-mul o2.xyz, r1.wwww, r0.xyzx
-ret 
-// Approximately 20 instruction slots used
-#endif
-
-const BYTE LayerDynamicMaskVS[] =
-{
-     68,  88,  66,  67, 157, 241, 
-    152, 245, 122, 161, 230, 158, 
-    210,  56,  70,  92,  47, 199, 
-     58, 136,   1,   0,   0,   0, 
-    196,   8,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-     16,   2,   0,   0, 228,   4, 
-      0,   0,  96,   5,   0,   0, 
-      0,   8,   0,   0,  84,   8, 
-      0,   0,  65, 111, 110,  57, 
-    208,   1,   0,   0, 208,   1, 
-      0,   0,   0,   2, 254, 255, 
-    132,   1,   0,   0,  76,   0, 
-      0,   0,   3,   0,  36,   0, 
-      0,   0,  72,   0,   0,   0, 
-     72,   0,   0,   0,  36,   0, 
-      1,   0,  72,   0,   0,   0, 
-      0,   0,   2,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   6,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     11,   0,   4,   0,   9,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   2, 254, 255, 
-     81,   0,   0,   5,  13,   0, 
-     15, 160,   0,   0, 128,  63, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     31,   0,   0,   2,   5,   0, 
-      0, 128,   0,   0,  15, 144, 
-     31,   0,   0,   2,   5,   0, 
-      1, 128,   1,   0,  15, 144, 
-      5,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0,  85, 144, 
-      2,   0, 228, 160,   4,   0, 
-      0,   4,   0,   0,  15, 128, 
-      1,   0, 228, 160,   0,   0, 
-      0, 144,   0,   0, 228, 128, 
-      2,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      3,   0, 228, 160,   6,   0, 
-      0,   2,   1,   0,   1, 128, 
-      0,   0, 255, 128,   5,   0, 
-      0,   3,   0,   0,   7, 128, 
-      0,   0, 228, 128,   1,   0, 
-      0, 128,   5,   0,   0,   3, 
-      1,   0,   3, 128,   0,   0, 
-     85, 128,  10,   0, 228, 160, 
-      4,   0,   0,   4,   1,   0, 
-      3, 128,   9,   0, 228, 160, 
-      0,   0,   0, 128,   1,   0, 
-    228, 128,   4,   0,   0,   4, 
-      1,   0,   3, 128,  11,   0, 
-    228, 160,   0,   0, 170, 128, 
-      1,   0, 228, 128,   2,   0, 
-      0,   3,   1,   0,   3, 128, 
-      1,   0, 228, 128,  12,   0, 
-    228, 160,   1,   0,   0,   2, 
-      1,   0,   4, 128,  13,   0, 
-      0, 160,   5,   0,   0,   3, 
-      1,   0,   7, 224,   0,   0, 
-    255, 128,   1,   0, 228, 128, 
-      2,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      8,   0, 228, 161,   5,   0, 
-      0,   3,   0,   0,   7, 128, 
-      0,   0, 255, 128,   0,   0, 
-    228, 128,   5,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-     85, 128,   5,   0, 228, 160, 
-      4,   0,   0,   4,   1,   0, 
-     15, 128,   4,   0, 228, 160, 
-      0,   0,   0, 128,   1,   0, 
-    228, 128,   4,   0,   0,   4, 
-      1,   0,  15, 128,   6,   0, 
-    228, 160,   0,   0, 170, 128, 
-      1,   0, 228, 128,   4,   0, 
-      0,   4,   0,   0,  15, 128, 
-      7,   0, 228, 160,   0,   0, 
-    255, 128,   1,   0, 228, 128, 
-      4,   0,   0,   4,   0,   0, 
-      3, 192,   0,   0, 255, 128, 
-      0,   0, 228, 160,   0,   0, 
-    228, 128,   1,   0,   0,   2, 
-      0,   0,  12, 192,   0,   0, 
-    228, 128,   1,   0,   0,   2, 
-      0,   0,   3, 224,   1,   0, 
-    228, 144, 255, 255,   0,   0, 
-     83,  72,  68,  82, 204,   2, 
-      0,   0,  64,   0,   1,   0, 
-    179,   0,   0,   0,  89,   0, 
-      0,   4,  70, 142,  32,   0, 
-      0,   0,   0,   0,  15,   0, 
-      0,   0,  95,   0,   0,   3, 
-     50,  16,  16,   0,   0,   0, 
-      0,   0,  95,   0,   0,   3, 
-     50,  16,  16,   0,   1,   0, 
-      0,   0, 103,   0,   0,   4, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3,  50,  32, 
-     16,   0,   1,   0,   0,   0, 
-    101,   0,   0,   3, 114,  32, 
-     16,   0,   2,   0,   0,   0, 
-    104,   0,   0,   2,   4,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  86,  21,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  50,   0, 
-      0,  10, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   6,  16, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   8, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      0,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,  14,   0, 
-      0,   7, 114,   0,  16,   0, 
-      1,   0,   0,   0,  70,   2, 
-     16,   0,   0,   0,   0,   0, 
-    246,  15,  16,   0,   0,   0, 
-      0,   0,  54,   0,   0,   5, 
-    130,   0,  16,   0,   1,   0, 
-      0,   0,  58,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   9, 242,   0,  16,   0, 
-      2,   0,   0,   0,  70,  14, 
-     16,   0,   1,   0,   0,   0, 
-     70, 142,  32, 128,  65,   0, 
-      0,   0,   0,   0,   0,   0, 
-      8,   0,   0,   0,  56,   0, 
-      0,   7, 114,   0,  16,   0, 
-      1,   0,   0,   0, 246,  15, 
-     16,   0,   2,   0,   0,   0, 
-     70,   2,  16,   0,   2,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,   0,  16,   0,   3,   0, 
-      0,   0,  86,   5,  16,   0, 
-      1,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      5,   0,   0,   0,  50,   0, 
-      0,  10, 242,   0,  16,   0, 
-      3,   0,   0,   0,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   6,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  14,  16,   0,   3,   0, 
-      0,   0,  50,   0,   0,  10, 
-    242,   0,  16,   0,   3,   0, 
-      0,   0,  70, 142,  32,   0, 
-      0,   0,   0,   0,   6,   0, 
-      0,   0, 166,  10,  16,   0, 
-      1,   0,   0,   0,  70,  14, 
-     16,   0,   3,   0,   0,   0, 
-     50,   0,   0,  10, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   7,   0,   0,   0, 
-    246,  15,  16,   0,   2,   0, 
-      0,   0,  70,  14,  16,   0, 
-      3,   0,   0,   0,  54,   0, 
-      0,   5,  50,  32,  16,   0, 
-      1,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     14,   0,   0,   7, 242,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   0,   0, 
-      0,   0, 246,  15,  16,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   8,  50,   0,  16,   0, 
-      1,   0,   0,   0,  86,   5, 
-     16,   0,   0,   0,   0,   0, 
-     70, 128,  32,   0,   0,   0, 
-      0,   0,  12,   0,   0,   0, 
-     50,   0,   0,  10,  50,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 128,  32,   0,   0,   0, 
-      0,   0,  11,   0,   0,   0, 
-      6,   0,  16,   0,   0,   0, 
-      0,   0,  70,   0,  16,   0, 
-      1,   0,   0,   0,  50,   0, 
-      0,  10,  50,   0,  16,   0, 
-      0,   0,   0,   0,  70, 128, 
-     32,   0,   0,   0,   0,   0, 
-     13,   0,   0,   0, 166,  10, 
-     16,   0,   0,   0,   0,   0, 
-     70,   0,  16,   0,   0,   0, 
-      0,   0,  50,   0,   0,  10, 
-     50,   0,  16,   0,   0,   0, 
-      0,   0,  70, 128,  32,   0, 
-      0,   0,   0,   0,  14,   0, 
-      0,   0, 246,  15,  16,   0, 
-      0,   0,   0,   0,  70,   0, 
-     16,   0,   0,   0,   0,   0, 
-     54,   0,   0,   5,  66,   0, 
-     16,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-    128,  63,  56,   0,   0,   7, 
-    114,  32,  16,   0,   2,   0, 
-      0,   0, 246,  15,  16,   0, 
-      1,   0,   0,   0,  70,   2, 
-     16,   0,   0,   0,   0,   0, 
-     62,   0,   0,   1,  83,  84, 
-     65,  84, 116,   0,   0,   0, 
-     20,   0,   0,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      5,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  82,  68,  69,  70, 
-    152,   2,   0,   0,   1,   0, 
-      0,   0,  72,   0,   0,   0, 
-      1,   0,   0,   0,  28,   0, 
-      0,   0,   0,   4, 254, 255, 
-      0,   1,   0,   0, 112,   2, 
-      0,   0,  60,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,  36,  71, 
-    108, 111,  98,  97, 108, 115, 
-      0, 171, 171, 171,  60,   0, 
-      0,   0,  11,   0,   0,   0, 
-     96,   0,   0,   0, 144,   1, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 104,   1, 
-      0,   0,   0,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 136,   1, 
-      0,   0,  64,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 148,   1, 
-      0,   0, 128,   0,   0,   0, 
-     16,   0,   0,   0,   2,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0, 184,   1, 
-      0,   0, 144,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 216,   1, 
-      0,   0, 160,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 200,   1,   0,   0, 
-      0,   0,   0,   0, 227,   1, 
-      0,   0, 176,   0,   0,   0, 
-     64,   0,   0,   0,   2,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0, 242,   1, 
-      0,   0, 240,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 120,   1,   0,   0, 
-      0,   0,   0,   0,   5,   2, 
-      0,   0,  48,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 168,   1,   0,   0, 
-      0,   0,   0,   0,  17,   2, 
-      0,   0,  64,   1,   0,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,  32,   2,   0,   0, 
-      0,   0,   0,   0,  48,   2, 
-      0,   0,  80,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,  64,   2,   0,   0, 
-      0,   0,   0,   0,  80,   2, 
-      0,   0,  96,   1,   0,   0, 
-     44,   0,   0,   0,   0,   0, 
-      0,   0,  96,   2,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  84, 101, 120, 116, 117, 
-    114, 101,  67, 111, 111, 114, 
-    100, 115,   0, 171,   1,   0, 
-      3,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 118,  76,  97, 121, 
-    101, 114,  81, 117,  97, 100, 
-      0, 109,  77,  97, 115, 107, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0, 109,  66, 
-     97,  99, 107, 100, 114, 111, 
-    112,  84, 114,  97, 110, 115, 
-    102, 111, 114, 109,   0, 102, 
-     76,  97, 121, 101, 114,  67, 
-    111, 108, 111, 114,   0, 102, 
-     76,  97, 121, 101, 114,  79, 
-    112,  97,  99, 105, 116, 121, 
-      0, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  77, 105, 
-     99, 114, 111, 115, 111, 102, 
-    116,  32,  40,  82,  41,  32, 
-     72,  76,  83,  76,  32,  83, 
-    104,  97, 100, 101, 114,  32, 
-     67, 111, 109, 112, 105, 108, 
-    101, 114,  32,  49,  48,  46, 
-     49,   0,  73,  83,  71,  78, 
-     76,   0,   0,   0,   2,   0, 
-      0,   0,   8,   0,   0,   0, 
-     56,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   3,   3,   0,   0, 
-     65,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     80,  79,  83,  73,  84,  73, 
-     79,  78,   0,  84,  69,  88, 
-     67,  79,  79,  82,  68,   0, 
-    171, 171,  79,  83,  71,  78, 
-    104,   0,   0,   0,   3,   0, 
-      0,   0,   8,   0,   0,   0, 
-     80,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     92,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,  12,   0,   0, 
-     92,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   2,   0, 
-      0,   0,   7,   8,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171
-};
-ShaderBytes sLayerDynamicMaskVS = { LayerDynamicMaskVS, sizeof(LayerDynamicMaskVS) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16
-//   float fLayerOpacity;               // Offset:   16 Size:     4 [unused]
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tMask                             texture  float4          2d             t5      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float       
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             0         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t5               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    dcl t1.xyz
-    dcl_2d s0
-    rcp r0.w, t1.z
-    mul r0.xy, r0.w, t1
-    texld r0, r0, s0
-    mul r0, r0.x, c0
-    mov oC0, r0
-
-// approximately 5 instruction slots used (1 texture, 4 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[1], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t5
-dcl_input_ps linear v2.xyz
-dcl_output o0.xyzw
-dcl_temps 1
-div r0.xy, v2.xyxx, v2.zzzz
-sample r0.xyzw, r0.xyxx, t5.xyzw, s0
-mul o0.xyzw, r0.xxxx, cb0[0].xyzw
-ret 
-// Approximately 4 instruction slots used
-#endif
-
-const BYTE SolidColorShaderMask[] =
-{
-     68,  88,  66,  67, 129,  99, 
-      8, 159, 198,  40,  71, 109, 
-    168, 226, 159, 169,  62,  65, 
-     26, 148,   1,   0,   0,   0, 
-    172,   5,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    220,   0,   0,   0, 156,   1, 
-      0,   0,  24,   2,   0,   0, 
-      8,   5,   0,   0, 120,   5, 
-      0,   0,  65, 111, 110,  57, 
-    156,   0,   0,   0, 156,   0, 
-      0,   0,   0,   2, 255, 255, 
-    104,   0,   0,   0,  52,   0, 
-      0,   0,   1,   0,  40,   0, 
-      0,   0,  52,   0,   0,   0, 
-     52,   0,   1,   0,  36,   0, 
-      0,   0,  52,   0,   5,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   1,   2, 255, 255, 
-     31,   0,   0,   2,   0,   0, 
-      0, 128,   1,   0,   7, 176, 
-     31,   0,   0,   2,   0,   0, 
-      0, 144,   0,   8,  15, 160, 
-      6,   0,   0,   2,   0,   0, 
-      8, 128,   1,   0, 170, 176, 
-      5,   0,   0,   3,   0,   0, 
-      3, 128,   0,   0, 255, 128, 
-      1,   0, 228, 176,  66,   0, 
-      0,   3,   0,   0,  15, 128, 
-      0,   0, 228, 128,   0,   8, 
-    228, 160,   5,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-      0, 128,   0,   0, 228, 160, 
-      1,   0,   0,   2,   0,   8, 
-     15, 128,   0,   0, 228, 128, 
-    255, 255,   0,   0,  83,  72, 
-     68,  82, 184,   0,   0,   0, 
-     64,   0,   0,   0,  46,   0, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     90,   0,   0,   3,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   5,   0,   0,   0, 
-     85,  85,   0,   0,  98,  16, 
-      0,   3, 114,  16,  16,   0, 
-      2,   0,   0,   0, 101,   0, 
-      0,   3, 242,  32,  16,   0, 
-      0,   0,   0,   0, 104,   0, 
-      0,   2,   1,   0,   0,   0, 
-     14,   0,   0,   7,  50,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  16,  16,   0,   2,   0, 
-      0,   0, 166,  26,  16,   0, 
-      2,   0,   0,   0,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 126,  16,   0,   5,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,   8, 242,  32,  16,   0, 
-      0,   0,   0,   0,   6,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     62,   0,   0,   1,  83,  84, 
-     65,  84, 116,   0,   0,   0, 
-      4,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      2,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  82,  68,  69,  70, 
-    232,   2,   0,   0,   1,   0, 
-      0,   0, 148,   0,   0,   0, 
-      3,   0,   0,   0,  28,   0, 
-      0,   0,   0,   4, 255, 255, 
-      0,   1,   0,   0, 189,   2, 
-      0,   0, 124,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      1,   0,   0,   0, 133,   0, 
-      0,   0,   2,   0,   0,   0, 
-      5,   0,   0,   0,   4,   0, 
-      0,   0, 255, 255, 255, 255, 
-      5,   0,   0,   0,   1,   0, 
-      0,   0,  13,   0,   0,   0, 
-    139,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0, 115,  83,  97, 109, 
-    112, 108, 101, 114,   0, 116, 
-     77,  97, 115, 107,   0,  36, 
-     71, 108, 111,  98,  97, 108, 
-    115,   0, 139,   0,   0,   0, 
-     11,   0,   0,   0, 172,   0, 
-      0,   0, 144,   1,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 180,   1,   0,   0, 
-      0,   0,   0,   0,  16,   0, 
-      0,   0,   2,   0,   0,   0, 
-    192,   1,   0,   0,   0,   0, 
-      0,   0, 208,   1,   0,   0, 
-     16,   0,   0,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-    224,   1,   0,   0,   0,   0, 
-      0,   0, 240,   1,   0,   0, 
-     32,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   2,   0,   0,   0,   0, 
-      0,   0,  16,   2,   0,   0, 
-     48,   0,   0,   0,  44,   0, 
-      0,   0,   0,   0,   0,   0, 
-     32,   2,   0,   0,   0,   0, 
-      0,   0,  48,   2,   0,   0, 
-     96,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-     64,   2,   0,   0,   0,   0, 
-      0,   0,  80,   2,   0,   0, 
-    160,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-     64,   2,   0,   0,   0,   0, 
-      0,   0,  92,   2,   0,   0, 
-    224,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    192,   1,   0,   0,   0,   0, 
-      0,   0, 112,   2,   0,   0, 
-    240,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    128,   2,   0,   0,   0,   0, 
-      0,   0, 144,   2,   0,   0, 
-      0,   1,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    128,   2,   0,   0,   0,   0, 
-      0,   0, 155,   2,   0,   0, 
-     16,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-     64,   2,   0,   0,   0,   0, 
-      0,   0, 170,   2,   0,   0, 
-     80,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-     64,   2,   0,   0,   0,   0, 
-      0,   0, 102,  76,  97, 121, 
-    101, 114,  67, 111, 108, 111, 
-    114,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     79, 112,  97,  99, 105, 116, 
-    121,   0, 171, 171,   0,   0, 
-      3,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 105,  66, 108, 101, 
-    110, 100,  67, 111, 110, 102, 
-    105, 103,   0, 171, 171, 171, 
-      1,   0,  19,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  89, 
-    117, 118,  67, 111, 108, 111, 
-    114,  77,  97, 116, 114, 105, 
-    120,   0,   2,   0,   3,   0, 
-      3,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  76,  97, 121, 101, 114, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0,   3,   0, 
-      3,   0,   4,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  80, 114, 111, 
-    106, 101,  99, 116, 105, 111, 
-    110,   0, 118,  82, 101, 110, 
-    100, 101, 114,  84,  97, 114, 
-    103, 101, 116,  79, 102, 102, 
-    115, 101, 116,   0, 118,  84, 
-    101, 120, 116, 117, 114, 101, 
-     67, 111, 111, 114, 100, 115, 
-      0, 171,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  76,  97, 121, 101, 114, 
-     81, 117,  97, 100,   0, 109, 
-     77,  97, 115, 107,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0, 109,  66,  97,  99, 
-    107, 100, 114, 111, 112,  84, 
-    114,  97, 110, 115, 102, 111, 
-    114, 109,   0,  77, 105,  99, 
-    114, 111, 115, 111, 102, 116, 
-     32,  40,  82,  41,  32,  72, 
-     76,  83,  76,  32,  83, 104, 
-     97, 100, 101, 114,  32,  67, 
-    111, 109, 112, 105, 108, 101, 
-    114,  32,  49,  48,  46,  49, 
-      0, 171, 171, 171,  73,  83, 
-     71,  78, 104,   0,   0,   0, 
-      3,   0,   0,   0,   8,   0, 
-      0,   0,  80,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  15,   0, 
-      0,   0,  92,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      1,   0,   0,   0,   3,   0, 
-      0,   0,  92,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      2,   0,   0,   0,   7,   7, 
-      0,   0,  83,  86,  95,  80, 
-    111, 115, 105, 116, 105, 111, 
-    110,   0,  84,  69,  88,  67, 
-     79,  79,  82,  68,   0, 171, 
-    171, 171,  79,  83,  71,  78, 
-     44,   0,   0,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     83,  86,  95,  84,  97, 114, 
-    103, 101, 116,   0, 171, 171
-};
-ShaderBytes sSolidColorShaderMask = { SolidColorShaderMask, sizeof(SolidColorShaderMask) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tRGB                              texture  float4          2d             t0      1 
-// tMask                             texture  float4          2d             t5      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t0               
-// s1             s0              t5               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    dcl t0.xy
-    dcl t1.xyz
-    dcl_2d s0
-    dcl_2d s1
-    rcp r0.w, t1.z
-    mul r0.xy, r0.w, t1
-    texld r1, t0, s0
-    texld r0, r0, s1
-    mul r1.xyz, r1, c0.x
-    mov r1.w, c0.x
-    mul r0, r0.x, r1
-    mov oC0, r0
-
-// approximately 8 instruction slots used (2 texture, 6 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[2], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t0
-dcl_resource_texture2d (float,float,float,float) t5
-dcl_input_ps linear v1.xy
-dcl_input_ps linear v2.xyz
-dcl_output o0.xyzw
-dcl_temps 2
-sample r0.xyzw, v1.xyxx, t0.xyzw, s0
-mul r0.xyz, r0.xyzx, cb0[1].xxxx
-div r1.xy, v2.xyxx, v2.zzzz
-sample r1.xyzw, r1.xyxx, t5.xyzw, s0
-mov r0.w, cb0[1].x
-mul o0.xyzw, r0.xyzw, r1.xxxx
-ret 
-// Approximately 7 instruction slots used
-#endif
-
-const BYTE RGBShaderMask[] =
-{
-     68,  88,  66,  67, 124, 138, 
-     74, 104,  71, 169, 228, 139, 
-    154,   1,  86,  48, 221,  22, 
-    154,  18,   1,   0,   0,   0, 
-    144,   6,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-     36,   1,   0,   0,  88,   2, 
-      0,   0, 212,   2,   0,   0, 
-    236,   5,   0,   0,  92,   6, 
-      0,   0,  65, 111, 110,  57, 
-    228,   0,   0,   0, 228,   0, 
-      0,   0,   0,   2, 255, 255, 
-    172,   0,   0,   0,  56,   0, 
-      0,   0,   1,   0,  44,   0, 
-      0,   0,  56,   0,   0,   0, 
-     56,   0,   2,   0,  36,   0, 
-      0,   0,  56,   0,   0,   0, 
-      0,   0,   5,   0,   1,   0, 
-      0,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   2, 255, 255,  31,   0, 
-      0,   2,   0,   0,   0, 128, 
-      0,   0,   3, 176,  31,   0, 
-      0,   2,   0,   0,   0, 128, 
-      1,   0,   7, 176,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      0,   8,  15, 160,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      1,   8,  15, 160,   6,   0, 
-      0,   2,   0,   0,   8, 128, 
-      1,   0, 170, 176,   5,   0, 
-      0,   3,   0,   0,   3, 128, 
-      0,   0, 255, 128,   1,   0, 
-    228, 176,  66,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-    228, 176,   0,   8, 228, 160, 
-     66,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      1,   8, 228, 160,   5,   0, 
-      0,   3,   1,   0,   7, 128, 
-      1,   0, 228, 128,   0,   0, 
-      0, 160,   1,   0,   0,   2, 
-      1,   0,   8, 128,   0,   0, 
-      0, 160,   5,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-      0, 128,   1,   0, 228, 128, 
-      1,   0,   0,   2,   0,   8, 
-     15, 128,   0,   0, 228, 128, 
-    255, 255,   0,   0,  83,  72, 
-     68,  82,  44,   1,   0,   0, 
-     64,   0,   0,   0,  75,   0, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   2,   0,   0,   0, 
-     90,   0,   0,   3,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   0,   0,   0,   0, 
-     85,  85,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      5,   0,   0,   0,  85,  85, 
-      0,   0,  98,  16,   0,   3, 
-     50,  16,  16,   0,   1,   0, 
-      0,   0,  98,  16,   0,   3, 
-    114,  16,  16,   0,   2,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0, 104,   0,   0,   2, 
-      2,   0,   0,   0,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   0,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,   8, 114,   0,  16,   0, 
-      0,   0,   0,   0,  70,   2, 
-     16,   0,   0,   0,   0,   0, 
-      6, 128,  32,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     14,   0,   0,   7,  50,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  16,  16,   0,   2,   0, 
-      0,   0, 166,  26,  16,   0, 
-      2,   0,   0,   0,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      1,   0,   0,   0,  70,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   5,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,  54,   0, 
-      0,   6, 130,   0,  16,   0, 
-      0,   0,   0,   0,  10, 128, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   7, 242,  32,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-      6,   0,  16,   0,   1,   0, 
-      0,   0,  62,   0,   0,   1, 
-     83,  84,  65,  84, 116,   0, 
-      0,   0,   7,   0,   0,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  82,  68, 
-     69,  70,  16,   3,   0,   0, 
-      1,   0,   0,   0, 188,   0, 
-      0,   0,   4,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    255, 255,   0,   1,   0,   0, 
-    229,   2,   0,   0, 156,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    165,   0,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0, 170,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   5,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 176,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-    115,  83,  97, 109, 112, 108, 
-    101, 114,   0, 116,  82,  71, 
-     66,   0, 116,  77,  97, 115, 
-    107,   0,  36,  71, 108, 111, 
-     98,  97, 108, 115,   0, 171, 
-    171, 171, 176,   0,   0,   0, 
-     11,   0,   0,   0, 212,   0, 
-      0,   0, 144,   1,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 220,   1,   0,   0, 
-      0,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    232,   1,   0,   0,   0,   0, 
-      0,   0, 248,   1,   0,   0, 
-     16,   0,   0,   0,   4,   0, 
-      0,   0,   2,   0,   0,   0, 
-      8,   2,   0,   0,   0,   0, 
-      0,   0,  24,   2,   0,   0, 
-     32,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-     40,   2,   0,   0,   0,   0, 
-      0,   0,  56,   2,   0,   0, 
-     48,   0,   0,   0,  44,   0, 
-      0,   0,   0,   0,   0,   0, 
-     72,   2,   0,   0,   0,   0, 
-      0,   0,  88,   2,   0,   0, 
-     96,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 120,   2,   0,   0, 
-    160,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 132,   2,   0,   0, 
-    224,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    232,   1,   0,   0,   0,   0, 
-      0,   0, 152,   2,   0,   0, 
-    240,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    168,   2,   0,   0,   0,   0, 
-      0,   0, 184,   2,   0,   0, 
-      0,   1,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    168,   2,   0,   0,   0,   0, 
-      0,   0, 195,   2,   0,   0, 
-     16,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 210,   2,   0,   0, 
-     80,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 102,  76,  97, 121, 
-    101, 114,  67, 111, 108, 111, 
-    114,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     79, 112,  97,  99, 105, 116, 
-    121,   0, 171, 171,   0,   0, 
-      3,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 105,  66, 108, 101, 
-    110, 100,  67, 111, 110, 102, 
-    105, 103,   0, 171, 171, 171, 
-      1,   0,  19,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  89, 
-    117, 118,  67, 111, 108, 111, 
-    114,  77,  97, 116, 114, 105, 
-    120,   0,   2,   0,   3,   0, 
-      3,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  76,  97, 121, 101, 114, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0,   3,   0, 
-      3,   0,   4,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  80, 114, 111, 
-    106, 101,  99, 116, 105, 111, 
-    110,   0, 118,  82, 101, 110, 
-    100, 101, 114,  84,  97, 114, 
-    103, 101, 116,  79, 102, 102, 
-    115, 101, 116,   0, 118,  84, 
-    101, 120, 116, 117, 114, 101, 
-     67, 111, 111, 114, 100, 115, 
-      0, 171,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  76,  97, 121, 101, 114, 
-     81, 117,  97, 100,   0, 109, 
-     77,  97, 115, 107,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0, 109,  66,  97,  99, 
-    107, 100, 114, 111, 112,  84, 
-    114,  97, 110, 115, 102, 111, 
-    114, 109,   0,  77, 105,  99, 
-    114, 111, 115, 111, 102, 116, 
-     32,  40,  82,  41,  32,  72, 
-     76,  83,  76,  32,  83, 104, 
-     97, 100, 101, 114,  32,  67, 
-    111, 109, 112, 105, 108, 101, 
-    114,  32,  49,  48,  46,  49, 
-      0, 171, 171, 171,  73,  83, 
-     71,  78, 104,   0,   0,   0, 
-      3,   0,   0,   0,   8,   0, 
-      0,   0,  80,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  15,   0, 
-      0,   0,  92,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      1,   0,   0,   0,   3,   3, 
-      0,   0,  92,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      2,   0,   0,   0,   7,   7, 
-      0,   0,  83,  86,  95,  80, 
-    111, 115, 105, 116, 105, 111, 
-    110,   0,  84,  69,  88,  67, 
-     79,  79,  82,  68,   0, 171, 
-    171, 171,  79,  83,  71,  78, 
-     44,   0,   0,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     83,  86,  95,  84,  97, 114, 
-    103, 101, 116,   0, 171, 171
-};
-ShaderBytes sRGBShaderMask = { RGBShaderMask, sizeof(RGBShaderMask) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tRGB                              texture  float4          2d             t0      1 
-// tMask                             texture  float4          2d             t5      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t0               
-// s1             s0              t5               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    dcl t0.xy
-    dcl t1.xyz
-    dcl_2d s0
-    dcl_2d s1
-    rcp r0.w, t1.z
-    mul r0.xy, r0.w, t1
-    texld r1, t0, s0
-    texld r0, r0, s1
-    mul r1, r1, c0.x
-    mul r0, r0.x, r1
-    mov oC0, r0
-
-// approximately 7 instruction slots used (2 texture, 5 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[2], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t0
-dcl_resource_texture2d (float,float,float,float) t5
-dcl_input_ps linear v1.xy
-dcl_input_ps linear v2.xyz
-dcl_output o0.xyzw
-dcl_temps 2
-div r0.xy, v2.xyxx, v2.zzzz
-sample r0.xyzw, r0.xyxx, t5.xyzw, s0
-sample r1.xyzw, v1.xyxx, t0.xyzw, s0
-mul r1.xyzw, r1.xyzw, cb0[1].xxxx
-mul o0.xyzw, r0.xxxx, r1.xyzw
-ret 
-// Approximately 6 instruction slots used
-#endif
-
-const BYTE RGBAShaderMask[] =
-{
-     68,  88,  66,  67, 195, 156, 
-     68,  53, 118,  57,  21,  40, 
-    104, 132, 202, 230,  53, 208, 
-     14,  15,   1,   0,   0,   0, 
-    108,   6,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-     24,   1,   0,   0,  52,   2, 
-      0,   0, 176,   2,   0,   0, 
-    200,   5,   0,   0,  56,   6, 
-      0,   0,  65, 111, 110,  57, 
-    216,   0,   0,   0, 216,   0, 
-      0,   0,   0,   2, 255, 255, 
-    160,   0,   0,   0,  56,   0, 
-      0,   0,   1,   0,  44,   0, 
-      0,   0,  56,   0,   0,   0, 
-     56,   0,   2,   0,  36,   0, 
-      0,   0,  56,   0,   0,   0, 
-      0,   0,   5,   0,   1,   0, 
-      0,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   2, 255, 255,  31,   0, 
-      0,   2,   0,   0,   0, 128, 
-      0,   0,   3, 176,  31,   0, 
-      0,   2,   0,   0,   0, 128, 
-      1,   0,   7, 176,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      0,   8,  15, 160,  31,   0, 
-      0,   2,   0,   0,   0, 144, 
-      1,   8,  15, 160,   6,   0, 
-      0,   2,   0,   0,   8, 128, 
-      1,   0, 170, 176,   5,   0, 
-      0,   3,   0,   0,   3, 128, 
-      0,   0, 255, 128,   1,   0, 
-    228, 176,  66,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-    228, 176,   0,   8, 228, 160, 
-     66,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      1,   8, 228, 160,   5,   0, 
-      0,   3,   1,   0,  15, 128, 
-      1,   0, 228, 128,   0,   0, 
-      0, 160,   5,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-      0, 128,   1,   0, 228, 128, 
-      1,   0,   0,   2,   0,   8, 
-     15, 128,   0,   0, 228, 128, 
-    255, 255,   0,   0,  83,  72, 
-     68,  82,  20,   1,   0,   0, 
-     64,   0,   0,   0,  69,   0, 
-      0,   0,  89,   0,   0,   4, 
-     70, 142,  32,   0,   0,   0, 
-      0,   0,   2,   0,   0,   0, 
-     90,   0,   0,   3,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   0,   0,   0,   0, 
-     85,  85,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      5,   0,   0,   0,  85,  85, 
-      0,   0,  98,  16,   0,   3, 
-     50,  16,  16,   0,   1,   0, 
-      0,   0,  98,  16,   0,   3, 
-    114,  16,  16,   0,   2,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0, 104,   0,   0,   2, 
-      2,   0,   0,   0,  14,   0, 
-      0,   7,  50,   0,  16,   0, 
-      0,   0,   0,   0,  70,  16, 
-     16,   0,   2,   0,   0,   0, 
-    166,  26,  16,   0,   2,   0, 
-      0,   0,  69,   0,   0,   9, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,   0,  16,   0, 
-      0,   0,   0,   0,  70, 126, 
-     16,   0,   5,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  69,   0,   0,   9, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   0,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   8, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  70,  14,  16,   0, 
-      1,   0,   0,   0,   6, 128, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   7, 242,  32,  16,   0, 
-      0,   0,   0,   0,   6,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,  62,   0,   0,   1, 
-     83,  84,  65,  84, 116,   0, 
-      0,   0,   6,   0,   0,   0, 
-      2,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  82,  68, 
-     69,  70,  16,   3,   0,   0, 
-      1,   0,   0,   0, 188,   0, 
-      0,   0,   4,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    255, 255,   0,   1,   0,   0, 
-    229,   2,   0,   0, 156,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    165,   0,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0, 170,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   5,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 176,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-    115,  83,  97, 109, 112, 108, 
-    101, 114,   0, 116,  82,  71, 
-     66,   0, 116,  77,  97, 115, 
-    107,   0,  36,  71, 108, 111, 
-     98,  97, 108, 115,   0, 171, 
-    171, 171, 176,   0,   0,   0, 
-     11,   0,   0,   0, 212,   0, 
-      0,   0, 144,   1,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 220,   1,   0,   0, 
-      0,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    232,   1,   0,   0,   0,   0, 
-      0,   0, 248,   1,   0,   0, 
-     16,   0,   0,   0,   4,   0, 
-      0,   0,   2,   0,   0,   0, 
-      8,   2,   0,   0,   0,   0, 
-      0,   0,  24,   2,   0,   0, 
-     32,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-     40,   2,   0,   0,   0,   0, 
-      0,   0,  56,   2,   0,   0, 
-     48,   0,   0,   0,  44,   0, 
-      0,   0,   0,   0,   0,   0, 
-     72,   2,   0,   0,   0,   0, 
-      0,   0,  88,   2,   0,   0, 
-     96,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 120,   2,   0,   0, 
-    160,   0,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 132,   2,   0,   0, 
-    224,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    232,   1,   0,   0,   0,   0, 
-      0,   0, 152,   2,   0,   0, 
-    240,   0,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    168,   2,   0,   0,   0,   0, 
-      0,   0, 184,   2,   0,   0, 
-      0,   1,   0,   0,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-    168,   2,   0,   0,   0,   0, 
-      0,   0, 195,   2,   0,   0, 
-     16,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 210,   2,   0,   0, 
-     80,   1,   0,   0,  64,   0, 
-      0,   0,   0,   0,   0,   0, 
-    104,   2,   0,   0,   0,   0, 
-      0,   0, 102,  76,  97, 121, 
-    101, 114,  67, 111, 108, 111, 
-    114,   0,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     79, 112,  97,  99, 105, 116, 
-    121,   0, 171, 171,   0,   0, 
-      3,   0,   1,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 105,  66, 108, 101, 
-    110, 100,  67, 111, 110, 102, 
-    105, 103,   0, 171, 171, 171, 
-      1,   0,  19,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  89, 
-    117, 118,  67, 111, 108, 111, 
-    114,  77,  97, 116, 114, 105, 
-    120,   0,   2,   0,   3,   0, 
-      3,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  76,  97, 121, 101, 114, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0,   3,   0, 
-      3,   0,   4,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  80, 114, 111, 
-    106, 101,  99, 116, 105, 111, 
-    110,   0, 118,  82, 101, 110, 
-    100, 101, 114,  84,  97, 114, 
-    103, 101, 116,  79, 102, 102, 
-    115, 101, 116,   0, 118,  84, 
-    101, 120, 116, 117, 114, 101, 
-     67, 111, 111, 114, 100, 115, 
-      0, 171,   1,   0,   3,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    118,  76,  97, 121, 101, 114, 
-     81, 117,  97, 100,   0, 109, 
-     77,  97, 115, 107,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0, 109,  66,  97,  99, 
-    107, 100, 114, 111, 112,  84, 
-    114,  97, 110, 115, 102, 111, 
-    114, 109,   0,  77, 105,  99, 
-    114, 111, 115, 111, 102, 116, 
-     32,  40,  82,  41,  32,  72, 
-     76,  83,  76,  32,  83, 104, 
-     97, 100, 101, 114,  32,  67, 
-    111, 109, 112, 105, 108, 101, 
-    114,  32,  49,  48,  46,  49, 
-      0, 171, 171, 171,  73,  83, 
-     71,  78, 104,   0,   0,   0, 
-      3,   0,   0,   0,   8,   0, 
-      0,   0,  80,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  15,   0, 
-      0,   0,  92,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      1,   0,   0,   0,   3,   3, 
-      0,   0,  92,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      2,   0,   0,   0,   7,   7, 
-      0,   0,  83,  86,  95,  80, 
-    111, 115, 105, 116, 105, 111, 
-    110,   0,  84,  69,  88,  67, 
-     79,  79,  82,  68,   0, 171, 
-    171, 171,  79,  83,  71,  78, 
-     44,   0,   0,   0,   1,   0, 
-      0,   0,   8,   0,   0,   0, 
-     32,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     83,  86,  95,  84,  97, 114, 
-    103, 101, 116,   0, 171, 171
-};
-ShaderBytes sRGBAShaderMask = { RGBAShaderMask, sizeof(RGBAShaderMask) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tY                                texture  float4          2d             t1      1 
-// tCb                               texture  float4          2d             t2      1 
-// tCr                               texture  float4          2d             t3      1 
-// tMask                             texture  float4          2d             t5      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-// c1         cb0             3         3  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t1               
-// s1             s0              t2               
-// s2             s0              t3               
-// s3             s0              t5               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    def c4, -0.0627499968, -0.50195998, 1, 0
-    dcl t0.xy
-    dcl t1.xyz
-    dcl_2d s0
-    dcl_2d s1
-    dcl_2d s2
-    dcl_2d s3
-    mov r0.w, c4.z
-    texld r1, t0, s1
-    texld r2, t0, s0
-    add r2.x, r2.x, c4.x
-    add r2.y, r1.x, c4.y
-    rcp r2.w, t1.z
-    mul r1.xy, r2.w, t1
-    texld r3, t0, s2
-    texld r1, r1, s3
-    add r2.z, r3.x, c4.y
-    dp3 r0.x, c1, r2
-    dp3 r0.y, c2, r2
-    dp3 r0.z, c3, r2
-    mul r0, r0, c0.x
-    mul r0, r1.x, r0
-    mov oC0, r0
-
-// approximately 16 instruction slots used (4 texture, 12 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[6], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t1
-dcl_resource_texture2d (float,float,float,float) t2
-dcl_resource_texture2d (float,float,float,float) t3
-dcl_resource_texture2d (float,float,float,float) t5
-dcl_input_ps linear v1.xy
-dcl_input_ps linear v2.xyz
-dcl_output o0.xyzw
-dcl_temps 3
-mov r0.w, l(1.000000)
-sample r1.xyzw, v1.xyxx, t1.xyzw, s0
-add r1.x, r1.x, l(-0.062750)
-sample r2.xyzw, v1.xyxx, t2.xyzw, s0
-add r1.y, r2.x, l(-0.501960)
-sample r2.xyzw, v1.xyxx, t3.xyzw, s0
-add r1.z, r2.x, l(-0.501960)
-dp3 r0.x, cb0[3].xyzx, r1.xyzx
-dp3 r0.y, cb0[4].xyzx, r1.xyzx
-dp3 r0.z, cb0[5].xyzx, r1.xyzx
-mul r0.xyzw, r0.xyzw, cb0[1].xxxx
-div r1.xy, v2.xyxx, v2.zzzz
-sample r1.xyzw, r1.xyxx, t5.xyzw, s0
-mul o0.xyzw, r0.xyzw, r1.xxxx
-ret 
-// Approximately 15 instruction slots used
-#endif
-
-const BYTE YCbCrShaderMask[] =
-{
-     68,  88,  66,  67, 198,  45, 
-    222, 137, 253, 124,  14,  38, 
-    179, 174, 218,  37,  60, 100, 
-    152, 197,   1,   0,   0,   0, 
-    176,   8,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    232,   1,   0,   0,  52,   4, 
-      0,   0, 176,   4,   0,   0, 
-     12,   8,   0,   0, 124,   8, 
-      0,   0,  65, 111, 110,  57, 
-    168,   1,   0,   0, 168,   1, 
-      0,   0,   0,   2, 255, 255, 
-     92,   1,   0,   0,  76,   0, 
-      0,   0,   2,   0,  52,   0, 
-      0,   0,  76,   0,   0,   0, 
-     76,   0,   4,   0,  36,   0, 
-      0,   0,  76,   0,   1,   0, 
-      0,   0,   2,   0,   1,   0, 
-      3,   0,   2,   0,   5,   0, 
-      3,   0,   0,   0,   1,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      3,   0,   1,   0,   0,   0, 
-      0,   0,   1,   2, 255, 255, 
-     81,   0,   0,   5,   4,   0, 
-     15, 160,  18, 131, 128, 189, 
-    115, 128,   0, 191,   0,   0, 
-    128,  63,   0,   0,   0,   0, 
-     31,   0,   0,   2,   0,   0, 
-      0, 128,   0,   0,   3, 176, 
-     31,   0,   0,   2,   0,   0, 
-      0, 128,   1,   0,   7, 176, 
-     31,   0,   0,   2,   0,   0, 
-      0, 144,   0,   8,  15, 160, 
-     31,   0,   0,   2,   0,   0, 
-      0, 144,   1,   8,  15, 160, 
-     31,   0,   0,   2,   0,   0, 
-      0, 144,   2,   8,  15, 160, 
-     31,   0,   0,   2,   0,   0, 
-      0, 144,   3,   8,  15, 160, 
-      1,   0,   0,   2,   0,   0, 
-      8, 128,   4,   0, 170, 160, 
-     66,   0,   0,   3,   1,   0, 
-     15, 128,   0,   0, 228, 176, 
-      1,   8, 228, 160,  66,   0, 
-      0,   3,   2,   0,  15, 128, 
-      0,   0, 228, 176,   0,   8, 
-    228, 160,   2,   0,   0,   3, 
-      2,   0,   1, 128,   2,   0, 
-      0, 128,   4,   0,   0, 160, 
-      2,   0,   0,   3,   2,   0, 
-      2, 128,   1,   0,   0, 128, 
-      4,   0,  85, 160,   6,   0, 
-      0,   2,   2,   0,   8, 128, 
-      1,   0, 170, 176,   5,   0, 
-      0,   3,   1,   0,   3, 128, 
-      2,   0, 255, 128,   1,   0, 
-    228, 176,  66,   0,   0,   3, 
-      3,   0,  15, 128,   0,   0, 
-    228, 176,   2,   8, 228, 160, 
-     66,   0,   0,   3,   1,   0, 
-     15, 128,   1,   0, 228, 128, 
-      3,   8, 228, 160,   2,   0, 
-      0,   3,   2,   0,   4, 128, 
-      3,   0,   0, 128,   4,   0, 
-     85, 160,   8,   0,   0,   3, 
-      0,   0,   1, 128,   1,   0, 
-    228, 160,   2,   0, 228, 128, 
-      8,   0,   0,   3,   0,   0, 
-      2, 128,   2,   0, 228, 160, 
-      2,   0, 228, 128,   8,   0, 
-      0,   3,   0,   0,   4, 128, 
-      3,   0, 228, 160,   2,   0, 
-    228, 128,   5,   0,   0,   3, 
-      0,   0,  15, 128,   0,   0, 
-    228, 128,   0,   0,   0, 160, 
-      5,   0,   0,   3,   0,   0, 
-     15, 128,   1,   0,   0, 128, 
-      0,   0, 228, 128,   1,   0, 
-      0,   2,   0,   8,  15, 128, 
-      0,   0, 228, 128, 255, 255, 
-      0,   0,  83,  72,  68,  82, 
-     68,   2,   0,   0,  64,   0, 
-      0,   0, 145,   0,   0,   0, 
-     89,   0,   0,   4,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      6,   0,   0,   0,  90,   0, 
-      0,   3,   0,  96,  16,   0, 
-      0,   0,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      1,   0,   0,   0,  85,  85, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   2,   0, 
-      0,   0,  85,  85,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   3,   0,   0,   0, 
-     85,  85,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      5,   0,   0,   0,  85,  85, 
-      0,   0,  98,  16,   0,   3, 
-     50,  16,  16,   0,   1,   0, 
-      0,   0,  98,  16,   0,   3, 
-    114,  16,  16,   0,   2,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0, 104,   0,   0,   2, 
-      3,   0,   0,   0,  54,   0, 
-      0,   5, 130,   0,  16,   0, 
-      0,   0,   0,   0,   1,  64, 
-      0,   0,   0,   0, 128,  63, 
-     69,   0,   0,   9, 242,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  16,  16,   0,   1,   0, 
-      0,   0,  70, 126,  16,   0, 
-      1,   0,   0,   0,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,   0,   7,  18,   0, 
-     16,   0,   1,   0,   0,   0, 
-     10,   0,  16,   0,   1,   0, 
-      0,   0,   1,  64,   0,   0, 
-     18, 131, 128, 189,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      2,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   2,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   7,  34,   0,  16,   0, 
-      1,   0,   0,   0,  10,   0, 
-     16,   0,   2,   0,   0,   0, 
-      1,  64,   0,   0, 115, 128, 
-      0, 191,  69,   0,   0,   9, 
-    242,   0,  16,   0,   2,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   3,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   7, 
-     66,   0,  16,   0,   1,   0, 
-      0,   0,  10,   0,  16,   0, 
-      2,   0,   0,   0,   1,  64, 
-      0,   0, 115, 128,   0, 191, 
-     16,   0,   0,   8,  18,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 130,  32,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-     70,   2,  16,   0,   1,   0, 
-      0,   0,  16,   0,   0,   8, 
-     34,   0,  16,   0,   0,   0, 
-      0,   0,  70, 130,  32,   0, 
-      0,   0,   0,   0,   4,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,  16,   0, 
-      0,   8,  66,   0,  16,   0, 
-      0,   0,   0,   0,  70, 130, 
-     32,   0,   0,   0,   0,   0, 
-      5,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-     56,   0,   0,   8, 242,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   0,   0, 
-      0,   0,   6, 128,  32,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,  14,   0,   0,   7, 
-     50,   0,  16,   0,   1,   0, 
-      0,   0,  70,  16,  16,   0, 
-      2,   0,   0,   0, 166,  26, 
-     16,   0,   2,   0,   0,   0, 
-     69,   0,   0,   9, 242,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,   0,  16,   0,   1,   0, 
-      0,   0,  70, 126,  16,   0, 
-      5,   0,   0,   0,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-     56,   0,   0,   7, 242,  32, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   0,   0, 
-      0,   0,   6,   0,  16,   0, 
-      1,   0,   0,   0,  62,   0, 
-      0,   1,  83,  84,  65,  84, 
-    116,   0,   0,   0,  15,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   9,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     82,  68,  69,  70,  84,   3, 
-      0,   0,   1,   0,   0,   0, 
-      0,   1,   0,   0,   6,   0, 
-      0,   0,  28,   0,   0,   0, 
-      0,   4, 255, 255,   0,   1, 
-      0,   0,  41,   3,   0,   0, 
-    220,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   1,   0, 
-      0,   0, 229,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 232,   0, 
-      0,   0,   2,   0,   0,   0, 
-      5,   0,   0,   0,   4,   0, 
-      0,   0, 255, 255, 255, 255, 
-      2,   0,   0,   0,   1,   0, 
-      0,   0,  13,   0,   0,   0, 
-    236,   0,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   3,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0, 240,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   5,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 246,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-    115,  83,  97, 109, 112, 108, 
-    101, 114,   0, 116,  89,   0, 
-    116,  67,  98,   0, 116,  67, 
-    114,   0, 116,  77,  97, 115, 
-    107,   0,  36,  71, 108, 111, 
-     98,  97, 108, 115,   0, 171, 
-    246,   0,   0,   0,  11,   0, 
-      0,   0,  24,   1,   0,   0, 
-    144,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-     32,   2,   0,   0,   0,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  44,   2, 
-      0,   0,   0,   0,   0,   0, 
-     60,   2,   0,   0,  16,   0, 
-      0,   0,   4,   0,   0,   0, 
-      2,   0,   0,   0,  76,   2, 
-      0,   0,   0,   0,   0,   0, 
-     92,   2,   0,   0,  32,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 108,   2, 
-      0,   0,   0,   0,   0,   0, 
-    124,   2,   0,   0,  48,   0, 
-      0,   0,  44,   0,   0,   0, 
-      2,   0,   0,   0, 140,   2, 
-      0,   0,   0,   0,   0,   0, 
-    156,   2,   0,   0,  96,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 172,   2, 
-      0,   0,   0,   0,   0,   0, 
-    188,   2,   0,   0, 160,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 172,   2, 
-      0,   0,   0,   0,   0,   0, 
-    200,   2,   0,   0, 224,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  44,   2, 
-      0,   0,   0,   0,   0,   0, 
-    220,   2,   0,   0, 240,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 236,   2, 
-      0,   0,   0,   0,   0,   0, 
-    252,   2,   0,   0,   0,   1, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 236,   2, 
-      0,   0,   0,   0,   0,   0, 
-      7,   3,   0,   0,  16,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 172,   2, 
-      0,   0,   0,   0,   0,   0, 
-     22,   3,   0,   0,  80,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 172,   2, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     67, 111, 108, 111, 114,   0, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  79, 112, 
-     97,  99, 105, 116, 121,   0, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0, 118,  84, 101, 120, 
-    116, 117, 114, 101,  67, 111, 
-    111, 114, 100, 115,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 118,  76, 
-     97, 121, 101, 114,  81, 117, 
-     97, 100,   0, 109,  77,  97, 
-    115, 107,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-    109,  66,  97,  99, 107, 100, 
-    114, 111, 112,  84, 114,  97, 
-    110, 115, 102, 111, 114, 109, 
-      0,  77, 105,  99, 114, 111, 
-    115, 111, 102, 116,  32,  40, 
-     82,  41,  32,  72,  76,  83, 
-     76,  32,  83, 104,  97, 100, 
-    101, 114,  32,  67, 111, 109, 
-    112, 105, 108, 101, 114,  32, 
-     49,  48,  46,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-    104,   0,   0,   0,   3,   0, 
-      0,   0,   8,   0,   0,   0, 
-     80,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     92,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     92,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   2,   0, 
-      0,   0,   7,   7,   0,   0, 
-     83,  86,  95,  80, 111, 115, 
-    105, 116, 105, 111, 110,   0, 
-     84,  69,  88,  67,  79,  79, 
-     82,  68,   0, 171, 171, 171, 
-     79,  83,  71,  78,  44,   0, 
-      0,   0,   1,   0,   0,   0, 
-      8,   0,   0,   0,  32,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  83,  86, 
-     95,  84,  97, 114, 103, 101, 
-    116,   0, 171, 171
-};
-ShaderBytes sYCbCrShaderMask = { YCbCrShaderMask, sizeof(YCbCrShaderMask) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tY                                texture  float4          2d             t1      1 
-// tCb                               texture  float4          2d             t2      1 
-// tMask                             texture  float4          2d             t5      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-// c1         cb0             3         3  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t1               
-// s1             s0              t2               
-// s2             s0              t5               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    def c4, -0.0627499968, -0.50195998, 1, 0
-    dcl t0.xy
-    dcl t1.xyz
-    dcl_2d s0
-    dcl_2d s1
-    dcl_2d s2
-    mov r0.w, c4.z
-    texld r1, t0, s1
-    texld r2, t0, s0
-    add r2.x, r2.x, c4.x
-    add r2.yz, r1.xxyw, c4.y
-    dp3 r0.x, c1, r2
-    dp3 r0.y, c2, r2
-    dp3 r0.z, c3, r2
-    mul r0, r0, c0.x
-    rcp r1.x, t1.z
-    mul r1.xy, r1.x, t1
-    texld r1, r1, s2
-    mul r0, r0, r1.x
-    mov oC0, r0
-
-// approximately 14 instruction slots used (3 texture, 11 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[6], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t1
-dcl_resource_texture2d (float,float,float,float) t2
-dcl_resource_texture2d (float,float,float,float) t5
-dcl_input_ps linear v1.xy
-dcl_input_ps linear v2.xyz
-dcl_output o0.xyzw
-dcl_temps 3
-mov r0.w, l(1.000000)
-sample r1.xyzw, v1.xyxx, t1.xyzw, s0
-add r1.x, r1.x, l(-0.062750)
-sample r2.xyzw, v1.xyxx, t2.xyzw, s0
-add r1.yz, r2.xxyx, l(0.000000, -0.501960, -0.501960, 0.000000)
-dp3 r0.x, cb0[3].xyzx, r1.xyzx
-dp3 r0.y, cb0[4].xyzx, r1.xyzx
-dp3 r0.z, cb0[5].xyzx, r1.xyzx
-mul r0.xyzw, r0.xyzw, cb0[1].xxxx
-div r1.xy, v2.xyxx, v2.zzzz
-sample r1.xyzw, r1.xyxx, t5.xyzw, s0
-mul o0.xyzw, r0.xyzw, r1.xxxx
-ret 
-// Approximately 13 instruction slots used
-#endif
-
-const BYTE NV12ShaderMask[] =
-{
-     68,  88,  66,  67, 225, 251, 
-    182, 201,  43, 219,  84,  65, 
-    169, 202, 234,  24, 151, 167, 
-     30, 254,   1,   0,   0,   0, 
-     24,   8,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    184,   1,   0,   0, 192,   3, 
-      0,   0,  60,   4,   0,   0, 
-    116,   7,   0,   0, 228,   7, 
-      0,   0,  65, 111, 110,  57, 
-    120,   1,   0,   0, 120,   1, 
-      0,   0,   0,   2, 255, 255, 
-     48,   1,   0,   0,  72,   0, 
-      0,   0,   2,   0,  48,   0, 
-      0,   0,  72,   0,   0,   0, 
-     72,   0,   3,   0,  36,   0, 
-      0,   0,  72,   0,   1,   0, 
-      0,   0,   2,   0,   1,   0, 
-      5,   0,   2,   0,   0,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   3,   0,   1,   0, 
-      0,   0,   0,   0,   1,   2, 
-    255, 255,  81,   0,   0,   5, 
-      4,   0,  15, 160,  18, 131, 
-    128, 189, 115, 128,   0, 191, 
-      0,   0, 128,  63,   0,   0, 
-      0,   0,  31,   0,   0,   2, 
-      0,   0,   0, 128,   0,   0, 
-      3, 176,  31,   0,   0,   2, 
-      0,   0,   0, 128,   1,   0, 
-      7, 176,  31,   0,   0,   2, 
-      0,   0,   0, 144,   0,   8, 
-     15, 160,  31,   0,   0,   2, 
-      0,   0,   0, 144,   1,   8, 
-     15, 160,  31,   0,   0,   2, 
-      0,   0,   0, 144,   2,   8, 
-     15, 160,   1,   0,   0,   2, 
-      0,   0,   8, 128,   4,   0, 
-    170, 160,  66,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-    228, 176,   1,   8, 228, 160, 
-     66,   0,   0,   3,   2,   0, 
-     15, 128,   0,   0, 228, 176, 
-      0,   8, 228, 160,   2,   0, 
-      0,   3,   2,   0,   1, 128, 
-      2,   0,   0, 128,   4,   0, 
-      0, 160,   2,   0,   0,   3, 
-      2,   0,   6, 128,   1,   0, 
-    208, 128,   4,   0,  85, 160, 
-      8,   0,   0,   3,   0,   0, 
-      1, 128,   1,   0, 228, 160, 
-      2,   0, 228, 128,   8,   0, 
-      0,   3,   0,   0,   2, 128, 
-      2,   0, 228, 160,   2,   0, 
-    228, 128,   8,   0,   0,   3, 
-      0,   0,   4, 128,   3,   0, 
-    228, 160,   2,   0, 228, 128, 
-      5,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      0,   0,   0, 160,   6,   0, 
-      0,   2,   1,   0,   1, 128, 
-      1,   0, 170, 176,   5,   0, 
-      0,   3,   1,   0,   3, 128, 
-      1,   0,   0, 128,   1,   0, 
-    228, 176,  66,   0,   0,   3, 
-      1,   0,  15, 128,   1,   0, 
-    228, 128,   2,   8, 228, 160, 
-      5,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      1,   0,   0, 128,   1,   0, 
-      0,   2,   0,   8,  15, 128, 
-      0,   0, 228, 128, 255, 255, 
-      0,   0,  83,  72,  68,  82, 
-      0,   2,   0,   0,  64,   0, 
-      0,   0, 128,   0,   0,   0, 
-     89,   0,   0,   4,  70, 142, 
-     32,   0,   0,   0,   0,   0, 
-      6,   0,   0,   0,  90,   0, 
-      0,   3,   0,  96,  16,   0, 
-      0,   0,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      1,   0,   0,   0,  85,  85, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   2,   0, 
-      0,   0,  85,  85,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   5,   0,   0,   0, 
-     85,  85,   0,   0,  98,  16, 
-      0,   3,  50,  16,  16,   0, 
-      1,   0,   0,   0,  98,  16, 
-      0,   3, 114,  16,  16,   0, 
-      2,   0,   0,   0, 101,   0, 
-      0,   3, 242,  32,  16,   0, 
-      0,   0,   0,   0, 104,   0, 
-      0,   2,   3,   0,   0,   0, 
-     54,   0,   0,   5, 130,   0, 
-     16,   0,   0,   0,   0,   0, 
-      1,  64,   0,   0,   0,   0, 
-    128,  63,  69,   0,   0,   9, 
-    242,   0,  16,   0,   1,   0, 
-      0,   0,  70,  16,  16,   0, 
-      1,   0,   0,   0,  70, 126, 
-     16,   0,   1,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,   0,   0,   0,   7, 
-     18,   0,  16,   0,   1,   0, 
-      0,   0,  10,   0,  16,   0, 
-      1,   0,   0,   0,   1,  64, 
-      0,   0,  18, 131, 128, 189, 
-     69,   0,   0,   9, 242,   0, 
-     16,   0,   2,   0,   0,   0, 
-     70,  16,  16,   0,   1,   0, 
-      0,   0,  70, 126,  16,   0, 
-      2,   0,   0,   0,   0,  96, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,   0,  10,  98,   0, 
-     16,   0,   1,   0,   0,   0, 
-      6,   1,  16,   0,   2,   0, 
-      0,   0,   2,  64,   0,   0, 
-      0,   0,   0,   0, 115, 128, 
-      0, 191, 115, 128,   0, 191, 
-      0,   0,   0,   0,  16,   0, 
-      0,   8,  18,   0,  16,   0, 
-      0,   0,   0,   0,  70, 130, 
-     32,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,  70,   2, 
-     16,   0,   1,   0,   0,   0, 
-     16,   0,   0,   8,  34,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70, 130,  32,   0,   0,   0, 
-      0,   0,   4,   0,   0,   0, 
-     70,   2,  16,   0,   1,   0, 
-      0,   0,  16,   0,   0,   8, 
-     66,   0,  16,   0,   0,   0, 
-      0,   0,  70, 130,  32,   0, 
-      0,   0,   0,   0,   5,   0, 
-      0,   0,  70,   2,  16,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   8, 242,   0,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-      6, 128,  32,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-     14,   0,   0,   7,  50,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  16,  16,   0,   2,   0, 
-      0,   0, 166,  26,  16,   0, 
-      2,   0,   0,   0,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      1,   0,   0,   0,  70,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   5,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,  56,   0, 
-      0,   7, 242,  32,  16,   0, 
-      0,   0,   0,   0,  70,  14, 
-     16,   0,   0,   0,   0,   0, 
-      6,   0,  16,   0,   1,   0, 
-      0,   0,  62,   0,   0,   1, 
-     83,  84,  65,  84, 116,   0, 
-      0,   0,  13,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      8,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  82,  68, 
-     69,  70,  48,   3,   0,   0, 
-      1,   0,   0,   0, 220,   0, 
-      0,   0,   5,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    255, 255,   0,   1,   0,   0, 
-      5,   3,   0,   0, 188,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    197,   0,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   1,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0, 200,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   2,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 204,   0, 
-      0,   0,   2,   0,   0,   0, 
-      5,   0,   0,   0,   4,   0, 
-      0,   0, 255, 255, 255, 255, 
-      5,   0,   0,   0,   1,   0, 
-      0,   0,  13,   0,   0,   0, 
-    210,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0, 115,  83,  97, 109, 
-    112, 108, 101, 114,   0, 116, 
-     89,   0, 116,  67,  98,   0, 
-    116,  77,  97, 115, 107,   0, 
-     36,  71, 108, 111,  98,  97, 
-    108, 115,   0, 171, 210,   0, 
-      0,   0,  11,   0,   0,   0, 
-    244,   0,   0,   0, 144,   1, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 252,   1, 
-      0,   0,   0,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,   8,   2,   0,   0, 
-      0,   0,   0,   0,  24,   2, 
-      0,   0,  16,   0,   0,   0, 
-      4,   0,   0,   0,   2,   0, 
-      0,   0,  40,   2,   0,   0, 
-      0,   0,   0,   0,  56,   2, 
-      0,   0,  32,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,  72,   2,   0,   0, 
-      0,   0,   0,   0,  88,   2, 
-      0,   0,  48,   0,   0,   0, 
-     44,   0,   0,   0,   2,   0, 
-      0,   0, 104,   2,   0,   0, 
-      0,   0,   0,   0, 120,   2, 
-      0,   0,  96,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 136,   2,   0,   0, 
-      0,   0,   0,   0, 152,   2, 
-      0,   0, 160,   0,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 136,   2,   0,   0, 
-      0,   0,   0,   0, 164,   2, 
-      0,   0, 224,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0,   8,   2,   0,   0, 
-      0,   0,   0,   0, 184,   2, 
-      0,   0, 240,   0,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 200,   2,   0,   0, 
-      0,   0,   0,   0, 216,   2, 
-      0,   0,   0,   1,   0,   0, 
-     16,   0,   0,   0,   0,   0, 
-      0,   0, 200,   2,   0,   0, 
-      0,   0,   0,   0, 227,   2, 
-      0,   0,  16,   1,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 136,   2,   0,   0, 
-      0,   0,   0,   0, 242,   2, 
-      0,   0,  80,   1,   0,   0, 
-     64,   0,   0,   0,   0,   0, 
-      0,   0, 136,   2,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  67, 111, 
-    108, 111, 114,   0,   1,   0, 
-      3,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 102,  76,  97, 121, 
-    101, 114,  79, 112,  97,  99, 
-    105, 116, 121,   0, 171, 171, 
-      0,   0,   3,   0,   1,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 105,  66, 
-    108, 101, 110, 100,  67, 111, 
-    110, 102, 105, 103,   0, 171, 
-    171, 171,   1,   0,  19,   0, 
-      1,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  89, 117, 118,  67, 111, 
-    108, 111, 114,  77,  97, 116, 
-    114, 105, 120,   0,   2,   0, 
-      3,   0,   3,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  76,  97, 121, 
-    101, 114,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-      3,   0,   3,   0,   4,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  80, 
-    114, 111, 106, 101,  99, 116, 
-    105, 111, 110,   0, 118,  82, 
-    101, 110, 100, 101, 114,  84, 
-     97, 114, 103, 101, 116,  79, 
-    102, 102, 115, 101, 116,   0, 
-    118,  84, 101, 120, 116, 117, 
-    114, 101,  67, 111, 111, 114, 
-    100, 115,   0, 171,   1,   0, 
-      3,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 118,  76,  97, 121, 
-    101, 114,  81, 117,  97, 100, 
-      0, 109,  77,  97, 115, 107, 
-     84, 114,  97, 110, 115, 102, 
-    111, 114, 109,   0, 109,  66, 
-     97,  99, 107, 100, 114, 111, 
-    112,  84, 114,  97, 110, 115, 
-    102, 111, 114, 109,   0,  77, 
-    105,  99, 114, 111, 115, 111, 
-    102, 116,  32,  40,  82,  41, 
-     32,  72,  76,  83,  76,  32, 
-     83, 104,  97, 100, 101, 114, 
-     32,  67, 111, 109, 112, 105, 
-    108, 101, 114,  32,  49,  48, 
-     46,  49,   0, 171, 171, 171, 
-     73,  83,  71,  78, 104,   0, 
-      0,   0,   3,   0,   0,   0, 
-      8,   0,   0,   0,  80,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-     15,   0,   0,   0,  92,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   3,   0,   0,  92,   0, 
-      0,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   2,   0,   0,   0, 
-      7,   7,   0,   0,  83,  86, 
-     95,  80, 111, 115, 105, 116, 
-    105, 111, 110,   0,  84,  69, 
-     88,  67,  79,  79,  82,  68, 
-      0, 171, 171, 171,  79,  83, 
-     71,  78,  44,   0,   0,   0, 
-      1,   0,   0,   0,   8,   0, 
-      0,   0,  32,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,  15,   0, 
-      0,   0,  83,  86,  95,  84, 
-     97, 114, 103, 101, 116,   0, 
-    171, 171
-};
-ShaderBytes sNV12ShaderMask = { NV12ShaderMask, sizeof(NV12ShaderMask) };
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 10.1
-//
-//
-// Buffer Definitions: 
-//
-// cbuffer $Globals
-// {
-//
-//   float4 fLayerColor;                // Offset:    0 Size:    16 [unused]
-//   float fLayerOpacity;               // Offset:   16 Size:     4
-//   uint4 iBlendConfig;                // Offset:   32 Size:    16 [unused]
-//   row_major float3x3 mYuvColorMatrix;// Offset:   48 Size:    44 [unused]
-//   float4x4 mLayerTransform;          // Offset:   96 Size:    64 [unused]
-//   float4x4 mProjection;              // Offset:  160 Size:    64 [unused]
-//   float4 vRenderTargetOffset;        // Offset:  224 Size:    16 [unused]
-//   float4 vTextureCoords;             // Offset:  240 Size:    16 [unused]
-//   float4 vLayerQuad;                 // Offset:  256 Size:    16 [unused]
-//   float4x4 mMaskTransform;           // Offset:  272 Size:    64 [unused]
-//   float4x4 mBackdropTransform;       // Offset:  336 Size:    64 [unused]
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name                                 Type  Format         Dim      HLSL Bind  Count
-// ------------------------------ ---------- ------- ----------- -------------- ------
-// sSampler                          sampler      NA          NA             s0      1 
-// tRGB                              texture  float4          2d             t0      1 
-// tRGBWhite                         texture  float4          2d             t4      1 
-// tMask                             texture  float4          2d             t5      1 
-// $Globals                          cbuffer      NA          NA            cb0      1 
-//
-//
-//
-// Input signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Position              0   xyzw        0      POS   float       
-// TEXCOORD                 0   xy          1     NONE   float   xy  
-// TEXCOORD                 1   xyz         2     NONE   float   xyz 
-//
-//
-// Output signature:
-//
-// Name                 Index   Mask Register SysValue  Format   Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_Target                0   xyzw        0   TARGET   float   xyzw
-// SV_Target                1   xyzw        1   TARGET   float   xyzw
-//
-//
-// Constant buffer to DX9 shader constant mappings:
-//
-// Target Reg Buffer  Start Reg # of Regs        Data Conversion
-// ---------- ------- --------- --------- ----------------------
-// c0         cb0             1         1  ( FLT, FLT, FLT, FLT)
-//
-//
-// Sampler/Resource to DX9 shader sampler mappings:
-//
-// Target Sampler Source Sampler  Source Resource
-// -------------- --------------- ----------------
-// s0             s0              t0               
-// s1             s0              t4               
-// s2             s0              t5               
-//
-//
-// Level9 shader bytecode:
-//
-    ps_2_x
-    def c1, 1, 0, 0, 0
-    dcl t0.xy
-    dcl t1.xyz
-    dcl_2d s0
-    dcl_2d s1
-    dcl_2d s2
-    rcp r0.w, t1.z
-    mul r0.xy, r0.w, t1
-    texld r0, r0, s2
-    mul r0.x, r0.x, c0.x
-    texld r1, t0, s0
-    texld r2, t0, s1
-    add r2, r1, -r2
-    add r2, r2, c1.x
-    mov r1.w, r2.y
-    mul r2, r0.x, r2
-    mul r0, r0.x, r1
-    mov oC0, r0
-    mov oC1, r2
-
-// approximately 13 instruction slots used (3 texture, 10 arithmetic)
-ps_4_0
-dcl_constantbuffer CB0[2], immediateIndexed
-dcl_sampler s0, mode_default
-dcl_resource_texture2d (float,float,float,float) t0
-dcl_resource_texture2d (float,float,float,float) t4
-dcl_resource_texture2d (float,float,float,float) t5
-dcl_input_ps linear v1.xy
-dcl_input_ps linear v2.xyz
-dcl_output o0.xyzw
-dcl_output o1.xyzw
-dcl_temps 3
-div r0.xy, v2.xyxx, v2.zzzz
-sample r0.xyzw, r0.xyxx, t5.xyzw, s0
-mul r0.x, r0.x, cb0[1].x
-sample r1.xyzw, v1.xyxx, t4.xyzw, s0
-sample r2.xyzw, v1.xyxx, t0.xyzw, s0
-add r1.xyzw, -r1.xyzw, r2.xyzw
-add r1.xyzw, r1.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
-mov r2.w, r1.y
-mul o1.xyzw, r0.xxxx, r1.xyzw
-mul o0.xyzw, r0.xxxx, r2.xyzw
-ret 
-// Approximately 11 instruction slots used
-#endif
-
-const BYTE ComponentAlphaShaderMask[] =
-{
-     68,  88,  66,  67, 199,  32, 
-    192, 240, 187, 195,  33, 234, 
-     91,  15, 165, 212,  46, 102, 
-     50, 248,   1,   0,   0,   0, 
-    228,   7,   0,   0,   6,   0, 
-      0,   0,  56,   0,   0,   0, 
-    152,   1,   0,   0, 108,   3, 
-      0,   0, 232,   3,   0,   0, 
-     40,   7,   0,   0, 152,   7, 
-      0,   0,  65, 111, 110,  57, 
-     88,   1,   0,   0,  88,   1, 
-      0,   0,   0,   2, 255, 255, 
-     28,   1,   0,   0,  60,   0, 
-      0,   0,   1,   0,  48,   0, 
-      0,   0,  60,   0,   0,   0, 
-     60,   0,   3,   0,  36,   0, 
-      0,   0,  60,   0,   0,   0, 
-      0,   0,   4,   0,   1,   0, 
-      5,   0,   2,   0,   0,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   1,   2, 
-    255, 255,  81,   0,   0,   5, 
-      1,   0,  15, 160,   0,   0, 
-    128,  63,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,  31,   0,   0,   2, 
-      0,   0,   0, 128,   0,   0, 
-      3, 176,  31,   0,   0,   2, 
-      0,   0,   0, 128,   1,   0, 
-      7, 176,  31,   0,   0,   2, 
-      0,   0,   0, 144,   0,   8, 
-     15, 160,  31,   0,   0,   2, 
-      0,   0,   0, 144,   1,   8, 
-     15, 160,  31,   0,   0,   2, 
-      0,   0,   0, 144,   2,   8, 
-     15, 160,   6,   0,   0,   2, 
-      0,   0,   8, 128,   1,   0, 
-    170, 176,   5,   0,   0,   3, 
-      0,   0,   3, 128,   0,   0, 
-    255, 128,   1,   0, 228, 176, 
-     66,   0,   0,   3,   0,   0, 
-     15, 128,   0,   0, 228, 128, 
-      2,   8, 228, 160,   5,   0, 
-      0,   3,   0,   0,   1, 128, 
-      0,   0,   0, 128,   0,   0, 
-      0, 160,  66,   0,   0,   3, 
-      1,   0,  15, 128,   0,   0, 
-    228, 176,   0,   8, 228, 160, 
-     66,   0,   0,   3,   2,   0, 
-     15, 128,   0,   0, 228, 176, 
-      1,   8, 228, 160,   2,   0, 
-      0,   3,   2,   0,  15, 128, 
-      1,   0, 228, 128,   2,   0, 
-    228, 129,   2,   0,   0,   3, 
-      2,   0,  15, 128,   2,   0, 
-    228, 128,   1,   0,   0, 160, 
-      1,   0,   0,   2,   1,   0, 
-      8, 128,   2,   0,  85, 128, 
-      5,   0,   0,   3,   2,   0, 
-     15, 128,   0,   0,   0, 128, 
-      2,   0, 228, 128,   5,   0, 
-      0,   3,   0,   0,  15, 128, 
-      0,   0,   0, 128,   1,   0, 
-    228, 128,   1,   0,   0,   2, 
-      0,   8,  15, 128,   0,   0, 
-    228, 128,   1,   0,   0,   2, 
-      1,   8,  15, 128,   2,   0, 
-    228, 128, 255, 255,   0,   0, 
-     83,  72,  68,  82, 204,   1, 
-      0,   0,  64,   0,   0,   0, 
-    115,   0,   0,   0,  89,   0, 
-      0,   4,  70, 142,  32,   0, 
-      0,   0,   0,   0,   2,   0, 
-      0,   0,  90,   0,   0,   3, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  88,  24,   0,   4, 
-      0, 112,  16,   0,   0,   0, 
-      0,   0,  85,  85,   0,   0, 
-     88,  24,   0,   4,   0, 112, 
-     16,   0,   4,   0,   0,   0, 
-     85,  85,   0,   0,  88,  24, 
-      0,   4,   0, 112,  16,   0, 
-      5,   0,   0,   0,  85,  85, 
-      0,   0,  98,  16,   0,   3, 
-     50,  16,  16,   0,   1,   0, 
-      0,   0,  98,  16,   0,   3, 
-    114,  16,  16,   0,   2,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   0,   0, 
-      0,   0, 101,   0,   0,   3, 
-    242,  32,  16,   0,   1,   0, 
-      0,   0, 104,   0,   0,   2, 
-      3,   0,   0,   0,  14,   0, 
-      0,   7,  50,   0,  16,   0, 
-      0,   0,   0,   0,  70,  16, 
-     16,   0,   2,   0,   0,   0, 
-    166,  26,  16,   0,   2,   0, 
-      0,   0,  69,   0,   0,   9, 
-    242,   0,  16,   0,   0,   0, 
-      0,   0,  70,   0,  16,   0, 
-      0,   0,   0,   0,  70, 126, 
-     16,   0,   5,   0,   0,   0, 
-      0,  96,  16,   0,   0,   0, 
-      0,   0,  56,   0,   0,   8, 
-     18,   0,  16,   0,   0,   0, 
-      0,   0,  10,   0,  16,   0, 
-      0,   0,   0,   0,  10, 128, 
-     32,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      1,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   4,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,  69,   0, 
-      0,   9, 242,   0,  16,   0, 
-      2,   0,   0,   0,  70,  16, 
-     16,   0,   1,   0,   0,   0, 
-     70, 126,  16,   0,   0,   0, 
-      0,   0,   0,  96,  16,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   8, 242,   0,  16,   0, 
-      1,   0,   0,   0,  70,  14, 
-     16, 128,  65,   0,   0,   0, 
-      1,   0,   0,   0,  70,  14, 
-     16,   0,   2,   0,   0,   0, 
-      0,   0,   0,  10, 242,   0, 
-     16,   0,   1,   0,   0,   0, 
-     70,  14,  16,   0,   1,   0, 
-      0,   0,   2,  64,   0,   0, 
-      0,   0, 128,  63,   0,   0, 
-    128,  63,   0,   0, 128,  63, 
-      0,   0, 128,  63,  54,   0, 
-      0,   5, 130,   0,  16,   0, 
-      2,   0,   0,   0,  26,   0, 
-     16,   0,   1,   0,   0,   0, 
-     56,   0,   0,   7, 242,  32, 
-     16,   0,   1,   0,   0,   0, 
-      6,   0,  16,   0,   0,   0, 
-      0,   0,  70,  14,  16,   0, 
-      1,   0,   0,   0,  56,   0, 
-      0,   7, 242,  32,  16,   0, 
-      0,   0,   0,   0,   6,   0, 
-     16,   0,   0,   0,   0,   0, 
-     70,  14,  16,   0,   2,   0, 
-      0,   0,  62,   0,   0,   1, 
-     83,  84,  65,  84, 116,   0, 
-      0,   0,  11,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   4,   0,   0,   0, 
-      6,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   3,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,  82,  68, 
-     69,  70,  56,   3,   0,   0, 
-      1,   0,   0,   0, 228,   0, 
-      0,   0,   5,   0,   0,   0, 
-     28,   0,   0,   0,   0,   4, 
-    255, 255,   0,   1,   0,   0, 
-     13,   3,   0,   0, 188,   0, 
-      0,   0,   3,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   1,   0, 
-      0,   0,   1,   0,   0,   0, 
-    197,   0,   0,   0,   2,   0, 
-      0,   0,   5,   0,   0,   0, 
-      4,   0,   0,   0, 255, 255, 
-    255, 255,   0,   0,   0,   0, 
-      1,   0,   0,   0,  13,   0, 
-      0,   0, 202,   0,   0,   0, 
-      2,   0,   0,   0,   5,   0, 
-      0,   0,   4,   0,   0,   0, 
-    255, 255, 255, 255,   4,   0, 
-      0,   0,   1,   0,   0,   0, 
-     13,   0,   0,   0, 212,   0, 
-      0,   0,   2,   0,   0,   0, 
-      5,   0,   0,   0,   4,   0, 
-      0,   0, 255, 255, 255, 255, 
-      5,   0,   0,   0,   1,   0, 
-      0,   0,  13,   0,   0,   0, 
-    218,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      1,   0,   0,   0,   0,   0, 
-      0,   0, 115,  83,  97, 109, 
-    112, 108, 101, 114,   0, 116, 
-     82,  71,  66,   0, 116,  82, 
-     71,  66,  87, 104, 105, 116, 
-    101,   0, 116,  77,  97, 115, 
-    107,   0,  36,  71, 108, 111, 
-     98,  97, 108, 115,   0, 171, 
-    218,   0,   0,   0,  11,   0, 
-      0,   0, 252,   0,   0,   0, 
-    144,   1,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      4,   2,   0,   0,   0,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  16,   2, 
-      0,   0,   0,   0,   0,   0, 
-     32,   2,   0,   0,  16,   0, 
-      0,   0,   4,   0,   0,   0, 
-      2,   0,   0,   0,  48,   2, 
-      0,   0,   0,   0,   0,   0, 
-     64,   2,   0,   0,  32,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  80,   2, 
-      0,   0,   0,   0,   0,   0, 
-     96,   2,   0,   0,  48,   0, 
-      0,   0,  44,   0,   0,   0, 
-      0,   0,   0,   0, 112,   2, 
-      0,   0,   0,   0,   0,   0, 
-    128,   2,   0,   0,  96,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 144,   2, 
-      0,   0,   0,   0,   0,   0, 
-    160,   2,   0,   0, 160,   0, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 144,   2, 
-      0,   0,   0,   0,   0,   0, 
-    172,   2,   0,   0, 224,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0,  16,   2, 
-      0,   0,   0,   0,   0,   0, 
-    192,   2,   0,   0, 240,   0, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 208,   2, 
-      0,   0,   0,   0,   0,   0, 
-    224,   2,   0,   0,   0,   1, 
-      0,   0,  16,   0,   0,   0, 
-      0,   0,   0,   0, 208,   2, 
-      0,   0,   0,   0,   0,   0, 
-    235,   2,   0,   0,  16,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 144,   2, 
-      0,   0,   0,   0,   0,   0, 
-    250,   2,   0,   0,  80,   1, 
-      0,   0,  64,   0,   0,   0, 
-      0,   0,   0,   0, 144,   2, 
-      0,   0,   0,   0,   0,   0, 
-    102,  76,  97, 121, 101, 114, 
-     67, 111, 108, 111, 114,   0, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 102,  76, 
-     97, 121, 101, 114,  79, 112, 
-     97,  99, 105, 116, 121,   0, 
-    171, 171,   0,   0,   3,   0, 
-      1,   0,   1,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    105,  66, 108, 101, 110, 100, 
-     67, 111, 110, 102, 105, 103, 
-      0, 171, 171, 171,   1,   0, 
-     19,   0,   1,   0,   4,   0, 
-      0,   0,   0,   0,   0,   0, 
-      0,   0, 109,  89, 117, 118, 
-     67, 111, 108, 111, 114,  77, 
-     97, 116, 114, 105, 120,   0, 
-      2,   0,   3,   0,   3,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 109,  76, 
-     97, 121, 101, 114,  84, 114, 
-     97, 110, 115, 102, 111, 114, 
-    109,   0,   3,   0,   3,   0, 
-      4,   0,   4,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-    109,  80, 114, 111, 106, 101, 
-     99, 116, 105, 111, 110,   0, 
-    118,  82, 101, 110, 100, 101, 
-    114,  84,  97, 114, 103, 101, 
-    116,  79, 102, 102, 115, 101, 
-    116,   0, 118,  84, 101, 120, 
-    116, 117, 114, 101,  67, 111, 
-    111, 114, 100, 115,   0, 171, 
-      1,   0,   3,   0,   1,   0, 
-      4,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0, 118,  76, 
-     97, 121, 101, 114,  81, 117, 
-     97, 100,   0, 109,  77,  97, 
-    115, 107,  84, 114,  97, 110, 
-    115, 102, 111, 114, 109,   0, 
-    109,  66,  97,  99, 107, 100, 
-    114, 111, 112,  84, 114,  97, 
-    110, 115, 102, 111, 114, 109, 
-      0,  77, 105,  99, 114, 111, 
-    115, 111, 102, 116,  32,  40, 
-     82,  41,  32,  72,  76,  83, 
-     76,  32,  83, 104,  97, 100, 
-    101, 114,  32,  67, 111, 109, 
-    112, 105, 108, 101, 114,  32, 
-     49,  48,  46,  49,   0, 171, 
-    171, 171,  73,  83,  71,  78, 
-    104,   0,   0,   0,   3,   0, 
-      0,   0,   8,   0,   0,   0, 
-     80,   0,   0,   0,   0,   0, 
-      0,   0,   1,   0,   0,   0, 
-      3,   0,   0,   0,   0,   0, 
-      0,   0,  15,   0,   0,   0, 
-     92,   0,   0,   0,   0,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   1,   0, 
-      0,   0,   3,   3,   0,   0, 
-     92,   0,   0,   0,   1,   0, 
-      0,   0,   0,   0,   0,   0, 
-      3,   0,   0,   0,   2,   0, 
<