Bug 895116: CreateBasicDeprecatedTextureHost should pass along the texture flags r=mattwoodrow
authorDavid Zbarsky <dzbarsky@gmail.com>
Sun, 21 Jul 2013 04:16:28 -0700
changeset 151672 821e984ef42320a2d3b823e4f31262d10e28c472
parent 151671 776fa6a8a552a3dcc69a83f79375bd1ce13f2795
child 151673 039e13f659a6cfe2be01a8cb6c8d265e3814ffa4
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs895116
milestone25.0a1
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
Bug 895116: CreateBasicDeprecatedTextureHost should pass along the texture flags r=mattwoodrow
gfx/layers/basic/BasicCompositor.cpp
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -162,24 +162,28 @@ public:
 
 };
 
 TemporaryRef<DeprecatedTextureHost>
 CreateBasicDeprecatedTextureHost(SurfaceDescriptorType aDescriptorType,
                              uint32_t aTextureHostFlags,
                              uint32_t aTextureFlags)
 {
+  RefPtr<DeprecatedTextureHost> result = nullptr;
   if (aDescriptorType == SurfaceDescriptor::TYCbCrImage) {
-    return new YCbCrDeprecatedTextureHostBasic();
+    result = new YCbCrDeprecatedTextureHostBasic();
+  } else {
+    MOZ_ASSERT(aDescriptorType == SurfaceDescriptor::TShmem ||
+               aDescriptorType == SurfaceDescriptor::TMemoryImage,
+               "We can only support Shmem currently");
+    result = new DeprecatedTextureHostBasic();
   }
 
-  MOZ_ASSERT(aDescriptorType == SurfaceDescriptor::TShmem ||
-             aDescriptorType == SurfaceDescriptor::TMemoryImage,
-             "We can only support Shmem currently");
-  return new DeprecatedTextureHostBasic();
+  result->SetFlags(aTextureFlags);
+  return result.forget();
 }
 
 BasicCompositor::BasicCompositor(nsIWidget *aWidget)
   : mWidget(aWidget)
   , mWidgetSize(-1, -1)
 {
   MOZ_COUNT_CTOR(BasicCompositor);
   sBackend = LAYERS_BASIC;