| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 gl->WaitSyncTokenCHROMIUM(produceSyncToken.GetConstData()); | 252 gl->WaitSyncTokenCHROMIUM(produceSyncToken.GetConstData()); |
| 253 | 253 |
| 254 GLuint sourceTexture = | 254 GLuint sourceTexture = |
| 255 gl->CreateAndConsumeTextureCHROMIUM(textureInfo->fTarget, mailbox.name); | 255 gl->CreateAndConsumeTextureCHROMIUM(textureInfo->fTarget, mailbox.name); |
| 256 | 256 |
| 257 // The canvas is stored in a premultiplied format, so unpremultiply if | 257 // The canvas is stored in a premultiplied format, so unpremultiply if |
| 258 // necessary. The canvas is also stored in an inverted position, so the flip | 258 // necessary. The canvas is also stored in an inverted position, so the flip |
| 259 // semantics are reversed. | 259 // semantics are reversed. |
| 260 // It is expected that callers of this method have already allocated | 260 // It is expected that callers of this method have already allocated |
| 261 // the platform texture with the appropriate size. | 261 // the platform texture with the appropriate size. |
| 262 gl->CopySubTextureCHROMIUM(sourceTexture, 0, texture, 0, destPoint.x(), | 262 gl->CopySubTextureCHROMIUM( |
| 263 destPoint.y(), sourceSubRectangle.x(), | 263 sourceTexture, 0, GL_TEXTURE_2D, texture, 0, destPoint.x(), destPoint.y(), |
| 264 sourceSubRectangle.y(), sourceSubRectangle.width(), | 264 sourceSubRectangle.x(), sourceSubRectangle.y(), |
| 265 sourceSubRectangle.height(), | 265 sourceSubRectangle.width(), sourceSubRectangle.height(), |
| 266 flipY ? GL_FALSE : GL_TRUE, GL_FALSE, | 266 flipY ? GL_FALSE : GL_TRUE, GL_FALSE, |
| 267 premultiplyAlpha ? GL_FALSE : GL_TRUE); | 267 premultiplyAlpha ? GL_FALSE : GL_TRUE); |
| 268 | 268 |
| 269 gl->DeleteTextures(1, &sourceTexture); | 269 gl->DeleteTextures(1, &sourceTexture); |
| 270 | 270 |
| 271 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); | 271 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); |
| 272 | 272 |
| 273 gl->Flush(); | 273 gl->Flush(); |
| 274 | 274 |
| 275 gpu::SyncToken copySyncToken; | 275 gpu::SyncToken copySyncToken; |
| 276 gl->GenSyncTokenCHROMIUM(contextFenceSync, copySyncToken.GetData()); | 276 gl->GenSyncTokenCHROMIUM(contextFenceSync, copySyncToken.GetData()); |
| 277 sharedGL->WaitSyncTokenCHROMIUM(copySyncToken.GetConstData()); | 277 sharedGL->WaitSyncTokenCHROMIUM(copySyncToken.GetConstData()); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 DCHECK(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 568 DCHECK(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 569 | 569 |
| 570 Vector<unsigned char> result; | 570 Vector<unsigned char> result; |
| 571 if (!encodeImage(mimeType, quality, &result)) | 571 if (!encodeImage(mimeType, quality, &result)) |
| 572 return "data:,"; | 572 return "data:,"; |
| 573 | 573 |
| 574 return "data:" + mimeType + ";base64," + base64Encode(result); | 574 return "data:" + mimeType + ";base64," + base64Encode(result); |
| 575 } | 575 } |
| 576 | 576 |
| 577 } // namespace blink | 577 } // namespace blink |
| OLD | NEW |