Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: Source/platform/graphics/ImageBuffer.cpp

Issue 837643002: Remove Uint8ClampedArray use from ImageBuffer.h ImageDataBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 { 394 {
395 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 395 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
396 396
397 Vector<char> encodedImage; 397 Vector<char> encodedImage;
398 if (!isSurfaceValid() || !encodeImage(m_surface->bitmap(), mimeType, quality , &encodedImage)) 398 if (!isSurfaceValid() || !encodeImage(m_surface->bitmap(), mimeType, quality , &encodedImage))
399 return "data:,"; 399 return "data:,";
400 400
401 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); 401 return "data:" + mimeType + ";base64," + base64Encode(encodedImage);
402 } 402 }
403 403
404 String ImageDataToDataURL(const ImageDataBuffer& imageData, const String& mimeTy pe, const double* quality) 404 String ImageDataBuffer::toDataURL(const String& mimeType, const double* quality) const
405 { 405 {
406 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 406 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
407 407
408 Vector<char> encodedImage; 408 Vector<char> encodedImage;
409 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) 409 if (!encodeImage(*this, mimeType, quality, &encodedImage))
410 return "data:,"; 410 return "data:,";
411 411
412 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); 412 return "data:" + mimeType + ";base64," + base64Encode(encodedImage);
413 } 413 }
414 414
415 } // namespace blink 415 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | Source/platform/image-encoders/skia/JPEGImageEncoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698