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

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

Issue 749653002: WebGL: clarify which Front or Back buffer is used by each API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 { 428 {
429 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 429 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
430 430
431 Vector<char> encodedImage; 431 Vector<char> encodedImage;
432 if (!isSurfaceValid() || !encodeImage(m_surface->bitmap(), mimeType, quality , &encodedImage)) 432 if (!isSurfaceValid() || !encodeImage(m_surface->bitmap(), mimeType, quality , &encodedImage))
433 return "data:,"; 433 return "data:,";
434 434
435 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); 435 return "data:" + mimeType + ";base64," + base64Encode(encodedImage);
436 } 436 }
437 437
438 String ImageDataToDataURL(const ImageDataBuffer& imageData, const String& mimeTy pe, const double* quality)
439 {
440 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
441
442 Vector<char> encodedImage;
443 if (!encodeImage(imageData, mimeType, quality, &encodedImage))
444 return "data:,";
445
446 return "data:" + mimeType + ";base64," + base64Encode(encodedImage);
447 }
448
449 } // namespace blink 438 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698