Update from https://crrev.com/308331

Fix ui/compositor/compositor.(h|cpp) based on http://crrev.com/738983002

Fix sky/engine based on current Blink code

R=qsr@chromium.org

Review URL: https://codereview.chromium.org/812543002
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index 3d0eaa2..f501cd9 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -67,6 +67,28 @@
   EXPECT_TRUE(NoCommandsWritten());
 }
 
+TEST_F(GLES2ImplementationTest, BindSampler) {
+  struct Cmds {
+    cmds::BindSampler cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init(1, 2);
+
+  gl_->BindSampler(1, 2);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, BindTransformFeedback) {
+  struct Cmds {
+    cmds::BindTransformFeedback cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init(GL_TRANSFORM_FEEDBACK, 2);
+
+  gl_->BindTransformFeedback(GL_TRANSFORM_FEEDBACK, 2);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
 TEST_F(GLES2ImplementationTest, BlendColor) {
   struct Cmds {
     cmds::BlendColor cmd;
@@ -312,6 +334,20 @@
   EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
 }
 
+TEST_F(GLES2ImplementationTest, DeleteSamplers) {
+  GLuint ids[2] = {kSamplersStartId, kSamplersStartId + 1};
+  struct Cmds {
+    cmds::DeleteSamplersImmediate del;
+    GLuint data[2];
+  };
+  Cmds expected;
+  expected.del.Init(arraysize(ids), &ids[0]);
+  expected.data[0] = kSamplersStartId;
+  expected.data[1] = kSamplersStartId + 1;
+  gl_->DeleteSamplers(arraysize(ids), &ids[0]);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
 TEST_F(GLES2ImplementationTest, DeleteShader) {
   struct Cmds {
     cmds::DeleteShader cmd;
@@ -337,6 +373,20 @@
   EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
 }
 
+TEST_F(GLES2ImplementationTest, DeleteTransformFeedbacks) {
+  GLuint ids[2] = {kTransformFeedbacksStartId, kTransformFeedbacksStartId + 1};
+  struct Cmds {
+    cmds::DeleteTransformFeedbacksImmediate del;
+    GLuint data[2];
+  };
+  Cmds expected;
+  expected.del.Init(arraysize(ids), &ids[0]);
+  expected.data[0] = kTransformFeedbacksStartId;
+  expected.data[1] = kTransformFeedbacksStartId + 1;
+  gl_->DeleteTransformFeedbacks(arraysize(ids), &ids[0]);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
 TEST_F(GLES2ImplementationTest, DepthFunc) {
   struct Cmds {
     cmds::DepthFunc cmd;
@@ -543,6 +593,24 @@
   EXPECT_EQ(kRenderbuffersStartId + 1, ids[1]);
 }
 
+TEST_F(GLES2ImplementationTest, GenSamplers) {
+  GLuint ids[2] = {
+      0,
+  };
+  struct Cmds {
+    cmds::GenSamplersImmediate gen;
+    GLuint data[2];
+  };
+  Cmds expected;
+  expected.gen.Init(arraysize(ids), &ids[0]);
+  expected.data[0] = kSamplersStartId;
+  expected.data[1] = kSamplersStartId + 1;
+  gl_->GenSamplers(arraysize(ids), &ids[0]);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+  EXPECT_EQ(kSamplersStartId, ids[0]);
+  EXPECT_EQ(kSamplersStartId + 1, ids[1]);
+}
+
 TEST_F(GLES2ImplementationTest, GenTextures) {
   GLuint ids[2] = {
       0,
@@ -560,6 +628,24 @@
   EXPECT_EQ(kTexturesStartId, ids[0]);
   EXPECT_EQ(kTexturesStartId + 1, ids[1]);
 }
+
+TEST_F(GLES2ImplementationTest, GenTransformFeedbacks) {
+  GLuint ids[2] = {
+      0,
+  };
+  struct Cmds {
+    cmds::GenTransformFeedbacksImmediate gen;
+    GLuint data[2];
+  };
+  Cmds expected;
+  expected.gen.Init(arraysize(ids), &ids[0]);
+  expected.data[0] = kTransformFeedbacksStartId;
+  expected.data[1] = kTransformFeedbacksStartId + 1;
+  gl_->GenTransformFeedbacks(arraysize(ids), &ids[0]);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+  EXPECT_EQ(kTransformFeedbacksStartId, ids[0]);
+  EXPECT_EQ(kTransformFeedbacksStartId + 1, ids[1]);
+}
 // TODO: Implement unit test for GetActiveAttrib
 // TODO: Implement unit test for GetActiveUniform
 // TODO: Implement unit test for GetAttachedShaders
@@ -707,6 +793,40 @@
   EXPECT_EQ(static_cast<Result::Type>(1), result);
 }
 
+TEST_F(GLES2ImplementationTest, GetSamplerParameterfv) {
+  struct Cmds {
+    cmds::GetSamplerParameterfv cmd;
+  };
+  typedef cmds::GetSamplerParameterfv::Result Result;
+  Result::Type result = 0;
+  Cmds expected;
+  ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+  expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
+  EXPECT_CALL(*command_buffer(), OnFlush())
+      .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+      .RetiresOnSaturation();
+  gl_->GetSamplerParameterfv(123, GL_TEXTURE_MAG_FILTER, &result);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+  EXPECT_EQ(static_cast<Result::Type>(1), result);
+}
+
+TEST_F(GLES2ImplementationTest, GetSamplerParameteriv) {
+  struct Cmds {
+    cmds::GetSamplerParameteriv cmd;
+  };
+  typedef cmds::GetSamplerParameteriv::Result Result;
+  Result::Type result = 0;
+  Cmds expected;
+  ExpectedMemoryInfo result1 = GetExpectedResultMemory(4);
+  expected.cmd.Init(123, GL_TEXTURE_MAG_FILTER, result1.id, result1.offset);
+  EXPECT_CALL(*command_buffer(), OnFlush())
+      .WillOnce(SetMemory(result1.ptr, SizedResultHelper<Result::Type>(1)))
+      .RetiresOnSaturation();
+  gl_->GetSamplerParameteriv(123, GL_TEXTURE_MAG_FILTER, &result);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+  EXPECT_EQ(static_cast<Result::Type>(1), result);
+}
+
 TEST_F(GLES2ImplementationTest, GetShaderiv) {
   struct Cmds {
     cmds::GetShaderiv cmd;
@@ -941,6 +1061,25 @@
   EXPECT_TRUE(result);
 }
 
+TEST_F(GLES2ImplementationTest, IsSampler) {
+  struct Cmds {
+    cmds::IsSampler cmd;
+  };
+
+  Cmds expected;
+  ExpectedMemoryInfo result1 =
+      GetExpectedResultMemory(sizeof(cmds::IsSampler::Result));
+  expected.cmd.Init(1, result1.id, result1.offset);
+
+  EXPECT_CALL(*command_buffer(), OnFlush())
+      .WillOnce(SetMemory(result1.ptr, uint32_t(1)))
+      .RetiresOnSaturation();
+
+  GLboolean result = gl_->IsSampler(1);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+  EXPECT_TRUE(result);
+}
+
 TEST_F(GLES2ImplementationTest, IsShader) {
   struct Cmds {
     cmds::IsShader cmd;
@@ -979,6 +1118,25 @@
   EXPECT_TRUE(result);
 }
 
+TEST_F(GLES2ImplementationTest, IsTransformFeedback) {
+  struct Cmds {
+    cmds::IsTransformFeedback cmd;
+  };
+
+  Cmds expected;
+  ExpectedMemoryInfo result1 =
+      GetExpectedResultMemory(sizeof(cmds::IsTransformFeedback::Result));
+  expected.cmd.Init(1, result1.id, result1.offset);
+
+  EXPECT_CALL(*command_buffer(), OnFlush())
+      .WillOnce(SetMemory(result1.ptr, uint32_t(1)))
+      .RetiresOnSaturation();
+
+  GLboolean result = gl_->IsTransformFeedback(1);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+  EXPECT_TRUE(result);
+}
+
 TEST_F(GLES2ImplementationTest, LineWidth) {
   struct Cmds {
     cmds::LineWidth cmd;
@@ -1001,6 +1159,17 @@
   EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
 }
 
+TEST_F(GLES2ImplementationTest, PauseTransformFeedback) {
+  struct Cmds {
+    cmds::PauseTransformFeedback cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init();
+
+  gl_->PauseTransformFeedback();
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
 TEST_F(GLES2ImplementationTest, PixelStorei) {
   struct Cmds {
     cmds::PixelStorei cmd;
@@ -1056,6 +1225,17 @@
   EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
 }
 
+TEST_F(GLES2ImplementationTest, ResumeTransformFeedback) {
+  struct Cmds {
+    cmds::ResumeTransformFeedback cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init();
+
+  gl_->ResumeTransformFeedback();
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
 TEST_F(GLES2ImplementationTest, SampleCoverage) {
   struct Cmds {
     cmds::SampleCoverage cmd;
@@ -1067,6 +1247,60 @@
   EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
 }
 
+TEST_F(GLES2ImplementationTest, SamplerParameterf) {
+  struct Cmds {
+    cmds::SamplerParameterf cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+  gl_->SamplerParameterf(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, SamplerParameterfv) {
+  GLfloat data[1] = {0};
+  struct Cmds {
+    cmds::SamplerParameterfvImmediate cmd;
+    GLfloat data[1];
+  };
+
+  for (int jj = 0; jj < 1; ++jj) {
+    data[jj] = static_cast<GLfloat>(jj);
+  }
+  Cmds expected;
+  expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+  gl_->SamplerParameterfv(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, SamplerParameteri) {
+  struct Cmds {
+    cmds::SamplerParameteri cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+  gl_->SamplerParameteri(1, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, SamplerParameteriv) {
+  GLint data[1] = {0};
+  struct Cmds {
+    cmds::SamplerParameterivImmediate cmd;
+    GLint data[1];
+  };
+
+  for (int jj = 0; jj < 1; ++jj) {
+    data[jj] = static_cast<GLint>(jj);
+  }
+  Cmds expected;
+  expected.cmd.Init(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+  gl_->SamplerParameteriv(1, GL_TEXTURE_MAG_FILTER, &data[0]);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
 TEST_F(GLES2ImplementationTest, Scissor) {
   struct Cmds {
     cmds::Scissor cmd;
@@ -2122,6 +2356,28 @@
   EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
 }
 // TODO: Implement unit test for BeginQueryEXT
+
+TEST_F(GLES2ImplementationTest, BeginTransformFeedback) {
+  struct Cmds {
+    cmds::BeginTransformFeedback cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init(GL_POINTS);
+
+  gl_->BeginTransformFeedback(GL_POINTS);
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, EndTransformFeedback) {
+  struct Cmds {
+    cmds::EndTransformFeedback cmd;
+  };
+  Cmds expected;
+  expected.cmd.Init();
+
+  gl_->EndTransformFeedback();
+  EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
 // TODO: Implement unit test for InsertEventMarkerEXT
 // TODO: Implement unit test for PushGroupMarkerEXT