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

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

Issue 415123002: Let canvas decide how to handle the lost resource: WebGL part (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rename test case Created 6 years, 4 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
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBufferTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // set m_parentDrawingBuffer to make sure 'this' stays alive as long as it h as live mailboxes 270 // set m_parentDrawingBuffer to make sure 'this' stays alive as long as it h as live mailboxes
271 ASSERT(!frontColorBufferMailbox->m_parentDrawingBuffer); 271 ASSERT(!frontColorBufferMailbox->m_parentDrawingBuffer);
272 frontColorBufferMailbox->m_parentDrawingBuffer = this; 272 frontColorBufferMailbox->m_parentDrawingBuffer = this;
273 *outMailbox = frontColorBufferMailbox->mailbox; 273 *outMailbox = frontColorBufferMailbox->mailbox;
274 m_frontColorBuffer = frontColorBufferMailbox->textureInfo; 274 m_frontColorBuffer = frontColorBufferMailbox->textureInfo;
275 return true; 275 return true;
276 } 276 }
277 277
278 void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mail box, bool lostResource) 278 void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mail box, bool lostResource)
279 { 279 {
280 if (lostResource) { 280 if (m_destructionInProgress || m_context->isContextLost() || lostResource) {
281 // TODO(hmin): handle the case if the resource is lost.
282 return;
283 }
284
285 if (m_destructionInProgress) {
286 mailboxReleasedWhileDestructionInProgress(mailbox); 281 mailboxReleasedWhileDestructionInProgress(mailbox);
287 return; 282 return;
288 } 283 }
289 284
290 for (size_t i = 0; i < m_textureMailboxes.size(); i++) { 285 for (size_t i = 0; i < m_textureMailboxes.size(); i++) {
291 RefPtr<MailboxInfo> mailboxInfo = m_textureMailboxes[i]; 286 RefPtr<MailboxInfo> mailboxInfo = m_textureMailboxes[i];
292 if (nameEquals(mailboxInfo->mailbox, mailbox)) { 287 if (nameEquals(mailboxInfo->mailbox, mailbox)) {
293 mailboxInfo->mailbox.syncPoint = mailbox.syncPoint; 288 mailboxInfo->mailbox.syncPoint = mailbox.syncPoint;
294 ASSERT(mailboxInfo->m_parentDrawingBuffer.get() == this); 289 ASSERT(mailboxInfo->m_parentDrawingBuffer.get() == this);
295 mailboxInfo->m_parentDrawingBuffer.clear(); 290 mailboxInfo->m_parentDrawingBuffer.clear();
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) 1049 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info)
1055 { 1050 {
1056 if (info->imageId) { 1051 if (info->imageId) {
1057 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); 1052 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId);
1058 m_context->destroyImageCHROMIUM(info->imageId); 1053 m_context->destroyImageCHROMIUM(info->imageId);
1059 info->imageId = 0; 1054 info->imageId = 0;
1060 } 1055 }
1061 } 1056 }
1062 1057
1063 } // namespace blink 1058 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/gpu/DrawingBufferTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698