| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 mailbox->validSyncToken = sharedContext->genSyncTokenCHROMIUM(sharedFenceSyn
c, mailbox->syncToken); | 218 mailbox->validSyncToken = sharedContext->genSyncTokenCHROMIUM(sharedFenceSyn
c, mailbox->syncToken); |
| 219 if (mailbox->validSyncToken) | 219 if (mailbox->validSyncToken) |
| 220 gl->WaitSyncTokenCHROMIUM(mailbox->syncToken); | 220 gl->WaitSyncTokenCHROMIUM(mailbox->syncToken); |
| 221 | 221 |
| 222 Platform3DObject sourceTexture = gl->CreateAndConsumeTextureCHROMIUM(texture
Info->fTarget, mailbox->name); | 222 Platform3DObject sourceTexture = gl->CreateAndConsumeTextureCHROMIUM(texture
Info->fTarget, mailbox->name); |
| 223 | 223 |
| 224 // The canvas is stored in a premultiplied format, so unpremultiply if neces
sary. | 224 // The canvas is stored in a premultiplied format, so unpremultiply if neces
sary. |
| 225 // The canvas is stored in an inverted position, so the flip semantics are r
eversed. | 225 // The canvas is stored in an inverted position, so the flip semantics are r
eversed. |
| 226 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl
ipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE); | 226 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl
ipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE); |
| 227 | 227 |
| 228 context->deleteTexture(sourceTexture); | 228 gl->DeleteTextures(1, &sourceTexture); |
| 229 | 229 |
| 230 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); | 230 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); |
| 231 | 231 |
| 232 gl->Flush(); | 232 gl->Flush(); |
| 233 | 233 |
| 234 WGC3Dbyte syncToken[24]; | 234 WGC3Dbyte syncToken[24]; |
| 235 if (context->genSyncTokenCHROMIUM(contextFenceSync, syncToken)) | 235 if (context->genSyncTokenCHROMIUM(contextFenceSync, syncToken)) |
| 236 sharedGL->WaitSyncTokenCHROMIUM(syncToken); | 236 sharedGL->WaitSyncTokenCHROMIUM(syncToken); |
| 237 | 237 |
| 238 // Undo grContext texture binding changes introduced in this function | 238 // Undo grContext texture binding changes introduced in this function |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 405 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 406 | 406 |
| 407 Vector<unsigned char> result; | 407 Vector<unsigned char> result; |
| 408 if (!encodeImage(mimeType, quality, &result)) | 408 if (!encodeImage(mimeType, quality, &result)) |
| 409 return "data:,"; | 409 return "data:,"; |
| 410 | 410 |
| 411 return "data:" + mimeType + ";base64," + base64Encode(result); | 411 return "data:" + mimeType + ";base64," + base64Encode(result); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace blink | 414 } // namespace blink |
| OLD | NEW |