| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 sharedContext->flush(); | 212 sharedContext->flush(); |
| 213 | 213 |
| 214 mailbox->validSyncToken = sharedContext->insertSyncPoint(mailbox->syncToken)
; | 214 mailbox->validSyncToken = sharedContext->insertSyncPoint(mailbox->syncToken)
; |
| 215 if (mailbox->validSyncToken) | 215 if (mailbox->validSyncToken) |
| 216 context->waitSyncTokenCHROMIUM(mailbox->syncToken); | 216 context->waitSyncTokenCHROMIUM(mailbox->syncToken); |
| 217 | 217 |
| 218 Platform3DObject sourceTexture = context->createAndConsumeTextureCHROMIUM(GL
_TEXTURE_2D, mailbox->name); | 218 Platform3DObject sourceTexture = context->createAndConsumeTextureCHROMIUM(GL
_TEXTURE_2D, mailbox->name); |
| 219 | 219 |
| 220 // The canvas is stored in a premultiplied format, so unpremultiply if neces
sary. | 220 // The canvas is stored in a premultiplied format, so unpremultiply if neces
sary. |
| 221 // The canvas is stored in an inverted position, so the flip semantics are r
eversed. | 221 // The canvas is stored in an inverted position, so the flip semantics are r
eversed. |
| 222 context->copyTextureCHROMIUM(GL_TEXTURE_2D, sourceTexture, texture, internal
Format, destType, flipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FA
LSE : GL_TRUE); | 222 context->copyTextureCHROMIUM(sourceTexture, texture, internalFormat, destTyp
e, flipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE); |
| 223 | 223 |
| 224 context->deleteTexture(sourceTexture); | 224 context->deleteTexture(sourceTexture); |
| 225 | 225 |
| 226 context->flush(); | 226 context->flush(); |
| 227 | 227 |
| 228 WGC3Dbyte syncToken[24]; | 228 WGC3Dbyte syncToken[24]; |
| 229 if (context->insertSyncPoint(syncToken)) | 229 if (context->insertSyncPoint(syncToken)) |
| 230 sharedContext->waitSyncTokenCHROMIUM(syncToken); | 230 sharedContext->waitSyncTokenCHROMIUM(syncToken); |
| 231 | 231 |
| 232 // Undo grContext texture binding changes introduced in this function | 232 // Undo grContext texture binding changes introduced in this function |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 397 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 398 | 398 |
| 399 Vector<unsigned char> result; | 399 Vector<unsigned char> result; |
| 400 if (!encodeImage(mimeType, quality, &result)) | 400 if (!encodeImage(mimeType, quality, &result)) |
| 401 return "data:,"; | 401 return "data:,"; |
| 402 | 402 |
| 403 return "data:" + mimeType + ";base64," + base64Encode(result); | 403 return "data:" + mimeType + ";base64," + base64Encode(result); |
| 404 } | 404 } |
| 405 | 405 |
| 406 } // namespace blink | 406 } // namespace blink |
| OLD | NEW |