Add helpers for multiview framebuffer init

Multiview tests now use common helpers to create textures for
multiview framebuffers and often also to attach the textures to the
framebuffers.

The tests now rely on uploaded texture data to initialize the buffers
instead of clearing the framebuffers with glClear.

BUG=angleproject:2765
TEST=angle_end2end_tests

Change-Id: I7d6d63add5943cab610ab888045d5b0f8ba29215
Reviewed-on: https://chromium-review.googlesource.com/1184712
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/tests/test_utils/MultiviewTest.h b/src/tests/test_utils/MultiviewTest.h
index 840cb97..9b93cc2 100644
--- a/src/tests/test_utils/MultiviewTest.h
+++ b/src/tests/test_utils/MultiviewTest.h
@@ -19,6 +19,46 @@
 // fragments.
 GLuint CreateSimplePassthroughProgram(int numViews);
 
+// Create a set of textures to use for multiview rendering. If multiviewLayout is
+// GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE, then 2D textures are created. If multiviewLayout is
+// GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE, then 2D texture arrays are created. Texture ids should be
+// created beforehand. If depthTexture or stencilTexture is 0, it will not be initialized.
+void CreateMultiviewBackingTextures(GLenum multiviewLayout,
+                                    int viewWidth,
+                                    int height,
+                                    int numLayers,
+                                    std::vector<GLuint> colorTextures,
+                                    GLuint depthTexture,
+                                    GLuint depthStencilTexture);
+void CreateMultiviewBackingTextures(GLenum multiviewLayout,
+                                    int viewWidth,
+                                    int height,
+                                    int numLayers,
+                                    GLuint colorTexture,
+                                    GLuint depthTexture,
+                                    GLuint depthStencilTexture);
+
+// Attach multiview textures to the framebuffer denoted by target. If there are multiple color
+// textures they get attached to different color attachments starting from 0. If multiviewLayout is
+// GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE, then the viewport offsets are set so that the views
+// are tightly packed inside the attachments.
+void AttachMultiviewTextures(GLenum target,
+                             GLenum multiviewLayout,
+                             int viewWidth,
+                             int numViews,
+                             int baseViewIndex,
+                             std::vector<GLuint> colorTextures,
+                             GLuint depthTexture,
+                             GLuint depthStencilTexture);
+void AttachMultiviewTextures(GLenum target,
+                             GLenum multiviewLayout,
+                             int viewWidth,
+                             int numViews,
+                             int baseViewIndex,
+                             GLuint colorTexture,
+                             GLuint depthTexture,
+                             GLuint depthStencilTexture);
+
 struct MultiviewImplementationParams : public PlatformParameters
 {
     MultiviewImplementationParams(GLint majorVersion,