| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 gl->DeleteTextures(1, &sourceTexture); | 248 gl->DeleteTextures(1, &sourceTexture); |
| 249 | 249 |
| 250 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); | 250 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); |
| 251 | 251 |
| 252 gl->Flush(); | 252 gl->Flush(); |
| 253 | 253 |
| 254 GLbyte syncToken[24]; | 254 GLbyte syncToken[24]; |
| 255 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken); | 255 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken); |
| 256 sharedGL->WaitSyncTokenCHROMIUM(syncToken); | 256 sharedGL->WaitSyncTokenCHROMIUM(syncToken); |
| 257 // This disassociates the texture from the mailbox to avoid leaking the |
| 258 // mapping between the two. |
| 259 sharedGL->ProduceTextureDirectCHROMIUM(0, textureInfo->fTarget, mailbox->nam
e); |
| 257 | 260 |
| 258 // Undo grContext texture binding changes introduced in this function | 261 // Undo grContext texture binding changes introduced in this function |
| 259 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState); | 262 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState); |
| 260 | 263 |
| 261 return true; | 264 return true; |
| 262 } | 265 } |
| 263 | 266 |
| 264 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu
ffer, SourceDrawingBuffer sourceBuffer) | 267 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu
ffer, SourceDrawingBuffer sourceBuffer) |
| 265 { | 268 { |
| 266 if (!drawingBuffer || !m_surface->isAccelerated()) | 269 if (!drawingBuffer || !m_surface->isAccelerated()) |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 464 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 462 | 465 |
| 463 Vector<unsigned char> result; | 466 Vector<unsigned char> result; |
| 464 if (!encodeImage(mimeType, quality, &result)) | 467 if (!encodeImage(mimeType, quality, &result)) |
| 465 return "data:,"; | 468 return "data:,"; |
| 466 | 469 |
| 467 return "data:" + mimeType + ";base64," + base64Encode(result); | 470 return "data:" + mimeType + ";base64," + base64Encode(result); |
| 468 } | 471 } |
| 469 | 472 |
| 470 } // namespace blink | 473 } // namespace blink |
| OLD | NEW |