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 16 matching lines...) Expand all Loading... |
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
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 "config.h" | 33 #include "config.h" |
34 #include "core/platform/graphics/ImageBuffer.h" | 34 #include "core/platform/graphics/ImageBuffer.h" |
35 | 35 |
36 #include "GrContext.h" | 36 #include "GrContext.h" |
37 #include "SkColorPriv.h" | |
38 #include "SkGpuDevice.h" | |
39 #include "SkSurface.h" | 37 #include "SkSurface.h" |
40 #include "core/html/ImageData.h" | 38 #include "core/html/ImageData.h" |
41 #include "core/platform/MIMETypeRegistry.h" | |
42 #include "core/platform/graphics/BitmapImage.h" | 39 #include "core/platform/graphics/BitmapImage.h" |
43 #include "core/platform/graphics/Extensions3D.h" | 40 #include "core/platform/graphics/Extensions3D.h" |
44 #include "core/platform/graphics/GraphicsContext.h" | 41 #include "core/platform/graphics/GraphicsContext.h" |
45 #include "core/platform/graphics/GraphicsContext3D.h" | 42 #include "core/platform/graphics/GraphicsContext3D.h" |
46 #include "core/platform/graphics/chromium/Canvas2DLayerBridge.h" | 43 #include "core/platform/graphics/chromium/Canvas2DLayerBridge.h" |
47 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" | 44 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" |
48 #include "core/platform/graphics/skia/MemoryInstrumentationSkia.h" | |
49 #include "core/platform/graphics/skia/NativeImageSkia.h" | 45 #include "core/platform/graphics/skia/NativeImageSkia.h" |
50 #include "core/platform/graphics/skia/SkiaUtils.h" | 46 #include "core/platform/graphics/skia/SkiaUtils.h" |
51 #include "core/platform/image-encoders/skia/JPEGImageEncoder.h" | 47 #include "core/platform/image-encoders/skia/JPEGImageEncoder.h" |
52 #include "core/platform/image-encoders/skia/PNGImageEncoder.h" | 48 #include "core/platform/image-encoders/skia/PNGImageEncoder.h" |
53 #include "core/platform/image-encoders/skia/WEBPImageEncoder.h" | 49 #include "core/platform/image-encoders/skia/WEBPImageEncoder.h" |
54 #include <public/Platform.h> | 50 #include <public/Platform.h> |
55 | 51 |
56 #include <wtf/text/Base64.h> | 52 #include <wtf/text/Base64.h> |
57 #include <wtf/text/WTFString.h> | 53 #include <wtf/text/WTFString.h> |
58 | 54 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) | 433 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) |
438 return "data:,"; | 434 return "data:,"; |
439 | 435 |
440 Vector<char> base64Data; | 436 Vector<char> base64Data; |
441 base64Encode(encodedImage, base64Data); | 437 base64Encode(encodedImage, base64Data); |
442 | 438 |
443 return "data:" + mimeType + ";base64," + base64Data; | 439 return "data:" + mimeType + ";base64," + base64Data; |
444 } | 440 } |
445 | 441 |
446 } // namespace WebCore | 442 } // namespace WebCore |
OLD | NEW |