| 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 17 matching lines...) Expand all Loading... |
| 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 */ | 31 */ |
| 32 | 32 |
| 33 #include "platform/graphics/ImageBuffer.h" | 33 #include "platform/graphics/ImageBuffer.h" |
| 34 | 34 |
| 35 #include "gpu/command_buffer/client/gles2_interface.h" | 35 #include "gpu/command_buffer/client/gles2_interface.h" |
| 36 #include "gpu/command_buffer/common/mailbox.h" | 36 #include "gpu/command_buffer/common/mailbox.h" |
| 37 #include "gpu/command_buffer/common/sync_token.h" | 37 #include "gpu/command_buffer/common/sync_token.h" |
| 38 #include "platform/MIMETypeRegistry.h" | |
| 39 #include "platform/RuntimeEnabledFeatures.h" | 38 #include "platform/RuntimeEnabledFeatures.h" |
| 40 #include "platform/geometry/IntRect.h" | 39 #include "platform/geometry/IntRect.h" |
| 41 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | 40 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
| 42 #include "platform/graphics/GraphicsContext.h" | 41 #include "platform/graphics/GraphicsContext.h" |
| 43 #include "platform/graphics/ImageBufferClient.h" | 42 #include "platform/graphics/ImageBufferClient.h" |
| 44 #include "platform/graphics/RecordingImageBufferSurface.h" | 43 #include "platform/graphics/RecordingImageBufferSurface.h" |
| 45 #include "platform/graphics/StaticBitmapImage.h" | 44 #include "platform/graphics/StaticBitmapImage.h" |
| 46 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 45 #include "platform/graphics/UnacceleratedImageBufferSurface.h" |
| 47 #include "platform/graphics/gpu/DrawingBuffer.h" | 46 #include "platform/graphics/gpu/DrawingBuffer.h" |
| 48 #include "platform/graphics/gpu/Extensions3DUtil.h" | 47 #include "platform/graphics/gpu/Extensions3DUtil.h" |
| 49 #include "platform/graphics/skia/SkiaUtils.h" | 48 #include "platform/graphics/skia/SkiaUtils.h" |
| 50 #include "platform/image-encoders/JPEGImageEncoder.h" | 49 #include "platform/image-encoders/JPEGImageEncoder.h" |
| 51 #include "platform/image-encoders/PNGImageEncoder.h" | 50 #include "platform/image-encoders/PNGImageEncoder.h" |
| 52 #include "platform/image-encoders/WEBPImageEncoder.h" | 51 #include "platform/image-encoders/WEBPImageEncoder.h" |
| 52 #include "platform/network/mime/MIMETypeRegistry.h" |
| 53 #include "public/platform/Platform.h" | 53 #include "public/platform/Platform.h" |
| 54 #include "public/platform/WebGraphicsContext3DProvider.h" | 54 #include "public/platform/WebGraphicsContext3DProvider.h" |
| 55 #include "skia/ext/texture_handle.h" | 55 #include "skia/ext/texture_handle.h" |
| 56 #include "third_party/skia/include/core/SkPicture.h" | 56 #include "third_party/skia/include/core/SkPicture.h" |
| 57 #include "third_party/skia/include/core/SkSwizzle.h" | 57 #include "third_party/skia/include/core/SkSwizzle.h" |
| 58 #include "third_party/skia/include/gpu/GrContext.h" | 58 #include "third_party/skia/include/gpu/GrContext.h" |
| 59 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" | 59 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" |
| 60 #include "wtf/CheckedNumeric.h" | 60 #include "wtf/CheckedNumeric.h" |
| 61 #include "wtf/MathExtras.h" | 61 #include "wtf/MathExtras.h" |
| 62 #include "wtf/PtrUtil.h" | 62 #include "wtf/PtrUtil.h" |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 562 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 563 | 563 |
| 564 Vector<unsigned char> result; | 564 Vector<unsigned char> result; |
| 565 if (!encodeImage(mimeType, quality, &result)) | 565 if (!encodeImage(mimeType, quality, &result)) |
| 566 return "data:,"; | 566 return "data:,"; |
| 567 | 567 |
| 568 return "data:" + mimeType + ";base64," + base64Encode(result); | 568 return "data:" + mimeType + ";base64," + base64Encode(result); |
| 569 } | 569 } |
| 570 | 570 |
| 571 } // namespace blink | 571 } // namespace blink |
| OLD | NEW |