Bug 1311644 - Pass ImageBridge as allocator to create YCbCr texture client, r=nical
authorpeter chang <pchang@mozilla.com>
Tue, 08 Nov 2016 15:22:36 +0800
changeset 351911 ea948a05bfa4c2e9294d6f40eae649095c28074b
parent 351910 405843a8c845e324018b61e827d8bf990f36363f
child 351912 5ffa818f1cb34646e58543bc0443f9da3067c246
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1311644
milestone52.0a1
Bug 1311644 - Pass ImageBridge as allocator to create YCbCr texture client, r=nical MozReview-Commit-ID: 4P5LyWST0yv
gfx/tests/gtest/TestTextures.cpp
--- a/gfx/tests/gtest/TestTextures.cpp
+++ b/gfx/tests/gtest/TestTextures.cpp
@@ -3,19 +3,20 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 #include "gtest/gtest.h"
 #include "gmock/gmock.h"
 
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/Tools.h"
+#include "mozilla/layers/BufferTexture.h"
+#include "mozilla/layers/ImageBridgeChild.h"  // for ImageBridgeChild
 #include "mozilla/layers/TextureClient.h"
 #include "mozilla/layers/TextureHost.h"
-#include "mozilla/layers/BufferTexture.h"
 #include "mozilla/RefPtr.h"
 #include "gfx2DGlue.h"
 #include "gfxImageSurface.h"
 #include "gfxTypes.h"
 #include "ImageContainer.h"
 #include "mozilla/layers/ImageDataSerializer.h"
 
 using namespace mozilla;
@@ -261,16 +262,25 @@ TEST(Layers, TextureYCbCrSerialization) 
   clientData.mYUVColorSpace = YUVColorSpace::BT601;
   clientData.mYSkip = 0;
   clientData.mCbSkip = 0;
   clientData.mCrSkip = 0;
   clientData.mCrSkip = 0;
   clientData.mPicX = 0;
   clientData.mPicX = 0;
 
-  RefPtr<TextureClient> client = TextureClient::CreateForYCbCr(nullptr, clientData.mYSize, clientData.mCbCrSize,
+  ImageBridgeChild::InitSameProcess();
+  // wait until IPDL connection
+#ifdef XP_WIN
+  Sleep(1);
+#else
+  sleep(1);
+#endif
+  RefPtr<ImageBridgeChild> imageBridge = ImageBridgeChild::GetSingleton();
+
+  RefPtr<TextureClient> client = TextureClient::CreateForYCbCr(imageBridge, clientData.mYSize, clientData.mCbCrSize,
                                                                StereoMode::MONO, YUVColorSpace::BT601,
                                                                TextureFlags::DEALLOCATE_CLIENT);
 
   TestTextureClientYCbCr(client, clientData);
 
   // XXX - Test more texture client types.
 }