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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 gl->DeleteTextures(1, &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 GLbyte syncToken[24]; |
235 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken); | 235 gl->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 |
239 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState); | 239 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState); |
240 | 240 |
241 return true; | 241 return true; |
242 } | 242 } |
243 | 243 |
244 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu
ffer, SourceDrawingBuffer sourceBuffer) | 244 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu
ffer, SourceDrawingBuffer sourceBuffer) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 403 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
404 | 404 |
405 Vector<unsigned char> result; | 405 Vector<unsigned char> result; |
406 if (!encodeImage(mimeType, quality, &result)) | 406 if (!encodeImage(mimeType, quality, &result)) |
407 return "data:,"; | 407 return "data:,"; |
408 | 408 |
409 return "data:" + mimeType + ";base64," + base64Encode(result); | 409 return "data:" + mimeType + ";base64," + base64Encode(result); |
410 } | 410 } |
411 | 411 |
412 } // namespace blink | 412 } // namespace blink |
OLD | NEW |