| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return false; | 200 return false; |
| 201 | 201 |
| 202 OwnPtr<WebGraphicsContext3DProvider> provider = adoptPtr(Platform::current()
->createSharedOffscreenGraphicsContext3DProvider()); | 202 OwnPtr<WebGraphicsContext3DProvider> provider = adoptPtr(Platform::current()
->createSharedOffscreenGraphicsContext3DProvider()); |
| 203 if (!provider) | 203 if (!provider) |
| 204 return false; | 204 return false; |
| 205 WebGraphicsContext3D* sharedContext = provider->context3d(); | 205 WebGraphicsContext3D* sharedContext = provider->context3d(); |
| 206 if (!sharedContext) | 206 if (!sharedContext) |
| 207 return false; | 207 return false; |
| 208 | 208 |
| 209 OwnPtr<WebExternalTextureMailbox> mailbox = adoptPtr(new WebExternalTextureM
ailbox); | 209 OwnPtr<WebExternalTextureMailbox> mailbox = adoptPtr(new WebExternalTextureM
ailbox); |
| 210 mailbox->textureSize = WebSize(textureImage->width(), textureImage->height()
); |
| 210 | 211 |
| 211 // Contexts may be in a different share group. We must transfer the texture
through a mailbox first | 212 // Contexts may be in a different share group. We must transfer the texture
through a mailbox first |
| 212 sharedContext->genMailboxCHROMIUM(mailbox->name); | 213 sharedContext->genMailboxCHROMIUM(mailbox->name); |
| 213 sharedContext->produceTextureDirectCHROMIUM(textureInfo->fID, textureInfo->f
Target, mailbox->name); | 214 sharedContext->produceTextureDirectCHROMIUM(textureInfo->fID, textureInfo->f
Target, mailbox->name); |
| 214 const WGC3Duint64 sharedFenceSync = sharedContext->insertFenceSyncCHROMIUM()
; | 215 const WGC3Duint64 sharedFenceSync = sharedContext->insertFenceSyncCHROMIUM()
; |
| 215 sharedContext->flush(); | 216 sharedContext->flush(); |
| 216 | 217 |
| 217 mailbox->validSyncToken = sharedContext->genSyncTokenCHROMIUM(sharedFenceSyn
c, mailbox->syncToken); | 218 mailbox->validSyncToken = sharedContext->genSyncTokenCHROMIUM(sharedFenceSyn
c, mailbox->syncToken); |
| 218 if (mailbox->validSyncToken) | 219 if (mailbox->validSyncToken) |
| 219 context->waitSyncTokenCHROMIUM(mailbox->syncToken); | 220 context->waitSyncTokenCHROMIUM(mailbox->syncToken); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 406 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 406 | 407 |
| 407 Vector<unsigned char> result; | 408 Vector<unsigned char> result; |
| 408 if (!encodeImage(mimeType, quality, &result)) | 409 if (!encodeImage(mimeType, quality, &result)) |
| 409 return "data:,"; | 410 return "data:,"; |
| 410 | 411 |
| 411 return "data:" + mimeType + ";base64," + base64Encode(result); | 412 return "data:" + mimeType + ";base64," + base64Encode(result); |
| 412 } | 413 } |
| 413 | 414 |
| 414 } // namespace blink | 415 } // namespace blink |
| OLD | NEW |