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