Backed out 6 changesets (bug 1061525) for mochitest-2 failures in test_BufferedSeek_mp4.html CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Mon, 03 Aug 2015 19:53:33 -0700
changeset 287681 5ddf7484b5eaae748f569699d1611e8d77d43aa4
parent 287680 14003c5e401ddc28b3d4c5e9da785b35facc80b0
child 287682 c9aeb2b942482ee467c2314c63d51ad30873b363
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1061525
milestone42.0a1
backs out5e90b9dab7facad69349e580c2d114a1288b6a5c
ef5ce3d6412aff37453bca8f02a42e46118d8aa8
19c8682665a6ab92ebad48ca0c1d182f02d37473
b48d13edb48d7cdf118c3b36adc994109713ada9
fae6602192a7e4881246f84b7f7a6f9a69088aeb
5dfbd6e73c7afe11aea5e842100373c9fdf8fc1e
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 6 changesets (bug 1061525) for mochitest-2 failures in test_BufferedSeek_mp4.html CLOSED TREE Backed out changeset 5e90b9dab7fa (bug 1061525) Backed out changeset ef5ce3d6412a (bug 1061525) Backed out changeset 19c8682665a6 (bug 1061525) Backed out changeset b48d13edb48d (bug 1061525) Backed out changeset fae6602192a7 (bug 1061525) Backed out changeset 5dfbd6e73c7a (bug 1061525)
dom/media/platforms/apple/AppleVDADecoder.cpp
dom/media/platforms/apple/AppleVTDecoder.cpp
gfx/2d/MacIOSurface.cpp
gfx/2d/MacIOSurface.h
gfx/2d/Types.h
gfx/layers/CompositorTypes.h
gfx/layers/Effects.h
gfx/layers/LayersLogging.cpp
gfx/layers/MacIOSurfaceImage.cpp
gfx/layers/opengl/CompositorOGL.cpp
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
gfx/layers/opengl/OGLShaderProgram.cpp
gfx/layers/opengl/OGLShaderProgram.h
--- a/dom/media/platforms/apple/AppleVDADecoder.cpp
+++ b/dom/media/platforms/apple/AppleVDADecoder.cpp
@@ -469,17 +469,17 @@ AppleVDADecoder::CreateOutputConfigurati
   AutoCFRelease<CFDictionaryRef> IOSurfaceProperties =
     CFDictionaryCreate(kCFAllocatorDefault,
                        IOSurfaceKeys,
                        IOSurfaceValues,
                        ArrayLength(IOSurfaceKeys),
                        &kCFTypeDictionaryKeyCallBacks,
                        &kCFTypeDictionaryValueCallBacks);
 
-  SInt32 PixelFormatTypeValue = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
+  SInt32 PixelFormatTypeValue = kCVPixelFormatType_32BGRA;
   AutoCFRelease<CFNumberRef> PixelFormatTypeNumber =
     CFNumberCreate(kCFAllocatorDefault,
                    kCFNumberSInt32Type,
                    &PixelFormatTypeValue);
 
   const void* outputKeys[] = { kCVPixelBufferIOSurfacePropertiesKey,
                                kCVPixelBufferPixelFormatTypeKey,
                                kCVPixelBufferOpenGLCompatibilityKey };
--- a/dom/media/platforms/apple/AppleVTDecoder.cpp
+++ b/dom/media/platforms/apple/AppleVTDecoder.cpp
@@ -345,22 +345,24 @@ AppleVTDecoder::CreateDecoderExtensions(
                        atomsValue,
                        ArrayLength(atomsKey),
                        &kCFTypeDictionaryKeyCallBacks,
                        &kCFTypeDictionaryValueCallBacks);
 
   const void* extensionKeys[] =
     { kCVImageBufferChromaLocationBottomFieldKey,
       kCVImageBufferChromaLocationTopFieldKey,
-      AppleCMLinker::skPropExtensionAtoms };
+      AppleCMLinker::skPropExtensionAtoms,
+      AppleCMLinker::skPropFullRangeVideo /* Not defined in 10.6 */ };
 
   const void* extensionValues[] =
     { kCVImageBufferChromaLocation_Left,
       kCVImageBufferChromaLocation_Left,
-      atoms };
+      atoms,
+      kCFBooleanTrue };
   static_assert(ArrayLength(extensionKeys) == ArrayLength(extensionValues),
                 "Non matching keys/values array size");
 
   return CFDictionaryCreate(kCFAllocatorDefault,
                             extensionKeys,
                             extensionValues,
                             AppleCMLinker::skPropFullRangeVideo ?
                               ArrayLength(extensionKeys) :
--- a/gfx/2d/MacIOSurface.cpp
+++ b/gfx/2d/MacIOSurface.cpp
@@ -41,32 +41,31 @@ void*                         MacIOSurfa
 void*                         MacIOSurfaceLib::sOpenGLFramework;
 void*                         MacIOSurfaceLib::sCoreGraphicsFramework;
 void*                         MacIOSurfaceLib::sCoreVideoFramework;
 IOSurfaceCreateFunc           MacIOSurfaceLib::sCreate;
 IOSurfaceGetIDFunc            MacIOSurfaceLib::sGetID;
 IOSurfaceLookupFunc           MacIOSurfaceLib::sLookup;
 IOSurfaceGetBaseAddressFunc   MacIOSurfaceLib::sGetBaseAddress;
 IOSurfaceGetBaseAddressOfPlaneFunc  MacIOSurfaceLib::sGetBaseAddressOfPlane;
-IOSurfaceSizePlaneTFunc       MacIOSurfaceLib::sWidth;
-IOSurfaceSizePlaneTFunc       MacIOSurfaceLib::sHeight;
+IOSurfaceSizeTFunc            MacIOSurfaceLib::sWidth;
+IOSurfaceSizeTFunc            MacIOSurfaceLib::sHeight;
 IOSurfaceSizeTFunc            MacIOSurfaceLib::sPlaneCount;
-IOSurfaceSizePlaneTFunc       MacIOSurfaceLib::sBytesPerRow;
+IOSurfaceSizeTFunc            MacIOSurfaceLib::sBytesPerRow;
 IOSurfaceGetPropertyMaximumFunc   MacIOSurfaceLib::sGetPropertyMaximum;
 IOSurfaceVoidFunc             MacIOSurfaceLib::sIncrementUseCount;
 IOSurfaceVoidFunc             MacIOSurfaceLib::sDecrementUseCount;
 IOSurfaceLockFunc             MacIOSurfaceLib::sLock;
 IOSurfaceUnlockFunc           MacIOSurfaceLib::sUnlock;
 CGLTexImageIOSurface2DFunc    MacIOSurfaceLib::sTexImage;
 IOSurfaceContextCreateFunc    MacIOSurfaceLib::sIOSurfaceContextCreate;
 IOSurfaceContextCreateImageFunc   MacIOSurfaceLib::sIOSurfaceContextCreateImage;
 IOSurfaceContextGetSurfaceFunc    MacIOSurfaceLib::sIOSurfaceContextGetSurface;
 CVPixelBufferGetIOSurfaceFunc MacIOSurfaceLib::sCVPixelBufferGetIOSurface;
 unsigned int                  (*MacIOSurfaceLib::sCGContextGetTypePtr) (CGContextRef) = nullptr;
-IOSurfacePixelFormatFunc      MacIOSurfaceLib::sPixelFormat;
 
 CFStringRef                   MacIOSurfaceLib::kPropWidth;
 CFStringRef                   MacIOSurfaceLib::kPropHeight;
 CFStringRef                   MacIOSurfaceLib::kPropBytesPerElem;
 CFStringRef                   MacIOSurfaceLib::kPropBytesPerRow;
 CFStringRef                   MacIOSurfaceLib::kPropIsGlobal;
 
 bool MacIOSurfaceLib::isInit() {
@@ -98,36 +97,32 @@ void* MacIOSurfaceLib::IOSurfaceGetBaseA
                                                       size_t planeIndex) {
   return sGetBaseAddressOfPlane(aIOSurfacePtr, planeIndex);
 }
 
 size_t MacIOSurfaceLib::IOSurfaceGetPlaneCount(IOSurfacePtr aIOSurfacePtr) {
   return sPlaneCount(aIOSurfacePtr);
 }
 
-size_t MacIOSurfaceLib::IOSurfaceGetWidth(IOSurfacePtr aIOSurfacePtr, size_t plane) {
-  return sWidth(aIOSurfacePtr, plane);
+size_t MacIOSurfaceLib::IOSurfaceGetWidth(IOSurfacePtr aIOSurfacePtr) {
+  return sWidth(aIOSurfacePtr);
 }
 
-size_t MacIOSurfaceLib::IOSurfaceGetHeight(IOSurfacePtr aIOSurfacePtr, size_t plane) {
-  return sHeight(aIOSurfacePtr, plane);
+size_t MacIOSurfaceLib::IOSurfaceGetHeight(IOSurfacePtr aIOSurfacePtr) {
+  return sHeight(aIOSurfacePtr);
 }
 
-size_t MacIOSurfaceLib::IOSurfaceGetBytesPerRow(IOSurfacePtr aIOSurfacePtr, size_t plane) {
-  return sBytesPerRow(aIOSurfacePtr, plane);
+size_t MacIOSurfaceLib::IOSurfaceGetBytesPerRow(IOSurfacePtr aIOSurfacePtr) {
+  return sBytesPerRow(aIOSurfacePtr);
 }
 
 size_t MacIOSurfaceLib::IOSurfaceGetPropertyMaximum(CFStringRef property) {
   return sGetPropertyMaximum(property);
 }
 
-OSType MacIOSurfaceLib::IOSurfaceGetPixelFormat(IOSurfacePtr aIOSurfacePtr) {
-  return sPixelFormat(aIOSurfacePtr);
-}
-
 IOReturn MacIOSurfaceLib::IOSurfaceLock(IOSurfacePtr aIOSurfacePtr,
                                        uint32_t options, uint32_t* seed) {
   return sLock(aIOSurfacePtr, options, seed);
 }
 
 IOReturn MacIOSurfaceLib::IOSurfaceUnlock(IOSurfacePtr aIOSurfacePtr,
                                          uint32_t options, uint32_t *seed) {
   return sUnlock(aIOSurfacePtr, options, seed);
@@ -218,32 +213,31 @@ void MacIOSurfaceLib::LoadLibrary() {
 
   kPropWidth = GetIOConst("kIOSurfaceWidth");
   kPropHeight = GetIOConst("kIOSurfaceHeight");
   kPropBytesPerElem = GetIOConst("kIOSurfaceBytesPerElement");
   kPropBytesPerRow = GetIOConst("kIOSurfaceBytesPerRow");
   kPropIsGlobal = GetIOConst("kIOSurfaceIsGlobal");
   sCreate = GET_IOSYM(sCreate, "IOSurfaceCreate");
   sGetID  = GET_IOSYM(sGetID,  "IOSurfaceGetID");
-  sWidth = GET_IOSYM(sWidth, "IOSurfaceGetWidthOfPlane");
-  sHeight = GET_IOSYM(sHeight, "IOSurfaceGetHeightOfPlane");
-  sBytesPerRow = GET_IOSYM(sBytesPerRow, "IOSurfaceGetBytesPerRowOfPlane");
+  sWidth = GET_IOSYM(sWidth, "IOSurfaceGetWidth");
+  sHeight = GET_IOSYM(sHeight, "IOSurfaceGetHeight");
+  sBytesPerRow = GET_IOSYM(sBytesPerRow, "IOSurfaceGetBytesPerRow");
   sGetPropertyMaximum = GET_IOSYM(sGetPropertyMaximum, "IOSurfaceGetPropertyMaximum");
   sLookup = GET_IOSYM(sLookup, "IOSurfaceLookup");
   sLock = GET_IOSYM(sLock, "IOSurfaceLock");
   sUnlock = GET_IOSYM(sUnlock, "IOSurfaceUnlock");
   sIncrementUseCount =
     GET_IOSYM(sIncrementUseCount, "IOSurfaceIncrementUseCount");
   sDecrementUseCount =
     GET_IOSYM(sDecrementUseCount, "IOSurfaceDecrementUseCount");
   sGetBaseAddress = GET_IOSYM(sGetBaseAddress, "IOSurfaceGetBaseAddress");
   sGetBaseAddressOfPlane =
     GET_IOSYM(sGetBaseAddressOfPlane, "IOSurfaceGetBaseAddressOfPlane");
   sPlaneCount = GET_IOSYM(sPlaneCount, "IOSurfaceGetPlaneCount");
-  sPixelFormat = GET_IOSYM(sPixelFormat, "IOSurfaceGetPixelFormat");
 
   sTexImage = GET_CGLSYM(sTexImage, "CGLTexImageIOSurface2D");
   sCGContextGetTypePtr = (unsigned int (*)(CGContext*))dlsym(RTLD_DEFAULT, "CGContextGetType");
 
   sCVPixelBufferGetIOSurface =
     GET_CVSYM(sCVPixelBufferGetIOSurface, "CVPixelBufferGetIOSurface");
 
   // Optional symbols
@@ -375,24 +369,24 @@ void* MacIOSurface::GetBaseAddress() {
 }
 
 void* MacIOSurface::GetBaseAddressOfPlane(size_t aPlaneIndex)
 {
   return MacIOSurfaceLib::IOSurfaceGetBaseAddressOfPlane(mIOSurfacePtr,
                                                          aPlaneIndex);
 }
 
-size_t MacIOSurface::GetWidth(size_t plane) {
+size_t MacIOSurface::GetWidth() {
   size_t intScaleFactor = ceil(mContentsScaleFactor);
-  return GetDevicePixelWidth(plane) / intScaleFactor;
+  return GetDevicePixelWidth() / intScaleFactor;
 }
 
-size_t MacIOSurface::GetHeight(size_t plane) {
+size_t MacIOSurface::GetHeight() {
   size_t intScaleFactor = ceil(mContentsScaleFactor);
-  return GetDevicePixelHeight(plane) / intScaleFactor;
+  return GetDevicePixelHeight() / intScaleFactor;
 }
 
 size_t MacIOSurface::GetPlaneCount() {
   return MacIOSurfaceLib::IOSurfaceGetPlaneCount(mIOSurfacePtr);
 }
 
 /*static*/ size_t MacIOSurface::GetMaxWidth() {
   if (!MacIOSurfaceLib::isInit())
@@ -401,30 +395,26 @@ size_t MacIOSurface::GetPlaneCount() {
 }
 
 /*static*/ size_t MacIOSurface::GetMaxHeight() {
   if (!MacIOSurfaceLib::isInit())
     return -1;
   return MacIOSurfaceLib::IOSurfaceGetPropertyMaximum(MacIOSurfaceLib::kPropHeight);
 }
 
-size_t MacIOSurface::GetDevicePixelWidth(size_t plane) {
-  return MacIOSurfaceLib::IOSurfaceGetWidth(mIOSurfacePtr, plane);
+size_t MacIOSurface::GetDevicePixelWidth() {
+  return MacIOSurfaceLib::IOSurfaceGetWidth(mIOSurfacePtr);
 }
 
-size_t MacIOSurface::GetDevicePixelHeight(size_t plane) {
-  return MacIOSurfaceLib::IOSurfaceGetHeight(mIOSurfacePtr, plane);
+size_t MacIOSurface::GetDevicePixelHeight() {
+  return MacIOSurfaceLib::IOSurfaceGetHeight(mIOSurfacePtr);
 }
 
-size_t MacIOSurface::GetBytesPerRow(size_t plane) {
-  return MacIOSurfaceLib::IOSurfaceGetBytesPerRow(mIOSurfacePtr, plane);
-}
-
-OSType MacIOSurface::GetPixelFormat() {
-  return MacIOSurfaceLib::IOSurfaceGetPixelFormat(mIOSurfacePtr);
+size_t MacIOSurface::GetBytesPerRow() { 
+  return MacIOSurfaceLib::IOSurfaceGetBytesPerRow(mIOSurfacePtr);
 }
 
 void MacIOSurface::IncrementUseCount() {
   MacIOSurfaceLib::IOSurfaceIncrementUseCount(mIOSurfacePtr);
 }
 
 void MacIOSurface::DecrementUseCount() {
   MacIOSurfaceLib::IOSurfaceDecrementUseCount(mIOSurfacePtr);
@@ -465,62 +455,27 @@ MacIOSurface::GetAsSurface() {
                                       mozilla::gfx::SurfaceFormat::B8G8R8X8;
 
   RefPtr<SourceSurfaceRawData> surf = new SourceSurfaceRawData();
   surf->InitWrappingData(dataCpy, IntSize(ioWidth, ioHeight), bytesPerRow, format, true);
 
   return surf.forget();
 }
 
-SurfaceFormat
-MacIOSurface::GetFormat()
-{
-  OSType pixelFormat = GetPixelFormat();
-  if (pixelFormat == '420v') {
-    return SurfaceFormat::NV12;
-  } else  {
-    return HasAlpha() ? SurfaceFormat::R8G8B8A8 : SurfaceFormat::R8G8B8X8;
-  }
-}
-
 CGLError
-MacIOSurface::CGLTexImageIOSurface2D(CGLContextObj ctx, size_t plane)
+MacIOSurface::CGLTexImageIOSurface2D(CGLContextObj ctx)
 {
-  MOZ_ASSERT(plane >= 0);
-  OSType pixelFormat = GetPixelFormat();
-
-  GLenum internalFormat;
-  GLenum format;
-  GLenum type;
-  if (pixelFormat == '420v') {
-    MOZ_ASSERT(GetPlaneCount() == 2);
-    MOZ_ASSERT(plane < 2);
-
-    if (plane == 0) {
-      internalFormat = format = GL_LUMINANCE;
-    } else {
-      internalFormat = format = GL_LUMINANCE_ALPHA;
-    }
-    type = GL_UNSIGNED_BYTE;
-  } else  {
-    MOZ_ASSERT(plane == 0);
-
-    internalFormat = HasAlpha() ? GL_RGBA : GL_RGB;
-    format = GL_BGRA;
-    type = GL_UNSIGNED_INT_8_8_8_8_REV;
-  }
-  CGLError temp =  MacIOSurfaceLib::CGLTexImageIOSurface2D(ctx,
+  return MacIOSurfaceLib::CGLTexImageIOSurface2D(ctx,
                                                 GL_TEXTURE_RECTANGLE_ARB,
-                                                internalFormat,
-                                                GetDevicePixelWidth(plane),
-                                                GetDevicePixelHeight(plane),
-                                                format,
-                                                type,
-                                                mIOSurfacePtr, plane);
-  return temp;
+                                                HasAlpha() ? GL_RGBA : GL_RGB,
+                                                GetDevicePixelWidth(),
+                                                GetDevicePixelHeight(),
+                                                GL_BGRA,
+                                                GL_UNSIGNED_INT_8_8_8_8_REV,
+                                                mIOSurfacePtr, 0);
 }
 
 static
 CGColorSpaceRef CreateSystemColorSpace() {
   CGColorSpaceRef cspace = ::CGDisplayCopyColorSpace(::CGMainDisplayID());
   if (!cspace) {
     cspace = ::CGColorSpaceCreateDeviceRGB();
   }
--- a/gfx/2d/MacIOSurface.h
+++ b/gfx/2d/MacIOSurface.h
@@ -19,35 +19,32 @@ typedef void (*IOSurfaceVoidFunc)(IOSurf
 typedef IOReturn (*IOSurfaceLockFunc)(IOSurfacePtr io_surface, uint32_t options,
                                       uint32_t *seed);
 typedef IOReturn (*IOSurfaceUnlockFunc)(IOSurfacePtr io_surface,
                                         uint32_t options, uint32_t *seed);
 typedef void* (*IOSurfaceGetBaseAddressFunc)(IOSurfacePtr io_surface);
 typedef void* (*IOSurfaceGetBaseAddressOfPlaneFunc)(IOSurfacePtr io_surface,
                                                     size_t planeIndex);
 typedef size_t (*IOSurfaceSizeTFunc)(IOSurfacePtr io_surface);
-typedef size_t (*IOSurfaceSizePlaneTFunc)(IOSurfacePtr io_surface, size_t plane);
 typedef size_t (*IOSurfaceGetPropertyMaximumFunc) (CFStringRef property);
 typedef CGLError (*CGLTexImageIOSurface2DFunc) (CGLContextObj ctxt,
                              GLenum target, GLenum internalFormat,
                              GLsizei width, GLsizei height,
                              GLenum format, GLenum type,
                              IOSurfacePtr ioSurface, GLuint plane);
 typedef CGContextRef (*IOSurfaceContextCreateFunc)(CFTypeRef io_surface,
                              unsigned width, unsigned height,
                              unsigned bitsPerComponent, unsigned bytes,
                              CGColorSpaceRef colorSpace, CGBitmapInfo bitmapInfo);
 typedef CGImageRef (*IOSurfaceContextCreateImageFunc)(CGContextRef ref);
 typedef IOSurfacePtr (*IOSurfaceContextGetSurfaceFunc)(CGContextRef ref);
 
 typedef IOSurfacePtr (*CVPixelBufferGetIOSurfaceFunc)(
   CVPixelBufferRef pixelBuffer);
 
-typedef OSType (*IOSurfacePixelFormatFunc)(IOSurfacePtr io_surface);
-
 #import <OpenGL/OpenGL.h>
 #include "2D.h"
 #include "mozilla/RefPtr.h"
 
 struct _CGLContextObject;
 
 typedef _CGLContextObject* CGLContextObj;
 typedef struct CGContext* CGContextRef;
@@ -83,36 +80,34 @@ public:
   explicit MacIOSurface(const void *aIOSurfacePtr,
                         double aContentsScaleFactor = 1.0,
                         bool aHasAlpha = true);
   virtual ~MacIOSurface();
   IOSurfaceID GetIOSurfaceID();
   void *GetBaseAddress();
   void *GetBaseAddressOfPlane(size_t planeIndex);
   size_t GetPlaneCount();
-  OSType GetPixelFormat();
   // GetWidth() and GetHeight() return values in "display pixels".  A
   // "display pixel" is the smallest fully addressable part of a display.
   // But in HiDPI modes each "display pixel" corresponds to more than one
   // device pixel.  Use GetDevicePixel**() to get device pixels.
-  size_t GetWidth(size_t plane = 0);
-  size_t GetHeight(size_t plane = 0);
+  size_t GetWidth();
+  size_t GetHeight();
   double GetContentsScaleFactor() { return mContentsScaleFactor; }
-  size_t GetDevicePixelWidth(size_t plane = 0);
-  size_t GetDevicePixelHeight(size_t plane = 0);
-  size_t GetBytesPerRow(size_t plane = 0);
+  size_t GetDevicePixelWidth();
+  size_t GetDevicePixelHeight();
+  size_t GetBytesPerRow();
   void Lock();
   void Unlock();
   void IncrementUseCount();
   void DecrementUseCount();
   bool HasAlpha() { return mHasAlpha; }
-  mozilla::gfx::SurfaceFormat GetFormat();
   // We would like to forward declare NSOpenGLContext, but it is an @interface
   // and this file is also used from c++, so we use a void *.
-  CGLError CGLTexImageIOSurface2D(CGLContextObj ctxt, size_t plane = 0);
+  CGLError CGLTexImageIOSurface2D(CGLContextObj ctxt);
   already_AddRefed<SourceSurface> GetAsSurface();
   CGContextRef CreateIOSurfaceContext();
 
   // FIXME This doesn't really belong here
   static CGImageRef CreateImageFromIOSurfaceContext(CGContextRef aContext);
   static already_AddRefed<MacIOSurface> IOSurfaceContextGetSurface(CGContextRef aContext,
                                                                         double aContentsScaleFactor = 1.0,
                                                                         bool aHasAlpha = true);
@@ -139,44 +134,43 @@ public:
   static IOSurfaceLookupFunc          sLookup;
   static IOSurfaceGetBaseAddressFunc  sGetBaseAddress;
   static IOSurfaceGetBaseAddressOfPlaneFunc sGetBaseAddressOfPlane;
   static IOSurfaceSizeTFunc           sPlaneCount;
   static IOSurfaceLockFunc            sLock;
   static IOSurfaceUnlockFunc          sUnlock;
   static IOSurfaceVoidFunc            sIncrementUseCount;
   static IOSurfaceVoidFunc            sDecrementUseCount;
-  static IOSurfaceSizePlaneTFunc      sWidth;
-  static IOSurfaceSizePlaneTFunc      sHeight;
-  static IOSurfaceSizePlaneTFunc      sBytesPerRow;
+  static IOSurfaceSizeTFunc           sWidth;
+  static IOSurfaceSizeTFunc           sHeight;
+  static IOSurfaceSizeTFunc           sBytesPerRow;
   static IOSurfaceGetPropertyMaximumFunc  sGetPropertyMaximum;
   static CGLTexImageIOSurface2DFunc   sTexImage;
   static IOSurfaceContextCreateFunc   sIOSurfaceContextCreate;
   static IOSurfaceContextCreateImageFunc  sIOSurfaceContextCreateImage;
   static IOSurfaceContextGetSurfaceFunc   sIOSurfaceContextGetSurface;
   static CVPixelBufferGetIOSurfaceFunc    sCVPixelBufferGetIOSurface;
-  static IOSurfacePixelFormatFunc     sPixelFormat;
   static CFStringRef                  kPropWidth;
   static CFStringRef                  kPropHeight;
   static CFStringRef                  kPropBytesPerElem;
   static CFStringRef                  kPropBytesPerRow;
   static CFStringRef                  kPropIsGlobal;
 
   static bool isInit();
   static CFStringRef GetIOConst(const char* symbole);
   static IOSurfacePtr IOSurfaceCreate(CFDictionaryRef properties);
   static IOSurfacePtr IOSurfaceLookup(IOSurfaceID aIOSurfaceID);
   static IOSurfaceID  IOSurfaceGetID(IOSurfacePtr aIOSurfacePtr);
   static void*        IOSurfaceGetBaseAddress(IOSurfacePtr aIOSurfacePtr);
   static void*        IOSurfaceGetBaseAddressOfPlane(IOSurfacePtr aIOSurfacePtr,
                                                      size_t aPlaneIndex);
   static size_t       IOSurfaceGetPlaneCount(IOSurfacePtr aIOSurfacePtr);
-  static size_t       IOSurfaceGetWidth(IOSurfacePtr aIOSurfacePtr, size_t plane);
-  static size_t       IOSurfaceGetHeight(IOSurfacePtr aIOSurfacePtr, size_t plane);
-  static size_t       IOSurfaceGetBytesPerRow(IOSurfacePtr aIOSurfacePtr, size_t plane);
+  static size_t       IOSurfaceGetWidth(IOSurfacePtr aIOSurfacePtr);
+  static size_t       IOSurfaceGetHeight(IOSurfacePtr aIOSurfacePtr);
+  static size_t       IOSurfaceGetBytesPerRow(IOSurfacePtr aIOSurfacePtr);
   static size_t       IOSurfaceGetPropertyMaximum(CFStringRef property);
   static IOReturn     IOSurfaceLock(IOSurfacePtr aIOSurfacePtr,
                                     uint32_t options, uint32_t *seed);
   static IOReturn     IOSurfaceUnlock(IOSurfacePtr aIOSurfacePtr,
                                       uint32_t options, uint32_t *seed);
   static void         IOSurfaceIncrementUseCount(IOSurfacePtr aIOSurfacePtr);
   static void         IOSurfaceDecrementUseCount(IOSurfacePtr aIOSurfacePtr);
   static CGLError     CGLTexImageIOSurface2D(CGLContextObj ctxt,
@@ -186,17 +180,16 @@ public:
                              IOSurfacePtr ioSurface, GLuint plane);
   static CGContextRef IOSurfaceContextCreate(IOSurfacePtr aIOSurfacePtr,
                              unsigned aWidth, unsigned aHeight,
                              unsigned aBitsPerCompoent, unsigned aBytes,
                              CGColorSpaceRef aColorSpace, CGBitmapInfo bitmapInfo);
   static CGImageRef   IOSurfaceContextCreateImage(CGContextRef ref);
   static IOSurfacePtr IOSurfaceContextGetSurface(CGContextRef ref);
   static IOSurfacePtr CVPixelBufferGetIOSurface(CVPixelBufferRef apixelBuffer);
-  static OSType       IOSurfaceGetPixelFormat(IOSurfacePtr aIOSurfacePtr);
   static unsigned int (*sCGContextGetTypePtr) (CGContextRef);
   static void LoadLibrary();
   static void CloseLibrary();
 
   // Static deconstructor
   static class LibraryUnloader {
   public:
     ~LibraryUnloader() {
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -32,28 +32,26 @@ enum class SurfaceType : int8_t {
 enum class SurfaceFormat : int8_t {
   B8G8R8A8,
   B8G8R8X8,
   R8G8B8A8,
   R8G8B8X8,
   R5G6B5,
   A8,
   YUV,
-  NV12,
   UNKNOWN
 };
 
 inline bool IsOpaque(SurfaceFormat aFormat)
 {
   switch (aFormat) {
   case SurfaceFormat::B8G8R8X8:
   case SurfaceFormat::R8G8B8X8:
   case SurfaceFormat::R5G6B5:
   case SurfaceFormat::YUV:
-  case SurfaceFormat::NV12:
     return true;
   default:
     return false;
   }
 }
 
 enum class FilterType : int8_t {
   BLEND = 0,
--- a/gfx/layers/CompositorTypes.h
+++ b/gfx/layers/CompositorTypes.h
@@ -116,17 +116,16 @@ MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(Di
  */
 enum class EffectTypes : uint8_t {
   MASK,
   BLEND_MODE,
   COLOR_MATRIX,
   MAX_SECONDARY, // sentinel for the count of secondary effect types
   RGB,
   YCBCR,
-  NV12,
   COMPONENT_ALPHA,
   SOLID_COLOR,
   RENDER_TARGET,
   VR_DISTORTION,
   MAX  //sentinel for the count of all effect types
 };
 
 /**
--- a/gfx/layers/Effects.h
+++ b/gfx/layers/Effects.h
@@ -192,25 +192,16 @@ struct EffectYCbCr : public TexturedEffe
 {
   EffectYCbCr(TextureSource *aSource, gfx::Filter aFilter)
     : TexturedEffect(EffectTypes::YCBCR, aSource, false, aFilter)
   {}
 
   virtual const char* Name() { return "EffectYCbCr"; }
 };
 
-struct EffectNV12 : public TexturedEffect
-{
-  EffectNV12(TextureSource *aSource, gfx::Filter aFilter)
-    : TexturedEffect(EffectTypes::NV12, aSource, false, aFilter)
-  {}
-
-  virtual const char* Name() { return "EffectNV12"; }
-};
-
 struct EffectComponentAlpha : public TexturedEffect
 {
   EffectComponentAlpha(TextureSource *aOnBlack,
                        TextureSource *aOnWhite,
                        gfx::Filter aFilter)
     : TexturedEffect(EffectTypes::COMPONENT_ALPHA, nullptr, false, aFilter)
     , mOnBlack(aOnBlack)
     , mOnWhite(aOnWhite)
@@ -269,19 +260,16 @@ CreateTexturedEffect(gfx::SurfaceFormat 
   case gfx::SurfaceFormat::R8G8B8X8:
   case gfx::SurfaceFormat::R5G6B5:
   case gfx::SurfaceFormat::R8G8B8A8:
     result = new EffectRGB(aSource, isAlphaPremultiplied, aFilter);
     break;
   case gfx::SurfaceFormat::YUV:
     result = new EffectYCbCr(aSource, aFilter);
     break;
-  case gfx::SurfaceFormat::NV12:
-    result = new EffectNV12(aSource, aFilter);
-    break;
   default:
     NS_WARNING("unhandled program type");
     break;
   }
 
   result->mState = state;
 
   return result.forget();
--- a/gfx/layers/LayersLogging.cpp
+++ b/gfx/layers/LayersLogging.cpp
@@ -332,17 +332,16 @@ AppendToString(std::stringstream& aStrea
   switch (format) {
   case SurfaceFormat::B8G8R8A8:  aStream << "SurfaceFormat::B8G8R8A8"; break;
   case SurfaceFormat::B8G8R8X8:  aStream << "SurfaceFormat::B8G8R8X8"; break;
   case SurfaceFormat::R8G8B8A8:  aStream << "SurfaceFormat::R8G8B8A8"; break;
   case SurfaceFormat::R8G8B8X8:  aStream << "SurfaceFormat::R8G8B8X8"; break;
   case SurfaceFormat::R5G6B5:    aStream << "SurfaceFormat::R5G6B5"; break;
   case SurfaceFormat::A8:        aStream << "SurfaceFormat::A8"; break;
   case SurfaceFormat::YUV:       aStream << "SurfaceFormat::YUV"; break;
-  case SurfaceFormat::NV12:      aStream << "SurfaceFormat::NV12"; break;
   case SurfaceFormat::UNKNOWN:   aStream << "SurfaceFormat::UNKNOWN"; break;
   default:
     NS_ERROR("unknown surface format");
     aStream << "???";
   }
 
   aStream << sfx;
 }
--- a/gfx/layers/MacIOSurfaceImage.cpp
+++ b/gfx/layers/MacIOSurfaceImage.cpp
@@ -2,102 +2,54 @@
  * 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 "MacIOSurfaceImage.h"
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/MacIOSurfaceTextureClientOGL.h"
-#include "YCbCrUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::layers;
-using namespace mozilla::gfx;
 
 TextureClient*
 MacIOSurfaceImage::GetTextureClient(CompositableClient* aClient)
 {
   if (!mTextureClient) {
     mTextureClient = MacIOSurfaceTextureClientOGL::Create(aClient->GetForwarder(),
                                                           TextureFlags::DEFAULT,
                                                           mSurface);
   }
   return mTextureClient;
 }
 
-already_AddRefed<SourceSurface>
+already_AddRefed<gfx::SourceSurface>
 MacIOSurfaceImage::GetAsSourceSurface()
 {
-  RefPtr<DataSourceSurface> dataSurface;
   mSurface->Lock();
   size_t bytesPerRow = mSurface->GetBytesPerRow();
   size_t ioWidth = mSurface->GetDevicePixelWidth();
   size_t ioHeight = mSurface->GetDevicePixelHeight();
 
-  SurfaceFormat format = mSurface->GetFormat() == SurfaceFormat::NV12 ? SurfaceFormat::B8G8R8X8 : SurfaceFormat::B8G8R8A8;
+  unsigned char* ioData = (unsigned char*)mSurface->GetBaseAddress();
 
-  dataSurface = Factory::CreateDataSourceSurface(IntSize(ioWidth, ioHeight), format);
+  RefPtr<gfx::DataSourceSurface> dataSurface
+    = gfx::Factory::CreateDataSourceSurface(gfx::IntSize(ioWidth, ioHeight), gfx::SurfaceFormat::B8G8R8A8);
   if (NS_WARN_IF(!dataSurface)) {
     return nullptr;
   }
 
-  DataSourceSurface::MappedSurface mappedSurface;
-  if (!dataSurface->Map(DataSourceSurface::WRITE, &mappedSurface))
+  gfx::DataSourceSurface::MappedSurface mappedSurface;
+  if (!dataSurface->Map(gfx::DataSourceSurface::WRITE, &mappedSurface))
     return nullptr;
 
-  if (mSurface->GetFormat() == SurfaceFormat::NV12) {
-    if (mSurface->GetDevicePixelWidth() > PlanarYCbCrImage::MAX_DIMENSION ||
-        mSurface->GetDevicePixelHeight() > PlanarYCbCrImage::MAX_DIMENSION) {
-      return nullptr;
-    }
-
-    /* Extract and separate the CbCr planes */
-    size_t cbCrStride = mSurface->GetBytesPerRow(1);
-    size_t cbCrWidth = mSurface->GetDevicePixelWidth(1);
-    size_t cbCrHeight = mSurface->GetDevicePixelHeight(1);
-
-    nsAutoArrayPtr<uint8_t> cbPlane(new uint8_t[cbCrWidth * cbCrHeight]);
-    nsAutoArrayPtr<uint8_t> crPlane(new uint8_t[cbCrWidth * cbCrHeight]);
-
-    uint8_t* src = (uint8_t*)mSurface->GetBaseAddressOfPlane(1);
-    uint8_t* cbDest = cbPlane;
-    uint8_t* crDest = crPlane;
-
-    for (size_t i = 0; i < cbCrHeight; i++) {
-      uint8_t* rowSrc = src + cbCrStride * i;
-      for (size_t j = 0; j < cbCrWidth; j++) {
-        *cbDest = *rowSrc;
-        cbDest++;
-        rowSrc++;
-        *crDest = *rowSrc;
-        crDest++;
-        rowSrc++;
-      }
-    }
-
-    /* Convert to RGB */
-    PlanarYCbCrData data;
-    data.mYChannel = (uint8_t*)mSurface->GetBaseAddressOfPlane(0);
-    data.mYStride = mSurface->GetBytesPerRow(0);
-    data.mYSize = IntSize(mSurface->GetDevicePixelWidth(0), mSurface->GetDevicePixelHeight(0));
-    data.mCbChannel = cbPlane;
-    data.mCrChannel = crPlane;
-    data.mCbCrStride = cbCrWidth;
-    data.mCbCrSize = IntSize(cbCrWidth, cbCrHeight);
-    data.mPicSize = data.mYSize;
-
-    ConvertYCbCrToRGB(data, SurfaceFormat::B8G8R8X8, IntSize(ioWidth, ioHeight), mappedSurface.mData, mappedSurface.mStride);
-  } else {
-    unsigned char* ioData = (unsigned char*)mSurface->GetBaseAddress();
-
-    for (size_t i = 0; i < ioHeight; ++i) {
-      memcpy(mappedSurface.mData + i * mappedSurface.mStride,
-             ioData + i * bytesPerRow,
-             ioWidth * 4);
-    }
+  for (size_t i = 0; i < ioHeight; ++i) {
+    memcpy(mappedSurface.mData + i * mappedSurface.mStride,
+           ioData + i * bytesPerRow,
+           ioWidth * 4);
   }
 
   dataSurface->Unmap();
   mSurface->Unlock();
 
   return dataSurface.forget();
 }
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -807,20 +807,16 @@ CompositorOGL::GetShaderConfigFor(Effect
 
   switch(aEffect->mType) {
   case EffectTypes::SOLID_COLOR:
     config.SetRenderColor(true);
     break;
   case EffectTypes::YCBCR:
     config.SetYCbCr(true);
     break;
-  case EffectTypes::NV12:
-    config.SetNV12(true);
-    config.SetTextureTarget(LOCAL_GL_TEXTURE_RECTANGLE_ARB);
-    break;
   case EffectTypes::COMPONENT_ALPHA:
   {
     config.SetComponentAlpha(true);
     EffectComponentAlpha* effectComponentAlpha =
       static_cast<EffectComponentAlpha*>(aEffect);
     gfx::SurfaceFormat format = effectComponentAlpha->mOnWhite->GetFormat();
     config.SetRBSwap(format == gfx::SurfaceFormat::B8G8R8A8 ||
                      format == gfx::SurfaceFormat::B8G8R8X8);
@@ -1250,50 +1246,16 @@ CompositorOGL::DrawQuad(const Rect& aRec
       }
       didSetBlendMode = SetBlendMode(gl(), blendMode);
       BindAndDrawQuadWithTextureRect(program,
                                      aRect,
                                      effectYCbCr->mTextureCoords,
                                      sourceYCbCr->GetSubSource(Y));
     }
     break;
-  case EffectTypes::NV12: {
-      EffectNV12* effectNV12 =
-        static_cast<EffectNV12*>(aEffectChain.mPrimaryEffect.get());
-      TextureSource* sourceNV12 = effectNV12->mTexture;
-      const int Y = 0, CbCr = 1;
-      TextureSourceOGL* sourceY =  sourceNV12->GetSubSource(Y)->AsSourceOGL();
-      TextureSourceOGL* sourceCbCr = sourceNV12->GetSubSource(CbCr)->AsSourceOGL();
-
-      if (!sourceY || !sourceCbCr) {
-        NS_WARNING("Invalid layer texture.");
-        return;
-      }
-
-      sourceY->BindTexture(LOCAL_GL_TEXTURE0, effectNV12->mFilter);
-      sourceCbCr->BindTexture(LOCAL_GL_TEXTURE1, effectNV12->mFilter);
-
-      if (config.mFeatures & ENABLE_TEXTURE_RECT) {
-        // This is used by IOSurface that use 0,0...w,h coordinate rather then 0,0..1,1.
-        program->SetCbCrTexCoordMultiplier(sourceCbCr->GetSize().width, sourceCbCr->GetSize().height);
-      }
-
-      program->SetNV12TextureUnits(Y, CbCr);
-      program->SetTextureTransform(Matrix4x4());
-
-      if (maskType != MaskType::MaskNone) {
-        BindMaskForProgram(program, sourceMask, LOCAL_GL_TEXTURE2, maskQuadTransform);
-      }
-      didSetBlendMode = SetBlendMode(gl(), blendMode);
-      BindAndDrawQuadWithTextureRect(program,
-                                     aRect,
-                                     effectNV12->mTextureCoords,
-                                     sourceNV12->GetSubSource(Y));
-    }
-    break;
   case EffectTypes::RENDER_TARGET: {
       EffectRenderTarget* effectRenderTarget =
         static_cast<EffectRenderTarget*>(aEffectChain.mPrimaryEffect.get());
       RefPtr<CompositingRenderTargetOGL> surface
         = static_cast<CompositingRenderTargetOGL*>(effectRenderTarget->mRenderTarget.get());
 
       surface->BindTexture(LOCAL_GL_TEXTURE0, mFBOTextureTarget);
 
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
@@ -20,69 +20,58 @@ MacIOSurfaceTextureHostOGL::MacIOSurface
                                          !aDescriptor.isOpaque());
 }
 
 MacIOSurfaceTextureHostOGL::~MacIOSurfaceTextureHostOGL()
 {
   MOZ_COUNT_DTOR(MacIOSurfaceTextureHostOGL);
 }
 
-GLTextureSource*
-MacIOSurfaceTextureHostOGL::CreateTextureSourceForPlane(size_t aPlane)
-{
-  GLuint textureHandle;
-  gl::GLContext* gl = mCompositor->gl();
-  gl->fGenTextures(1, &textureHandle);
-  gl->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, textureHandle);
-  gl->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE);
-  gl->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE);
-
-  mSurface->CGLTexImageIOSurface2D(gl::GLContextCGL::Cast(gl)->GetCGLContext(), aPlane);
-
-  return new GLTextureSource(mCompositor, textureHandle, LOCAL_GL_TEXTURE_RECTANGLE_ARB,
-                             gfx::IntSize(mSurface->GetDevicePixelWidth(aPlane),
-                                          mSurface->GetDevicePixelHeight(aPlane)),
-                             // XXX: This isn't really correct (but isn't used), we should be using the
-                             // format of the individual plane, not of the whole buffer.
-                             mSurface->GetFormat());
-}
-
 bool
 MacIOSurfaceTextureHostOGL::Lock()
 {
   if (!mCompositor || !mSurface) {
     return false;
   }
 
   if (!mTextureSource) {
-    mTextureSource = CreateTextureSourceForPlane(0);
+    GLuint textureHandle;
+    gl::GLContext* gl = mCompositor->gl();
+    gl->fGenTextures(1, &textureHandle);
+    gl->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, textureHandle);
+    gl->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_T, LOCAL_GL_CLAMP_TO_EDGE);
+    gl->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE);
+    mSurface->CGLTexImageIOSurface2D(gl::GLContextCGL::Cast(gl)->GetCGLContext());
 
-    RefPtr<TextureSource> prev = mTextureSource;
-    for (size_t i = 1; i < mSurface->GetPlaneCount(); i++) {
-      RefPtr<TextureSource> next = CreateTextureSourceForPlane(i);
-      prev->SetNextSibling(next);
-      prev = next;
-    }
+    mTextureSource = new GLTextureSource(mCompositor, textureHandle, LOCAL_GL_TEXTURE_RECTANGLE_ARB,
+                                         gfx::IntSize(mSurface->GetDevicePixelWidth(),
+                                                      mSurface->GetDevicePixelHeight()),
+                                         mSurface->HasAlpha() ? gfx::SurfaceFormat::R8G8B8A8:
+                                                                gfx::SurfaceFormat::R8G8B8X8);
   }
   return true;
 }
 
 void
 MacIOSurfaceTextureHostOGL::SetCompositor(Compositor* aCompositor)
 {
   CompositorOGL* glCompositor = static_cast<CompositorOGL*>(aCompositor);
   mCompositor = glCompositor;
   if (mTextureSource) {
     mTextureSource->SetCompositor(glCompositor);
   }
 }
 
 gfx::SurfaceFormat
 MacIOSurfaceTextureHostOGL::GetFormat() const {
-  return mSurface->GetFormat();
+  if (!mSurface) {
+    return gfx::SurfaceFormat::UNKNOWN;
+  }
+  return mSurface->HasAlpha() ? gfx::SurfaceFormat::R8G8B8A8
+                              : gfx::SurfaceFormat::R8G8B8X8;
 }
 
 gfx::IntSize
 MacIOSurfaceTextureHostOGL::GetSize() const {
   if (!mSurface) {
     return gfx::IntSize();
   }
   return gfx::IntSize(mSurface->GetDevicePixelWidth(),
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
@@ -90,18 +90,16 @@ public:
 
   virtual gfx::IntSize GetSize() const override;
 
 #ifdef MOZ_LAYERS_HAVE_LOG
   virtual const char* Name() override { return "MacIOSurfaceTextureHostOGL"; }
 #endif
 
 protected:
-  GLTextureSource* CreateTextureSourceForPlane(size_t aPlane);
-
   RefPtr<CompositorOGL> mCompositor;
   RefPtr<GLTextureSource> mTextureSource;
   RefPtr<MacIOSurface> mSurface;
 };
 
 } // namespace layers
 } // namespace mozilla
 
--- a/gfx/layers/opengl/OGLShaderProgram.cpp
+++ b/gfx/layers/opengl/OGLShaderProgram.cpp
@@ -42,17 +42,16 @@ AddUniforms(ProgramProfileOGL& aProfile)
         "uYTexture",
         "uCbTexture",
         "uCrTexture",
         "uBlackTexture",
         "uWhiteTexture",
         "uMaskTexture",
         "uRenderColor",
         "uTexCoordMultiplier",
-        "uCbCrTexCoordMultiplier",
         "uTexturePass2",
         "uColorMatrix",
         "uColorMatrixVector",
         "uBlurRadius",
         "uBlurOffset",
         "uBlurAlpha",
         "uBlurGaussianKernel",
         "uSSEdges",
@@ -104,24 +103,16 @@ ShaderConfigOGL::SetOpacity(bool aEnable
 {
   SetFeature(ENABLE_OPACITY, aEnabled);
 }
 
 void
 ShaderConfigOGL::SetYCbCr(bool aEnabled)
 {
   SetFeature(ENABLE_TEXTURE_YCBCR, aEnabled);
-  MOZ_ASSERT(!(mFeatures & ENABLE_TEXTURE_NV12));
-}
-
-void
-ShaderConfigOGL::SetNV12(bool aEnabled)
-{
-  SetFeature(ENABLE_TEXTURE_NV12, aEnabled);
-  MOZ_ASSERT(!(mFeatures & ENABLE_TEXTURE_YCBCR));
 }
 
 void
 ShaderConfigOGL::SetComponentAlpha(bool aEnabled)
 {
   SetFeature(ENABLE_TEXTURE_COMPONENT_ALPHA, aEnabled);
 }
 
@@ -305,35 +296,28 @@ ProgramProfileOGL::GetProfileFor(ShaderC
     }
   }
 
   const char *sampler2D = "sampler2D";
   const char *texture2D = "texture2D";
 
   if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) {
     fs << "uniform vec2 uTexCoordMultiplier;" << endl;
-    if (aConfig.mFeatures & ENABLE_TEXTURE_YCBCR ||
-        aConfig.mFeatures & ENABLE_TEXTURE_NV12) {
-      fs << "uniform vec2 uCbCrTexCoordMultiplier;" << endl;
-    }
     sampler2D = "sampler2DRect";
     texture2D = "texture2DRect";
   }
 
   if (aConfig.mFeatures & ENABLE_TEXTURE_EXTERNAL) {
     sampler2D = "samplerExternalOES";
   }
 
   if (aConfig.mFeatures & ENABLE_TEXTURE_YCBCR) {
     fs << "uniform sampler2D uYTexture;" << endl;
     fs << "uniform sampler2D uCbTexture;" << endl;
     fs << "uniform sampler2D uCrTexture;" << endl;
-  } else if (aConfig.mFeatures & ENABLE_TEXTURE_NV12) {
-    fs << "uniform " << sampler2D << " uYTexture;" << endl;
-    fs << "uniform " << sampler2D << " uCbTexture;" << endl;
   } else if (aConfig.mFeatures & ENABLE_TEXTURE_COMPONENT_ALPHA) {
     fs << "uniform sampler2D uBlackTexture;" << endl;
     fs << "uniform sampler2D uWhiteTexture;" << endl;
     fs << "uniform bool uTexturePass2;" << endl;
   } else {
     fs << "uniform " << sampler2D << " uTexture;" << endl;
   }
 
@@ -345,39 +329,20 @@ ProgramProfileOGL::GetProfileFor(ShaderC
 
   if (aConfig.mFeatures & ENABLE_DEAA) {
     fs << "uniform vec3 uSSEdges[4];" << endl;
   }
 
   if (!(aConfig.mFeatures & ENABLE_RENDER_COLOR)) {
     fs << "vec4 sample(vec2 coord) {" << endl;
     fs << "  vec4 color;" << endl;
-    if (aConfig.mFeatures & ENABLE_TEXTURE_YCBCR ||
-        aConfig.mFeatures & ENABLE_TEXTURE_NV12) {
-      if (aConfig.mFeatures & ENABLE_TEXTURE_YCBCR) {
-        if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) {
-          fs << "  COLOR_PRECISION float y = texture2D(uYTexture, coord * uTexCoordMultiplier).r;" << endl;
-          fs << "  COLOR_PRECISION float cb = texture2D(uCbTexture, coord * uCbCrTexCoordMultiplier).r;" << endl;
-          fs << "  COLOR_PRECISION float cr = texture2D(uCrTexture, coord * uCbCrTexCoordMultiplier).r;" << endl;
-        } else {
-          fs << "  COLOR_PRECISION float y = texture2D(uYTexture, coord).r;" << endl;
-          fs << "  COLOR_PRECISION float cb = texture2D(uCbTexture, coord).r;" << endl;
-          fs << "  COLOR_PRECISION float cr = texture2D(uCrTexture, coord).r;" << endl;
-        }
-      } else {
-        if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) {
-          fs << "  COLOR_PRECISION float y = " << texture2D << "(uYTexture, coord * uTexCoordMultiplier).r;" << endl;
-          fs << "  COLOR_PRECISION float cb = " << texture2D << "(uCbTexture, coord * uCbCrTexCoordMultiplier).r;" << endl;
-          fs << "  COLOR_PRECISION float cr = " << texture2D << "(uCbTexture, coord * uCbCrTexCoordMultiplier).a;" << endl;
-        } else {
-          fs << "  COLOR_PRECISION float y = " << texture2D << "(uYTexture, coord).r;" << endl;
-          fs << "  COLOR_PRECISION float cb = " << texture2D << "(uCbTexture, coord).r;" << endl;
-          fs << "  COLOR_PRECISION float cr = " << texture2D << "(uCbTexture, coord).a;" << endl;
-        }
-      }
+    if (aConfig.mFeatures & ENABLE_TEXTURE_YCBCR) {
+      fs << "  COLOR_PRECISION float y = texture2D(uYTexture, coord).r;" << endl;
+      fs << "  COLOR_PRECISION float cb = texture2D(uCbTexture, coord).r;" << endl;
+      fs << "  COLOR_PRECISION float cr = texture2D(uCrTexture, coord).r;" << endl;
 
       /* From Rec601:
 [R]   [1.1643835616438356,  0.0,                 1.5960267857142858]      [ Y -  16]
 [G] = [1.1643835616438358, -0.3917622900949137, -0.8129676472377708]    x [Cb - 128]
 [B]   [1.1643835616438356,  2.017232142857143,   8.862867620416422e-17]   [Cr - 128]
 
 For [0,1] instead of [0,255], and to 5 places:
 [R]   [1.16438,  0.00000,  1.59603]   [ Y - 0.06275]
@@ -395,21 +360,17 @@ For [0,1] instead of [0,255], and to 5 p
       fs << "  COLOR_PRECISION vec3 onBlack = texture2D(uBlackTexture, coord).rgb;" << endl;
       fs << "  COLOR_PRECISION vec3 onWhite = texture2D(uWhiteTexture, coord).rgb;" << endl;
       fs << "  COLOR_PRECISION vec4 alphas = (1.0 - onWhite + onBlack).rgbg;" << endl;
       fs << "  if (uTexturePass2)" << endl;
       fs << "    color = vec4(onBlack, alphas.a);" << endl;
       fs << "  else" << endl;
       fs << "    color = alphas;" << endl;
     } else {
-      if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) {
-        fs << "  color = " << texture2D << "(uTexture, coord * uTexCoordMultiplier);" << endl;
-      } else {
-        fs << "  color = " << texture2D << "(uTexture, coord);" << endl;
-      }
+      fs << "  color = " << texture2D << "(uTexture, coord);" << endl;
     }
     if (aConfig.mFeatures & ENABLE_TEXTURE_RB_SWAP) {
       fs << "  color = color.bgra;" << endl;
     }
     if (aConfig.mFeatures & ENABLE_TEXTURE_NO_ALPHA) {
       fs << "  color = vec4(color.rgb, 1.0);" << endl;
     }
     fs << "  return color;" << endl;
@@ -438,17 +399,21 @@ For [0,1] instead of [0,255], and to 5 p
       fs << "  return color;" << endl;
       fs << "}" << endl;
     }
   }
   fs << "void main() {" << endl;
   if (aConfig.mFeatures & ENABLE_RENDER_COLOR) {
     fs << "  vec4 color = uRenderColor;" << endl;
   } else {
-    fs << "  vec4 color = sample(vTexCoord);" << endl;
+    if (aConfig.mFeatures & ENABLE_TEXTURE_RECT) {
+      fs << "  vec4 color = sample(vTexCoord * uTexCoordMultiplier);" << endl;
+    } else {
+      fs << "  vec4 color = sample(vTexCoord);" << endl;
+    }
     if (aConfig.mFeatures & ENABLE_BLUR) {
       fs << "  color = blur(color, vTexCoord);" << endl;
     }
     if (aConfig.mFeatures & ENABLE_COLOR_MATRIX) {
       fs << "  color = uColorMatrix * vec4(color.rgb / color.a, color.a) + uColorMatrixVector;" << endl;
       fs << "  color.rgb *= color.a;" << endl;
     }
     if (aConfig.mFeatures & ENABLE_OPACITY) {
@@ -485,18 +450,16 @@ For [0,1] instead of [0,255], and to 5 p
   result.mVertexShaderString = vs.str();
   result.mFragmentShaderString = fs.str();
 
   if (aConfig.mFeatures & ENABLE_RENDER_COLOR) {
     result.mTextureCount = 0;
   } else {
     if (aConfig.mFeatures & ENABLE_TEXTURE_YCBCR) {
       result.mTextureCount = 3;
-    } else if (aConfig.mFeatures & ENABLE_TEXTURE_NV12) {
-      result.mTextureCount = 2;
     } else if (aConfig.mFeatures & ENABLE_TEXTURE_COMPONENT_ALPHA) {
       result.mTextureCount = 2;
     } else {
       result.mTextureCount = 1;
     }
   }
   if (aConfig.mFeatures & ENABLE_MASK_2D ||
       aConfig.mFeatures & ENABLE_MASK_3D) {
--- a/gfx/layers/opengl/OGLShaderProgram.h
+++ b/gfx/layers/opengl/OGLShaderProgram.h
@@ -27,27 +27,26 @@ namespace layers {
 
 class Layer;
 
 enum ShaderFeatures {
   ENABLE_RENDER_COLOR=0x01,
   ENABLE_TEXTURE_RECT=0x02,
   ENABLE_TEXTURE_EXTERNAL=0x04,
   ENABLE_TEXTURE_YCBCR=0x08,
-  ENABLE_TEXTURE_NV12=0x10,
-  ENABLE_TEXTURE_COMPONENT_ALPHA=0x20,
-  ENABLE_TEXTURE_NO_ALPHA=0x40,
-  ENABLE_TEXTURE_RB_SWAP=0x80,
-  ENABLE_OPACITY=0x100,
-  ENABLE_BLUR=0x200,
-  ENABLE_COLOR_MATRIX=0x400,
-  ENABLE_MASK_2D=0x800,
-  ENABLE_MASK_3D=0x1000,
-  ENABLE_PREMULTIPLY=0x2000,
-  ENABLE_DEAA=0x4000
+  ENABLE_TEXTURE_COMPONENT_ALPHA=0x10,
+  ENABLE_TEXTURE_NO_ALPHA=0x20,
+  ENABLE_TEXTURE_RB_SWAP=0x40,
+  ENABLE_OPACITY=0x80,
+  ENABLE_BLUR=0x100,
+  ENABLE_COLOR_MATRIX=0x200,
+  ENABLE_MASK_2D=0x400,
+  ENABLE_MASK_3D=0x800,
+  ENABLE_PREMULTIPLY=0x1000,
+  ENABLE_DEAA=0x2000
 };
 
 class KnownUniform {
 public:
   // this needs to be kept in sync with strings in 'AddUniforms'
   enum KnownUniformName {
     NotAKnownUniform = -1,
 
@@ -64,17 +63,16 @@ public:
     YTexture,
     CbTexture,
     CrTexture,
     BlackTexture,
     WhiteTexture,
     MaskTexture,
     RenderColor,
     TexCoordMultiplier,
-    CbCrTexCoordMultiplier,
     TexturePass2,
     ColorMatrix,
     ColorMatrixVector,
     BlurRadius,
     BlurOffset,
     BlurAlpha,
     BlurGaussianKernel,
     SSEdges,
@@ -212,17 +210,16 @@ public:
     mFeatures(0) {}
 
   void SetRenderColor(bool aEnabled);
   void SetTextureTarget(GLenum aTarget);
   void SetRBSwap(bool aEnabled);
   void SetNoAlpha(bool aEnabled);
   void SetOpacity(bool aEnabled);
   void SetYCbCr(bool aEnabled);
-  void SetNV12(bool aEnabled);
   void SetComponentAlpha(bool aEnabled);
   void SetColorMatrix(bool aEnabled);
   void SetBlur(bool aEnabled);
   void SetMask2D(bool aEnabled);
   void SetMask3D(bool aEnabled);
   void SetPremultiply(bool aEnabled);
   void SetDEAA(bool aEnabled);
 
@@ -413,21 +410,16 @@ public:
   }
 
   void SetYCbCrTextureUnits(GLint aYUnit, GLint aCbUnit, GLint aCrUnit) {
     SetUniform(KnownUniform::YTexture, aYUnit);
     SetUniform(KnownUniform::CbTexture, aCbUnit);
     SetUniform(KnownUniform::CrTexture, aCrUnit);
   }
 
-  void SetNV12TextureUnits(GLint aYUnit, GLint aCbCrUnit) {
-    SetUniform(KnownUniform::YTexture, aYUnit);
-    SetUniform(KnownUniform::CbTexture, aCbCrUnit);
-  }
-
   void SetBlackTextureUnit(GLint aUnit) {
     SetUniform(KnownUniform::BlackTexture, aUnit);
   }
 
   void SetWhiteTextureUnit(GLint aUnit) {
     SetUniform(KnownUniform::WhiteTexture, aUnit);
   }
 
@@ -449,21 +441,16 @@ public:
     SetUniform(KnownUniform::ColorMatrixVector, 4, &aColorMatrix._51);
   }
 
   void SetTexCoordMultiplier(float aWidth, float aHeight) {
     float f[] = {aWidth, aHeight};
     SetUniform(KnownUniform::TexCoordMultiplier, 2, f);
   }
 
-  void SetCbCrTexCoordMultiplier(float aWidth, float aHeight) {
-    float f[] = {aWidth, aHeight};
-    SetUniform(KnownUniform::CbCrTexCoordMultiplier, 2, f);
-  }
-
   // Set whether we want the component alpha shader to return the color
   // vector (pass 1, false) or the alpha vector (pass2, true). With support
   // for multiple render targets we wouldn't need two passes here.
   void SetTexturePass2(bool aFlag) {
     SetUniform(KnownUniform::TexturePass2, aFlag ? 1 : 0);
   }
 
   void SetBlurRadius(float aRX, float aRY);