| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, | 319 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, |
| 320 &releaseCallback)); | 320 &releaseCallback)); |
| 321 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); | 321 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); |
| 322 EXPECT_TRUE(textureMailbox.is_overlay_candidate()); | 322 EXPECT_TRUE(textureMailbox.is_overlay_candidate()); |
| 323 testing::Mock::VerifyAndClearExpectations(m_gl); | 323 testing::Mock::VerifyAndClearExpectations(m_gl); |
| 324 | 324 |
| 325 GLuint m_imageId2 = m_gl->nextImageIdToBeCreated(); | 325 GLuint m_imageId2 = m_gl->nextImageIdToBeCreated(); |
| 326 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId2)).Times(1); | 326 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId2)).Times(1); |
| 327 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId0)).Times(1); | 327 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId0)).Times(1); |
| 328 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId0)).Times(1); | 328 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId0)).Times(1); |
| 329 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId1)).Times(1); | |
| 330 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId1)).Times(1); | |
| 331 // Resize to 100x50. | 329 // Resize to 100x50. |
| 332 m_drawingBuffer->reset(alternateSize); | 330 m_drawingBuffer->reset(alternateSize); |
| 333 releaseCallback->Run(gpu::SyncToken(), false /* lostResource */); | 331 releaseCallback->Run(gpu::SyncToken(), false /* lostResource */); |
| 334 testing::Mock::VerifyAndClearExpectations(m_gl); | 332 testing::Mock::VerifyAndClearExpectations(m_gl); |
| 335 | 333 |
| 336 GLuint m_imageId3 = m_gl->nextImageIdToBeCreated(); | 334 GLuint m_imageId3 = m_gl->nextImageIdToBeCreated(); |
| 337 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId3)).Times(1); | 335 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId3)).Times(1); |
| 338 // Produce a mailbox at this size. | 336 // Produce a mailbox at this size. |
| 339 m_drawingBuffer->markContentsChanged(); | 337 m_drawingBuffer->markContentsChanged(); |
| 338 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId1)).Times(1); |
| 339 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId1)).Times(1); |
| 340 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, | 340 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, |
| 341 &releaseCallback)); | 341 &releaseCallback)); |
| 342 EXPECT_EQ(alternateSize, m_gl->mostRecentlyProducedSize()); | 342 EXPECT_EQ(alternateSize, m_gl->mostRecentlyProducedSize()); |
| 343 EXPECT_TRUE(textureMailbox.is_overlay_candidate()); | 343 EXPECT_TRUE(textureMailbox.is_overlay_candidate()); |
| 344 testing::Mock::VerifyAndClearExpectations(m_gl); | 344 testing::Mock::VerifyAndClearExpectations(m_gl); |
| 345 | 345 |
| 346 GLuint m_imageId4 = m_gl->nextImageIdToBeCreated(); | 346 GLuint m_imageId4 = m_gl->nextImageIdToBeCreated(); |
| 347 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId4)).Times(1); | 347 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId4)).Times(1); |
| 348 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId2)).Times(1); | 348 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId2)).Times(1); |
| 349 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId2)).Times(1); | 349 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId2)).Times(1); |
| 350 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId3)).Times(1); | |
| 351 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId3)).Times(1); | |
| 352 // Reset to initial size. | 350 // Reset to initial size. |
| 353 m_drawingBuffer->reset(initialSize); | 351 m_drawingBuffer->reset(initialSize); |
| 354 releaseCallback->Run(gpu::SyncToken(), false /* lostResource */); | 352 releaseCallback->Run(gpu::SyncToken(), false /* lostResource */); |
| 355 testing::Mock::VerifyAndClearExpectations(m_gl); | 353 testing::Mock::VerifyAndClearExpectations(m_gl); |
| 356 | 354 |
| 357 GLuint m_imageId5 = m_gl->nextImageIdToBeCreated(); | 355 GLuint m_imageId5 = m_gl->nextImageIdToBeCreated(); |
| 358 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId5)).Times(1); | 356 EXPECT_CALL(*m_gl, BindTexImage2DMock(m_imageId5)).Times(1); |
| 359 // Prepare another mailbox and verify that it's the correct size. | 357 // Prepare another mailbox and verify that it's the correct size. |
| 360 m_drawingBuffer->markContentsChanged(); | 358 m_drawingBuffer->markContentsChanged(); |
| 359 EXPECT_CALL(*m_gl, DestroyImageMock(m_imageId3)).Times(1); |
| 360 EXPECT_CALL(*m_gl, ReleaseTexImage2DMock(m_imageId3)).Times(1); |
| 361 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, | 361 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, |
| 362 &releaseCallback)); | 362 &releaseCallback)); |
| 363 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); | 363 EXPECT_EQ(initialSize, m_gl->mostRecentlyProducedSize()); |
| 364 EXPECT_TRUE(textureMailbox.is_overlay_candidate()); | 364 EXPECT_TRUE(textureMailbox.is_overlay_candidate()); |
| 365 testing::Mock::VerifyAndClearExpectations(m_gl); | 365 testing::Mock::VerifyAndClearExpectations(m_gl); |
| 366 | 366 |
| 367 // Prepare one final mailbox and verify that it's the correct size. | 367 // Prepare one final mailbox and verify that it's the correct size. |
| 368 releaseCallback->Run(gpu::SyncToken(), false /* lostResource */); | 368 releaseCallback->Run(gpu::SyncToken(), false /* lostResource */); |
| 369 m_drawingBuffer->markContentsChanged(); | 369 m_drawingBuffer->markContentsChanged(); |
| 370 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, | 370 EXPECT_TRUE(m_drawingBuffer->PrepareTextureMailbox(&textureMailbox, |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 m_drawingBuffer->setIsHidden(true); | 589 m_drawingBuffer->setIsHidden(true); |
| 590 releaseCallback->Run(waitSyncToken, false /* lostResource */); | 590 releaseCallback->Run(waitSyncToken, false /* lostResource */); |
| 591 // m_drawingBuffer deletes mailbox immediately when hidden. | 591 // m_drawingBuffer deletes mailbox immediately when hidden. |
| 592 | 592 |
| 593 EXPECT_EQ(waitSyncToken, m_gl->mostRecentlyWaitedSyncToken()); | 593 EXPECT_EQ(waitSyncToken, m_gl->mostRecentlyWaitedSyncToken()); |
| 594 | 594 |
| 595 m_drawingBuffer->beginDestruction(); | 595 m_drawingBuffer->beginDestruction(); |
| 596 } | 596 } |
| 597 | 597 |
| 598 } // namespace blink | 598 } // namespace blink |
| OLD | NEW |