OLD | NEW |
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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 markLayerComposited(); | 268 markLayerComposited(); |
269 | 269 |
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) | 278 void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mail
box, bool lostResource) |
279 { | 279 { |
| 280 if (lostResource) { |
| 281 // TODO(hmin): handle the case if the resource is lost. |
| 282 return; |
| 283 } |
| 284 |
280 if (m_destructionInProgress) { | 285 if (m_destructionInProgress) { |
281 mailboxReleasedWhileDestructionInProgress(mailbox); | 286 mailboxReleasedWhileDestructionInProgress(mailbox); |
282 return; | 287 return; |
283 } | 288 } |
284 | 289 |
285 for (size_t i = 0; i < m_textureMailboxes.size(); i++) { | 290 for (size_t i = 0; i < m_textureMailboxes.size(); i++) { |
286 RefPtr<MailboxInfo> mailboxInfo = m_textureMailboxes[i]; | 291 RefPtr<MailboxInfo> mailboxInfo = m_textureMailboxes[i]; |
287 if (nameEquals(mailboxInfo->mailbox, mailbox)) { | 292 if (nameEquals(mailboxInfo->mailbox, mailbox)) { |
288 mailboxInfo->mailbox.syncPoint = mailbox.syncPoint; | 293 mailboxInfo->mailbox.syncPoint = mailbox.syncPoint; |
289 ASSERT(mailboxInfo->m_parentDrawingBuffer.get() == this); | 294 ASSERT(mailboxInfo->m_parentDrawingBuffer.get() == this); |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) | 1068 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) |
1064 { | 1069 { |
1065 if (info->imageId) { | 1070 if (info->imageId) { |
1066 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); | 1071 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); |
1067 m_context->destroyImageCHROMIUM(info->imageId); | 1072 m_context->destroyImageCHROMIUM(info->imageId); |
1068 info->imageId = 0; | 1073 info->imageId = 0; |
1069 } | 1074 } |
1070 } | 1075 } |
1071 | 1076 |
1072 } // namespace blink | 1077 } // namespace blink |
OLD | NEW |