| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 return 0; | 164 return 0; |
| 165 #endif // !ENABLE(CANVAS_USES_MAILBOX) | 165 #endif // !ENABLE(CANVAS_USES_MAILBOX) |
| 166 } | 166 } |
| 167 | 167 |
| 168 WebGraphicsContext3D* Canvas2DLayerBridge::context() | 168 WebGraphicsContext3D* Canvas2DLayerBridge::context() |
| 169 { | 169 { |
| 170 return m_context->webContext(); | 170 return m_context->webContext(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 bool Canvas2DLayerBridge::prepareMailbox(WebKit::WebExternalTextureMailbox* outM
ailbox) | 173 bool Canvas2DLayerBridge::prepareMailbox(WebKit::WebExternalTextureMailbox* outM
ailbox, WebKit::WebExternalBitmap* bitmap) |
| 174 { | 174 { |
| 175 #if ENABLE(CANVAS_USES_MAILBOX) | 175 #if ENABLE(CANVAS_USES_MAILBOX) |
| 176 ASSERT(!bitmap); |
| 176 // Release to skia textures that were previouosly released by the | 177 // Release to skia textures that were previouosly released by the |
| 177 // compositor. We do this before acquiring the next snapshot in | 178 // compositor. We do this before acquiring the next snapshot in |
| 178 // order to cap maximum gpu memory consumption. | 179 // order to cap maximum gpu memory consumption. |
| 179 m_context->makeContextCurrent(); | 180 m_context->makeContextCurrent(); |
| 180 Vector<MailboxInfo>::iterator mailboxInfo; | 181 Vector<MailboxInfo>::iterator mailboxInfo; |
| 181 for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mai
lboxInfo++) { | 182 for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mai
lboxInfo++) { |
| 182 if (mailboxInfo->m_status == MailboxReleased) { | 183 if (mailboxInfo->m_status == MailboxReleased) { |
| 183 if (mailboxInfo->m_mailbox.syncPoint) { | 184 if (mailboxInfo->m_mailbox.syncPoint) { |
| 184 context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint); | 185 context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint); |
| 185 mailboxInfo->m_mailbox.syncPoint = 0; | 186 mailboxInfo->m_mailbox.syncPoint = 0; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // This copy constructor should only be used for Vector reallocation | 301 // This copy constructor should only be used for Vector reallocation |
| 301 // Assuming 'other' is to be destroyed, we swap m_image ownership | 302 // Assuming 'other' is to be destroyed, we swap m_image ownership |
| 302 // rather than do a refcount dance. | 303 // rather than do a refcount dance. |
| 303 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); | 304 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); |
| 304 m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image)); | 305 m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image)); |
| 305 m_status = other.m_status; | 306 m_status = other.m_status; |
| 306 } | 307 } |
| 307 #endif | 308 #endif |
| 308 | 309 |
| 309 } | 310 } |
| OLD | NEW |