Adds makeSwapChain9/11 functions.
TRAC #22134
Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1477 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/SwapChain11.cpp b/src/libGLESv2/renderer/SwapChain11.cpp
index bb2a92e..b1c5ec3 100644
--- a/src/libGLESv2/renderer/SwapChain11.cpp
+++ b/src/libGLESv2/renderer/SwapChain11.cpp
@@ -316,4 +316,11 @@
return mOffscreenTexture;
}
+SwapChain11 *SwapChain11::makeSwapChain11(SwapChain *swapChain)
+{
+ ASSERT(dynamic_cast<rx::SwapChain11*>(swapChain) != NULL);
+ return static_cast<rx::SwapChain11*>(swapChain);
}
+
+}
+
diff --git a/src/libGLESv2/renderer/SwapChain11.h b/src/libGLESv2/renderer/SwapChain11.h
index a9ff7eb..d912e80 100644
--- a/src/libGLESv2/renderer/SwapChain11.h
+++ b/src/libGLESv2/renderer/SwapChain11.h
@@ -32,6 +32,8 @@
virtual ID3D11DepthStencilView *getDepthStencil();
virtual ID3D11Texture2D *getOffscreenTexture();
+ static SwapChain11 *makeSwapChain11(SwapChain *swapChain);
+
private:
DISALLOW_COPY_AND_ASSIGN(SwapChain11);
diff --git a/src/libGLESv2/renderer/SwapChain9.cpp b/src/libGLESv2/renderer/SwapChain9.cpp
index 4e1fa04..069e65c 100644
--- a/src/libGLESv2/renderer/SwapChain9.cpp
+++ b/src/libGLESv2/renderer/SwapChain9.cpp
@@ -395,4 +395,10 @@
return mOffscreenTexture;
}
+SwapChain9 *SwapChain9::makeSwapChain9(SwapChain *swapChain)
+{
+ ASSERT(dynamic_cast<rx::SwapChain9*>(swapChain) != NULL);
+ return static_cast<rx::SwapChain9*>(swapChain);
+}
+
}
diff --git a/src/libGLESv2/renderer/SwapChain9.h b/src/libGLESv2/renderer/SwapChain9.h
index dc9d781..189fd88 100644
--- a/src/libGLESv2/renderer/SwapChain9.h
+++ b/src/libGLESv2/renderer/SwapChain9.h
@@ -32,6 +32,8 @@
virtual IDirect3DSurface9 *getDepthStencil();
virtual IDirect3DTexture9 *getOffscreenTexture();
+ static SwapChain9 *makeSwapChain9(SwapChain *swapChain);
+
private:
DISALLOW_COPY_AND_ASSIGN(SwapChain9);