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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 { | 356 { |
357 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 357 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
358 | 358 |
359 Vector<char> encodedImage; | 359 Vector<char> encodedImage; |
360 if (!encodeImage(*this, mimeType, quality, &encodedImage)) | 360 if (!encodeImage(*this, mimeType, quality, &encodedImage)) |
361 return "data:,"; | 361 return "data:,"; |
362 | 362 |
363 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); | 363 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); |
364 } | 364 } |
365 | 365 |
366 bool ImageDataBuffer::toDataVector(const String& mimeType, const double* quality , Vector<char>& encodedDataVector) const | |
Justin Novosad
2015/08/13 21:03:40
This is just a dumb wrapper. You might as well jus
xlai (Olivia)
2015/08/20 19:46:44
Done.
| |
367 { | |
368 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | |
369 | |
370 return encodeImage(*this, mimeType, quality, &encodedDataVector); | |
371 } | |
372 | |
366 } // namespace blink | 373 } // namespace blink |
OLD | NEW |