| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 if (!context3D || !textureImage) | 234 if (!context3D || !textureImage) |
| 235 return false; | 235 return false; |
| 236 ASSERT(textureImage->isTextureBacked()); | 236 ASSERT(textureImage->isTextureBacked()); |
| 237 // Get the texture ID, flushing pending operations if needed. | 237 // Get the texture ID, flushing pending operations if needed. |
| 238 Platform3DObject textureId = textureImage->getTextureHandle(true); | 238 Platform3DObject textureId = textureImage->getTextureHandle(true); |
| 239 if (!textureId) | 239 if (!textureId) |
| 240 return false; | 240 return false; |
| 241 | 241 |
| 242 context3D->flush(); | 242 context3D->flush(); |
| 243 | 243 |
| 244 m_surface->invalidateCachedBitmap(); | |
| 245 bool result = drawingBuffer->copyToPlatformTexture(context3D, textureId, GL_
RGBA, | 244 bool result = drawingBuffer->copyToPlatformTexture(context3D, textureId, GL_
RGBA, |
| 246 GL_UNSIGNED_BYTE, 0, true, false, sourceBuffer); | 245 GL_UNSIGNED_BYTE, 0, true, false, sourceBuffer); |
| 247 | 246 |
| 248 if (result) { | 247 if (result) { |
| 249 m_surface->didModifyBackingTexture(); | 248 m_surface->didModifyBackingTexture(); |
| 250 } | 249 } |
| 251 | 250 |
| 252 return result; | 251 return result; |
| 253 } | 252 } |
| 254 | 253 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 376 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 378 | 377 |
| 379 Vector<char> encodedImage; | 378 Vector<char> encodedImage; |
| 380 if (!encodeImage(*this, mimeType, quality, &encodedImage)) | 379 if (!encodeImage(*this, mimeType, quality, &encodedImage)) |
| 381 return "data:,"; | 380 return "data:,"; |
| 382 | 381 |
| 383 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); | 382 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); |
| 384 } | 383 } |
| 385 | 384 |
| 386 } // namespace blink | 385 } // namespace blink |
| OLD | NEW |