Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Side by Side Diff: Source/platform/graphics/gpu/DrawingBufferTest.cpp

Issue 251023004: WebGL: Free temporary GPU resources held by inactive or hidden WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to ToT Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); 350 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint());
351 351
352 m_drawingBuffer->beginDestruction(); 352 m_drawingBuffer->beginDestruction();
353 waitSyncPoint = webContext()->insertSyncPoint(); 353 waitSyncPoint = webContext()->insertSyncPoint();
354 mailbox.syncPoint = waitSyncPoint; 354 mailbox.syncPoint = waitSyncPoint;
355 m_drawingBuffer->mailboxReleased(mailbox); 355 m_drawingBuffer->mailboxReleased(mailbox);
356 // m_drawingBuffer waits for the sync point because the destruction is in pr ogress. 356 // m_drawingBuffer waits for the sync point because the destruction is in pr ogress.
357 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); 357 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint());
358 } 358 }
359 359
360 TEST_F(DrawingBufferTest, verifySetIsHiddenProperlyAffectsMailboxes)
361 {
362 blink::WebExternalTextureMailbox mailbox;
363
364 // Produce mailboxes.
365 m_drawingBuffer->markContentsChanged();
366 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
367
368 unsigned waitSyncPoint = webContext()->insertSyncPoint();
369 mailbox.syncPoint = waitSyncPoint;
370 m_drawingBuffer->setIsHidden(true);
371 m_drawingBuffer->mailboxReleased(mailbox);
372 // m_drawingBuffer deletes mailbox immediately when hidden.
373 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint());
374
375 // Fails to get mailbox when hidden.
376 EXPECT_FALSE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
377
378 m_drawingBuffer->beginDestruction();
379 }
380
360 } // namespace 381 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698