| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/display_compositor/buffer_queue.h" | 5 #include "components/display_compositor/buffer_queue.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 223 } |
| 224 | 224 |
| 225 class MockedContext : public cc::TestWebGraphicsContext3D { | 225 class MockedContext : public cc::TestWebGraphicsContext3D { |
| 226 public: | 226 public: |
| 227 MockedContext() { | 227 MockedContext() { |
| 228 ON_CALL(*this, createImageCHROMIUM(_, _, _, _)) | 228 ON_CALL(*this, createImageCHROMIUM(_, _, _, _)) |
| 229 .WillByDefault(testing::InvokeWithoutArgs(&CreateImageDefault)); | 229 .WillByDefault(testing::InvokeWithoutArgs(&CreateImageDefault)); |
| 230 } | 230 } |
| 231 MOCK_METHOD2(bindFramebuffer, void(GLenum, GLuint)); | 231 MOCK_METHOD2(bindFramebuffer, void(GLenum, GLuint)); |
| 232 MOCK_METHOD2(bindTexture, void(GLenum, GLuint)); | 232 MOCK_METHOD2(bindTexture, void(GLenum, GLuint)); |
| 233 MOCK_METHOD2(bindTexImage2DCHROMIUM, void(GLenum, GLint)); | 233 MOCK_METHOD3(bindTexImage2DCHROMIUM, void(GLenum, GLint, GLint)); |
| 234 MOCK_METHOD4(createImageCHROMIUM, | 234 MOCK_METHOD4(createImageCHROMIUM, |
| 235 GLuint(ClientBuffer, GLsizei, GLsizei, GLenum)); | 235 GLuint(ClientBuffer, GLsizei, GLsizei, GLenum)); |
| 236 MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint)); | 236 MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint)); |
| 237 MOCK_METHOD5(framebufferTexture2D, | 237 MOCK_METHOD5(framebufferTexture2D, |
| 238 void(GLenum, GLenum, GLenum, GLuint, GLint)); | 238 void(GLenum, GLenum, GLenum, GLuint, GLint)); |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 class BufferQueueMockedContextTest : public BufferQueueTest { | 241 class BufferQueueMockedContextTest : public BufferQueueTest { |
| 242 public: | 242 public: |
| 243 void SetUp() override { | 243 void SetUp() override { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 EXPECT_CALL(*context, bindTexture(target, Ne(0U))); | 303 EXPECT_CALL(*context, bindTexture(target, Ne(0U))); |
| 304 EXPECT_CALL(*context, destroyImageCHROMIUM(1)); | 304 EXPECT_CALL(*context, destroyImageCHROMIUM(1)); |
| 305 Expectation image = | 305 Expectation image = |
| 306 EXPECT_CALL(*context, createImageCHROMIUM(_, 0, 0, GL_RGB)) | 306 EXPECT_CALL(*context, createImageCHROMIUM(_, 0, 0, GL_RGB)) |
| 307 .WillOnce(Return(1)); | 307 .WillOnce(Return(1)); |
| 308 Expectation fb = | 308 Expectation fb = |
| 309 EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U))); | 309 EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U))); |
| 310 Expectation tex = EXPECT_CALL(*context, bindTexture(target, Ne(0U))); | 310 Expectation tex = EXPECT_CALL(*context, bindTexture(target, Ne(0U))); |
| 311 Expectation bind_tex = | 311 Expectation bind_tex = |
| 312 EXPECT_CALL(*context, bindTexImage2DCHROMIUM(target, 1)) | 312 EXPECT_CALL(*context, bindTexImage2DCHROMIUM(target, 1, 0)) |
| 313 .After(tex, image); | 313 .After(tex, image); |
| 314 EXPECT_CALL(*context, | 314 EXPECT_CALL(*context, |
| 315 framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | 315 framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 316 target, Ne(0U), _)) | 316 target, Ne(0U), _)) |
| 317 .After(fb, bind_tex); | 317 .After(fb, bind_tex); |
| 318 | 318 |
| 319 output_surface->BindFramebuffer(); | 319 output_surface->BindFramebuffer(); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 testing::Mock::VerifyAndClearExpectations(mock_output_surface_); | 671 testing::Mock::VerifyAndClearExpectations(mock_output_surface_); |
| 672 EXPECT_CALL(*mock_output_surface_, | 672 EXPECT_CALL(*mock_output_surface_, |
| 673 CopyBufferDamage(target_texture, source_texture, small_damage, _)) | 673 CopyBufferDamage(target_texture, source_texture, small_damage, _)) |
| 674 .Times(1); | 674 .Times(1); |
| 675 output_surface_->SwapBuffers(small_damage); | 675 output_surface_->SwapBuffers(small_damage); |
| 676 testing::Mock::VerifyAndClearExpectations(mock_output_surface_); | 676 testing::Mock::VerifyAndClearExpectations(mock_output_surface_); |
| 677 } | 677 } |
| 678 | 678 |
| 679 } // namespace | 679 } // namespace |
| 680 } // namespace display_compositor | 680 } // namespace display_compositor |
| OLD | NEW |