D3D11: Implement dirty bits for texture updates.

BUG=angleproject:1387

Change-Id: I5f759c3dc60b53a5d4f8a1dd1f4a1d3d5330bfda
Reviewed-on: https://chromium-review.googlesource.com/648487
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/tests/gl_tests/PbufferTest.cpp b/src/tests/gl_tests/PbufferTest.cpp
index 01254f4..f3b5dac 100644
--- a/src/tests/gl_tests/PbufferTest.cpp
+++ b/src/tests/gl_tests/PbufferTest.cpp
@@ -5,6 +5,7 @@
 //
 
 #include "test_utils/ANGLETest.h"
+#include "test_utils/gl_raii.h"
 
 using namespace angle;
 
@@ -216,20 +217,10 @@
 // size information is correctly updated.
 TEST_P(PbufferTest, TextureSizeReset)
 {
-    if (!mSupportsPbuffers)
-    {
-        std::cout << "Test skipped because Pbuffers are not supported." << std::endl;
-        return;
-    }
+    ANGLE_SKIP_TEST_IF(!mSupportsPbuffers);
+    ANGLE_SKIP_TEST_IF(!mSupportsBindTexImage);
 
-    if (!mSupportsBindTexImage)
-    {
-        std::cout << "Test skipped because Pbuffer does not support binding to RGBA textures." << std::endl;
-        return;
-    }
-
-    GLuint texture = 0;
-    glGenTextures(1, &texture);
+    GLTexture texture;
     glBindTexture(GL_TEXTURE_2D, texture);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -241,14 +232,15 @@
     glUniform1i(mTextureUniformLocation, 0);
 
     // Fill the texture with white pixels
-    std::vector<GLubyte> whitePixels(mPbufferSize * mPbufferSize * 4, 255);
+    std::vector<GLColor> whitePixels(mPbufferSize * mPbufferSize, GLColor::white);
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, static_cast<GLsizei>(mPbufferSize),
-                 static_cast<GLsizei>(mPbufferSize), 0, GL_RGBA, GL_UNSIGNED_BYTE, &whitePixels[0]);
+                 static_cast<GLsizei>(mPbufferSize), 0, GL_RGBA, GL_UNSIGNED_BYTE,
+                 whitePixels.data());
     EXPECT_GL_NO_ERROR();
 
     // Draw the white texture and verify that the pixels are correct
     drawQuad(mTextureProgram, "position", 0.5f);
-    EXPECT_PIXEL_EQ(0, 0, 255, 255, 255, 255);
+    EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::white);
 
     // Bind the EGL surface and draw with it, results are undefined since nothing has
     // been written to it
@@ -260,13 +252,13 @@
     // Clear the back buffer to a unique color (green)
     glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
     glClear(GL_COLOR_BUFFER_BIT);
-    EXPECT_PIXEL_EQ(0, 0, 0, 255, 0, 255);
+    EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
 
     // Unbind the EGL surface and try to draw with the texture again, the texture's size should
     // now be zero and incomplete so the back buffer should be black
     eglReleaseTexImage(window->getDisplay(), mPbuffer, EGL_BACK_BUFFER);
     drawQuad(mTextureProgram, "position", 0.5f);
-    EXPECT_PIXEL_EQ(0, 0, 0, 0, 0, 255);
+    EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::black);
 }
 
 // Bind a Pbuffer, redefine the texture, and verify it renders correctly