Bug 1311644 - Pass ImageBridge as allocator to create YCbCr texture client, r?nical
MozReview-Commit-ID: 4P5LyWST0yv
--- 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.
}