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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 IntSize initialSize(initialWidth, initialHeight); | 245 IntSize initialSize(initialWidth, initialHeight); |
246 IntSize alternateSize(initialWidth, alternateHeight); | 246 IntSize alternateSize(initialWidth, alternateHeight); |
247 | 247 |
248 // Produce one mailbox at size 100x100. | 248 // Produce one mailbox at size 100x100. |
249 m_drawingBuffer->markContentsChanged(); | 249 m_drawingBuffer->markContentsChanged(); |
250 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 250 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
251 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); | 251 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); |
252 | 252 |
253 // Resize to 100x50. | 253 // Resize to 100x50. |
254 m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight)); | 254 m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight)); |
255 m_drawingBuffer->mailboxReleased(mailbox); | 255 m_drawingBuffer->mailboxReleased(mailbox, false); |
256 | 256 |
257 // Produce a mailbox at this size. | 257 // Produce a mailbox at this size. |
258 m_drawingBuffer->markContentsChanged(); | 258 m_drawingBuffer->markContentsChanged(); |
259 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 259 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
260 EXPECT_EQ(alternateSize, webContext()->mostRecentlyProducedSize()); | 260 EXPECT_EQ(alternateSize, webContext()->mostRecentlyProducedSize()); |
261 | 261 |
262 // Reset to initial size. | 262 // Reset to initial size. |
263 m_drawingBuffer->reset(IntSize(initialWidth, initialHeight)); | 263 m_drawingBuffer->reset(IntSize(initialWidth, initialHeight)); |
264 m_drawingBuffer->mailboxReleased(mailbox); | 264 m_drawingBuffer->mailboxReleased(mailbox, false); |
265 | 265 |
266 // Prepare another mailbox and verify that it's the correct size. | 266 // Prepare another mailbox and verify that it's the correct size. |
267 m_drawingBuffer->markContentsChanged(); | 267 m_drawingBuffer->markContentsChanged(); |
268 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 268 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
269 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); | 269 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); |
270 | 270 |
271 // Prepare one final mailbox and verify that it's the correct size. | 271 // Prepare one final mailbox and verify that it's the correct size. |
272 m_drawingBuffer->mailboxReleased(mailbox); | 272 m_drawingBuffer->mailboxReleased(mailbox, false); |
273 m_drawingBuffer->markContentsChanged(); | 273 m_drawingBuffer->markContentsChanged(); |
274 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 274 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
275 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); | 275 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); |
276 m_drawingBuffer->beginDestruction(); | 276 m_drawingBuffer->beginDestruction(); |
277 } | 277 } |
278 | 278 |
279 TEST_F(DrawingBufferTest, verifyDestructionCompleteAfterAllMailboxesReleased) | 279 TEST_F(DrawingBufferTest, verifyDestructionCompleteAfterAllMailboxesReleased) |
280 { | 280 { |
281 bool live = true; | 281 bool live = true; |
282 m_drawingBuffer->m_live = &live; | 282 m_drawingBuffer->m_live = &live; |
283 | 283 |
284 blink::WebExternalTextureMailbox mailbox1; | 284 blink::WebExternalTextureMailbox mailbox1; |
285 blink::WebExternalTextureMailbox mailbox2; | 285 blink::WebExternalTextureMailbox mailbox2; |
286 blink::WebExternalTextureMailbox mailbox3; | 286 blink::WebExternalTextureMailbox mailbox3; |
287 | 287 |
288 IntSize initialSize(initialWidth, initialHeight); | 288 IntSize initialSize(initialWidth, initialHeight); |
289 | 289 |
290 // Produce mailboxes. | 290 // Produce mailboxes. |
291 m_drawingBuffer->markContentsChanged(); | 291 m_drawingBuffer->markContentsChanged(); |
292 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox1, 0)); | 292 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox1, 0)); |
293 m_drawingBuffer->markContentsChanged(); | 293 m_drawingBuffer->markContentsChanged(); |
294 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox2, 0)); | 294 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox2, 0)); |
295 m_drawingBuffer->markContentsChanged(); | 295 m_drawingBuffer->markContentsChanged(); |
296 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox3, 0)); | 296 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox3, 0)); |
297 | 297 |
298 m_drawingBuffer->markContentsChanged(); | 298 m_drawingBuffer->markContentsChanged(); |
299 m_drawingBuffer->mailboxReleased(mailbox1); | 299 m_drawingBuffer->mailboxReleased(mailbox1, false); |
300 | 300 |
301 m_drawingBuffer->beginDestruction(); | 301 m_drawingBuffer->beginDestruction(); |
302 EXPECT_EQ(live, true); | 302 EXPECT_EQ(live, true); |
303 | 303 |
304 DrawingBufferForTests* weakPointer = m_drawingBuffer.get(); | 304 DrawingBufferForTests* weakPointer = m_drawingBuffer.get(); |
305 m_drawingBuffer.clear(); | 305 m_drawingBuffer.clear(); |
306 EXPECT_EQ(live, true); | 306 EXPECT_EQ(live, true); |
307 | 307 |
308 weakPointer->markContentsChanged(); | 308 weakPointer->markContentsChanged(); |
309 weakPointer->mailboxReleased(mailbox2); | 309 weakPointer->mailboxReleased(mailbox2, false); |
310 EXPECT_EQ(live, true); | 310 EXPECT_EQ(live, true); |
311 | 311 |
312 weakPointer->markContentsChanged(); | 312 weakPointer->markContentsChanged(); |
313 weakPointer->mailboxReleased(mailbox3); | 313 weakPointer->mailboxReleased(mailbox3, false); |
314 EXPECT_EQ(live, false); | 314 EXPECT_EQ(live, false); |
315 } | 315 } |
316 | 316 |
317 class TextureMailboxWrapper { | 317 class TextureMailboxWrapper { |
318 public: | 318 public: |
319 explicit TextureMailboxWrapper(const blink::WebExternalTextureMailbox& mailb
ox) | 319 explicit TextureMailboxWrapper(const blink::WebExternalTextureMailbox& mailb
ox) |
320 : m_mailbox(mailbox) | 320 : m_mailbox(mailbox) |
321 { } | 321 { } |
322 | 322 |
323 bool operator==(const TextureMailboxWrapper& other) const | 323 bool operator==(const TextureMailboxWrapper& other) const |
(...skipping 14 matching lines...) Expand all Loading... |
338 // Produce mailboxes. | 338 // Produce mailboxes. |
339 m_drawingBuffer->markContentsChanged(); | 339 m_drawingBuffer->markContentsChanged(); |
340 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox1, 0)); | 340 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox1, 0)); |
341 m_drawingBuffer->markContentsChanged(); | 341 m_drawingBuffer->markContentsChanged(); |
342 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox2, 0)); | 342 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox2, 0)); |
343 m_drawingBuffer->markContentsChanged(); | 343 m_drawingBuffer->markContentsChanged(); |
344 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox3, 0)); | 344 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox3, 0)); |
345 | 345 |
346 // Release mailboxes by specific order; 2, 3, 1. | 346 // Release mailboxes by specific order; 2, 3, 1. |
347 m_drawingBuffer->markContentsChanged(); | 347 m_drawingBuffer->markContentsChanged(); |
348 m_drawingBuffer->mailboxReleased(mailbox2); | 348 m_drawingBuffer->mailboxReleased(mailbox2, false); |
349 m_drawingBuffer->markContentsChanged(); | 349 m_drawingBuffer->markContentsChanged(); |
350 m_drawingBuffer->mailboxReleased(mailbox3); | 350 m_drawingBuffer->mailboxReleased(mailbox3, false); |
351 m_drawingBuffer->markContentsChanged(); | 351 m_drawingBuffer->markContentsChanged(); |
352 m_drawingBuffer->mailboxReleased(mailbox1); | 352 m_drawingBuffer->mailboxReleased(mailbox1, false); |
353 | 353 |
354 // The first recycled mailbox must be 2. | 354 // The first recycled mailbox must be 2. |
355 blink::WebExternalTextureMailbox recycledMailbox; | 355 blink::WebExternalTextureMailbox recycledMailbox; |
356 m_drawingBuffer->markContentsChanged(); | 356 m_drawingBuffer->markContentsChanged(); |
357 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&recycledMailbox, 0)); | 357 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&recycledMailbox, 0)); |
358 EXPECT_EQ(TextureMailboxWrapper(mailbox2), TextureMailboxWrapper(recycledMai
lbox)); | 358 EXPECT_EQ(TextureMailboxWrapper(mailbox2), TextureMailboxWrapper(recycledMai
lbox)); |
359 | 359 |
360 // The second recycled mailbox must be 3. | 360 // The second recycled mailbox must be 3. |
361 m_drawingBuffer->markContentsChanged(); | 361 m_drawingBuffer->markContentsChanged(); |
362 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&recycledMailbox, 0)); | 362 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&recycledMailbox, 0)); |
363 EXPECT_EQ(TextureMailboxWrapper(mailbox3), TextureMailboxWrapper(recycledMai
lbox)); | 363 EXPECT_EQ(TextureMailboxWrapper(mailbox3), TextureMailboxWrapper(recycledMai
lbox)); |
364 | 364 |
365 // The third recycled mailbox must be 1. | 365 // The third recycled mailbox must be 1. |
366 m_drawingBuffer->markContentsChanged(); | 366 m_drawingBuffer->markContentsChanged(); |
367 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&recycledMailbox, 0)); | 367 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&recycledMailbox, 0)); |
368 EXPECT_EQ(TextureMailboxWrapper(mailbox1), TextureMailboxWrapper(recycledMai
lbox)); | 368 EXPECT_EQ(TextureMailboxWrapper(mailbox1), TextureMailboxWrapper(recycledMai
lbox)); |
369 | 369 |
370 m_drawingBuffer->mailboxReleased(mailbox1); | 370 m_drawingBuffer->mailboxReleased(mailbox1, false); |
371 m_drawingBuffer->mailboxReleased(mailbox2); | 371 m_drawingBuffer->mailboxReleased(mailbox2, false); |
372 m_drawingBuffer->mailboxReleased(mailbox3); | 372 m_drawingBuffer->mailboxReleased(mailbox3, false); |
373 m_drawingBuffer->beginDestruction(); | 373 m_drawingBuffer->beginDestruction(); |
374 } | 374 } |
375 | 375 |
376 TEST_F(DrawingBufferTest, verifyInsertAndWaitSyncPointCorrectly) | 376 TEST_F(DrawingBufferTest, verifyInsertAndWaitSyncPointCorrectly) |
377 { | 377 { |
378 blink::WebExternalTextureMailbox mailbox; | 378 blink::WebExternalTextureMailbox mailbox; |
379 | 379 |
380 // Produce mailboxes. | 380 // Produce mailboxes. |
381 m_drawingBuffer->markContentsChanged(); | 381 m_drawingBuffer->markContentsChanged(); |
382 EXPECT_EQ(0u, webContext()->mostRecentlyWaitedSyncPoint()); | 382 EXPECT_EQ(0u, webContext()->mostRecentlyWaitedSyncPoint()); |
383 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 383 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
384 // prepareMailbox() does not wait for any sync point. | 384 // prepareMailbox() does not wait for any sync point. |
385 EXPECT_EQ(0u, webContext()->mostRecentlyWaitedSyncPoint()); | 385 EXPECT_EQ(0u, webContext()->mostRecentlyWaitedSyncPoint()); |
386 | 386 |
387 unsigned waitSyncPoint = webContext()->insertSyncPoint(); | 387 unsigned waitSyncPoint = webContext()->insertSyncPoint(); |
388 mailbox.syncPoint = waitSyncPoint; | 388 mailbox.syncPoint = waitSyncPoint; |
389 m_drawingBuffer->mailboxReleased(mailbox); | 389 m_drawingBuffer->mailboxReleased(mailbox, false); |
390 // m_drawingBuffer will wait for the sync point when recycling. | 390 // m_drawingBuffer will wait for the sync point when recycling. |
391 EXPECT_EQ(0u, webContext()->mostRecentlyWaitedSyncPoint()); | 391 EXPECT_EQ(0u, webContext()->mostRecentlyWaitedSyncPoint()); |
392 | 392 |
393 m_drawingBuffer->markContentsChanged(); | 393 m_drawingBuffer->markContentsChanged(); |
394 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 394 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
395 // m_drawingBuffer waits for the sync point when recycling in prepareMailbox
(). | 395 // m_drawingBuffer waits for the sync point when recycling in prepareMailbox
(). |
396 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); | 396 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); |
397 | 397 |
398 m_drawingBuffer->beginDestruction(); | 398 m_drawingBuffer->beginDestruction(); |
399 waitSyncPoint = webContext()->insertSyncPoint(); | 399 waitSyncPoint = webContext()->insertSyncPoint(); |
400 mailbox.syncPoint = waitSyncPoint; | 400 mailbox.syncPoint = waitSyncPoint; |
401 m_drawingBuffer->mailboxReleased(mailbox); | 401 m_drawingBuffer->mailboxReleased(mailbox, false); |
402 // m_drawingBuffer waits for the sync point because the destruction is in pr
ogress. | 402 // m_drawingBuffer waits for the sync point because the destruction is in pr
ogress. |
403 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); | 403 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); |
404 } | 404 } |
405 | 405 |
406 class DrawingBufferImageChromiumTest : public DrawingBufferTest { | 406 class DrawingBufferImageChromiumTest : public DrawingBufferTest { |
407 protected: | 407 protected: |
408 virtual void SetUp() | 408 virtual void SetUp() |
409 { | 409 { |
410 RefPtr<FakeContextEvictionManager> contextEvictionManager = adoptRef(new
FakeContextEvictionManager()); | 410 RefPtr<FakeContextEvictionManager> contextEvictionManager = adoptRef(new
FakeContextEvictionManager()); |
411 OwnPtr<WebGraphicsContext3DForTests> context = adoptPtr(new WebGraphicsC
ontext3DForTests); | 411 OwnPtr<WebGraphicsContext3DForTests> context = adoptPtr(new WebGraphicsC
ontext3DForTests); |
(...skipping 28 matching lines...) Expand all Loading... |
440 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); | 440 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); |
441 EXPECT_TRUE(mailbox.allowOverlay); | 441 EXPECT_TRUE(mailbox.allowOverlay); |
442 testing::Mock::VerifyAndClearExpectations(webContext()); | 442 testing::Mock::VerifyAndClearExpectations(webContext()); |
443 | 443 |
444 WGC3Duint m_imageId2 = webContext()->nextImageIdToBeCreated(); | 444 WGC3Duint m_imageId2 = webContext()->nextImageIdToBeCreated(); |
445 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId2)).Times(1); | 445 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId2)).Times(1); |
446 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId0)).Times(1); | 446 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId0)).Times(1); |
447 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId0)).Times(1); | 447 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId0)).Times(1); |
448 // Resize to 100x50. | 448 // Resize to 100x50. |
449 m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight)); | 449 m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight)); |
450 m_drawingBuffer->mailboxReleased(mailbox); | 450 m_drawingBuffer->mailboxReleased(mailbox, false); |
451 testing::Mock::VerifyAndClearExpectations(webContext()); | 451 testing::Mock::VerifyAndClearExpectations(webContext()); |
452 | 452 |
453 WGC3Duint m_imageId3 = webContext()->nextImageIdToBeCreated(); | 453 WGC3Duint m_imageId3 = webContext()->nextImageIdToBeCreated(); |
454 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId3)).Times(1); | 454 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId3)).Times(1); |
455 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId1)).Times(1); | 455 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId1)).Times(1); |
456 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId1)).Times(1); | 456 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId1)).Times(1); |
457 // Produce a mailbox at this size. | 457 // Produce a mailbox at this size. |
458 m_drawingBuffer->markContentsChanged(); | 458 m_drawingBuffer->markContentsChanged(); |
459 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 459 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
460 EXPECT_EQ(alternateSize, webContext()->mostRecentlyProducedSize()); | 460 EXPECT_EQ(alternateSize, webContext()->mostRecentlyProducedSize()); |
461 EXPECT_TRUE(mailbox.allowOverlay); | 461 EXPECT_TRUE(mailbox.allowOverlay); |
462 testing::Mock::VerifyAndClearExpectations(webContext()); | 462 testing::Mock::VerifyAndClearExpectations(webContext()); |
463 | 463 |
464 WGC3Duint m_imageId4 = webContext()->nextImageIdToBeCreated(); | 464 WGC3Duint m_imageId4 = webContext()->nextImageIdToBeCreated(); |
465 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId4)).Times(1); | 465 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId4)).Times(1); |
466 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId2)).Times(1); | 466 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId2)).Times(1); |
467 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId2)).Times(1); | 467 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId2)).Times(1); |
468 // Reset to initial size. | 468 // Reset to initial size. |
469 m_drawingBuffer->reset(IntSize(initialWidth, initialHeight)); | 469 m_drawingBuffer->reset(IntSize(initialWidth, initialHeight)); |
470 m_drawingBuffer->mailboxReleased(mailbox); | 470 m_drawingBuffer->mailboxReleased(mailbox, false); |
471 testing::Mock::VerifyAndClearExpectations(webContext()); | 471 testing::Mock::VerifyAndClearExpectations(webContext()); |
472 | 472 |
473 WGC3Duint m_imageId5 = webContext()->nextImageIdToBeCreated(); | 473 WGC3Duint m_imageId5 = webContext()->nextImageIdToBeCreated(); |
474 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId5)).Times(1); | 474 EXPECT_CALL(*webContext(), bindTexImage2DMock(m_imageId5)).Times(1); |
475 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId3)).Times(1); | 475 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId3)).Times(1); |
476 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId3)).Times(1); | 476 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId3)).Times(1); |
477 // Prepare another mailbox and verify that it's the correct size. | 477 // Prepare another mailbox and verify that it's the correct size. |
478 m_drawingBuffer->markContentsChanged(); | 478 m_drawingBuffer->markContentsChanged(); |
479 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 479 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
480 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); | 480 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); |
481 EXPECT_TRUE(mailbox.allowOverlay); | 481 EXPECT_TRUE(mailbox.allowOverlay); |
482 testing::Mock::VerifyAndClearExpectations(webContext()); | 482 testing::Mock::VerifyAndClearExpectations(webContext()); |
483 | 483 |
484 // Prepare one final mailbox and verify that it's the correct size. | 484 // Prepare one final mailbox and verify that it's the correct size. |
485 m_drawingBuffer->mailboxReleased(mailbox); | 485 m_drawingBuffer->mailboxReleased(mailbox, false); |
486 m_drawingBuffer->markContentsChanged(); | 486 m_drawingBuffer->markContentsChanged(); |
487 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 487 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
488 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); | 488 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); |
489 EXPECT_TRUE(mailbox.allowOverlay); | 489 EXPECT_TRUE(mailbox.allowOverlay); |
490 m_drawingBuffer->mailboxReleased(mailbox); | 490 m_drawingBuffer->mailboxReleased(mailbox, false); |
491 | 491 |
492 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId5)).Times(1); | 492 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId5)).Times(1); |
493 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId5)).Times(1); | 493 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId5)).Times(1); |
494 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId4)).Times(1); | 494 EXPECT_CALL(*webContext(), destroyImageMock(m_imageId4)).Times(1); |
495 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId4)).Times(1); | 495 EXPECT_CALL(*webContext(), releaseTexImage2DMock(m_imageId4)).Times(1); |
496 m_drawingBuffer->beginDestruction(); | 496 m_drawingBuffer->beginDestruction(); |
497 testing::Mock::VerifyAndClearExpectations(webContext()); | 497 testing::Mock::VerifyAndClearExpectations(webContext()); |
498 } | 498 } |
499 | 499 |
500 class DepthStencilTrackingContext : public MockWebGraphicsContext3D { | 500 class DepthStencilTrackingContext : public MockWebGraphicsContext3D { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 } else { | 614 } else { |
615 EXPECT_EQ(0u, trackingContext->stencilAttachment()); | 615 EXPECT_EQ(0u, trackingContext->stencilAttachment()); |
616 EXPECT_EQ(0u, trackingContext->depthAttachment()); | 616 EXPECT_EQ(0u, trackingContext->depthAttachment()); |
617 } | 617 } |
618 | 618 |
619 drawingBuffer->beginDestruction(); | 619 drawingBuffer->beginDestruction(); |
620 } | 620 } |
621 } | 621 } |
622 | 622 |
623 } // namespace | 623 } // namespace |
OLD | NEW |